-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
When using the RSTbx, one of the users reported encountering the following error/warnings:
/home/user/Documents/python/RateStabilizingToolbox/model/param_updates.py:6: RuntimeWarning: divide by zero encountered in divide
return np.log(x / (1 - x))
31.6%
/home/user/Documents/python/RateStabilizingToolbox/model/param_updates.py:42: RuntimeWarning: divide by zero encountered in divide
sig_thres = (1 / ((A + pi) * (1 - pi)) - tau2 * (1 + 1 / m0)) * m0
/home/user/Documents/python/RateStabilizingToolbox/model/param_updates.py:55: RuntimeWarning: divide by zero encountered in divide
tau_thres = (1 / ((A + pi) * (1 - pi)) - sig2 / m0) / (1 + 1 / m0)
/home/user/Documents/python/RateStabilizingToolbox/model/param_updates.py:55: RuntimeWarning: invalid value encountered in subtract
tau_thres = (1 / ((A + pi) * (1 - pi)) - sig2 / m0) / (1 + 1 / m0)
OverflowError: Range exceeds valid bounds
Traceback:
Cell In[2], line 56, in rst(input_table_path, input_table_fields, input_feature_path, input_feature_fields, additional_options, age_group_field, std_pop_year, std_age_groups)
53 Y = np.array(input_table[input_table_event_name]).reshape([num_region, n_age_groups])
54 n = np.array(input_table[input_table_pop_name]).reshape([num_region, n_age_groups])
---> 56 theta_out = model.runner.gibbs_rucar(Y, n, input_feature_adj, std_pop)
57 output = model.param_updates.expit(theta_out) * rate_per / n_years
59 if std_pop_year:
File ~/Documents/python/RateStabilizingToolbox/model/runner.py:67, in gibbs_rucar(Y, n, adj, std_pop)
65 for s in range(6000):
66 sig2 = param_updates.sample_sig2(beta, Z, tau2, num_island_region, adj, num_adj, num_region, num_group, num_island, sigma_a, sigma_b, m0, A)
---> 67 tau2 = param_updates.sample_tau2(tau2, theta, beta, Z, sig2, island_id, num_island_region, num_region, num_group, num_island, tau_a, tau_b, A, m0)
68 beta = param_updates.sample_beta(beta, tau2, theta, Z, sig2, num_island_region, isl_reg, num_group, num_island, A, m0)
69 Z = param_updates.sample_Z(Z, tau2, sig2, theta, beta, num_adj, island_id, isl_reg, adj, num_region, num_island)
File ~/Documents/python/RateStabilizingToolbox/model/param_updates.py:61, in sample_tau2(tau2, theta, beta, Z, sig2, island_id, num_island_region, num_region, num_group, num_island, tau_a, tau_b, A, m0)
59 if (tau_max == 0).any():
60 return tau2
---> 61 u = np.random.uniform(0, tau_max, num_group)
62 tau2 = 1 / gamma.ppf(u, a_tau, scale = b_tau)
63 return tau2
Metadata
Metadata
Assignees
Labels
No labels