Skip to content

Fixed rep phi #560

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 6 commits into from
Feb 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update stan model
  • Loading branch information
sbfnk authored and seabbs committed Feb 20, 2024
commit 72d4f478710d00165904f6e232d34c91404eee8d
6 changes: 4 additions & 2 deletions inst/stan/functions/observation_model.stan
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ void report_lp(array[] int cases, array[] int cases_time, vector reports,
obs_cases = cases;
}
if (model_type) {
real dispersion = 1 / pow(rep_phi[model_type], 2);
rep_phi[model_type] ~ normal(phi_mean, phi_sd) T[0,];
real dispersion = 1 / pow(phi_sd > 0 ? rep_phi[model_type] : phi_mean, 2);
if (phi_sd > 0) {
rep_phi[model_type] ~ normal(phi_mean, phi_sd) T[0,];
}
if (weight == 1) {
obs_cases ~ neg_binomial_2(obs_reports, dispersion);
} else {
Expand Down