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
sqrt_phi -> dispersion
  • Loading branch information
seabbs authored Oct 24, 2023
commit c64d812e5bbc5e8b7dac700239580da8ade29674
4 changes: 2 additions & 2 deletions inst/stan/functions/observation_model.stan
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void report_lp(array[] int cases, vector reports,
if (weight == 1) {
cases ~ neg_binomial_2(reports, dispersion);
} else {
target += neg_binomial_2_lpmf(cases | reports, sqrt_phi) * weight;
target += neg_binomial_2_lpmf(cases | reports, dispersion) * weight;
}
} else {
if (weight == 1) {
Expand Down Expand Up @@ -106,7 +106,7 @@ array[] int report_rng(vector reports, array[] real rep_phi, int model_type) {
if (sqrt_phi > 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], sqrt_phi);
sampled_reports[s] = neg_binomial_2_rng(reports[s] > 1e8 ? 1e8 : reports[s], dispersion);
}
}
}
Expand Down