Skip to content

Update phi parameterisation #487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Oct 25, 2023
Prev Previous commit
Next Next commit
Catch another sqrt_phi
  • Loading branch information
seabbs authored Oct 24, 2023
commit 62b5b8e0d16c56ef423013b2e134f8bdd48bef81
2 changes: 1 addition & 1 deletion inst/stan/functions/observation_model.stan
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ array[] int report_rng(vector reports, array[] real rep_phi, int model_type) {
sampled_reports[s] = 0;
} else {
// defer to poisson if phi is large, to avoid overflow
if (sqrt_phi > 1e4) {
if (dispersion > 1e4) {
sampled_reports[s] = poisson_rng(reports[s] > 1e8 ? 1e8 : reports[s]);
} else {
sampled_reports[s] = neg_binomial_2_rng(reports[s] > 1e8 ? 1e8 : reports[s], dispersion);
Expand Down