Skip to content

Commit

Permalink
Modify priors on eta_sd and inf_feedback (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaitejohnson authored Nov 12, 2024
1 parent 878d7f8 commit bb1478d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ hospital admissions to output of function and package data. ([#184](https://gith
- `get_plot_subpop_rt()` now uses a shared y-axis to facilitate comparison of R(t) estimates) ([#245](https://github.com/CDCgov/ww-inference-model/issues/245))

## Internal changes
- Updated the workflow for posting the pages artifact to PRs (issue [#229](https://github.com/CDCgov/ww-inference-model/issues/229)).
- Modified the priors on the infection feedback term and the step size of the weekly random walk in the effective reproductive number (issue [#227](https://github.com/CDCgov/ww-inference-model/issues/227)), based on benchmarking results from the evaluation pipeline described in the [PR](https://github.com/CDCgov/ww-inference-model/pull/236) corresponding to this change.
- Updated the workflow for posting the pages artifact to PRs (issue [#229](https://github.com/CDCgov/ww-inference-model/issues/229)(https://github.com/CDCgov/ww-inference-model/issues/229)).
- Modify `plot_forecasted_counts()` so that it does not require an evaluation dataset ([#218](https://github.com/CDCgov/ww-inference-model/pull/218))

# wwinference 0.1.0
Expand Down
1 change: 1 addition & 0 deletions R/get_stan_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ get_stan_data <- function(input_count_data,
sd_log_sigma_ww_site_prior_sd =
params$sd_log_sigma_ww_site_prior_sd,
eta_sd_sd = params$eta_sd_sd,
eta_sd_mean = params$eta_sd_mean,
sigma_i_first_obs_prior_mode = params$sigma_i_first_obs_prior_mode,
sigma_i_first_obs_prior_sd = params$sigma_i_first_obs_prior_sd,
p_hosp_prior_mean = params$p_hosp_mean,
Expand Down
6 changes: 4 additions & 2 deletions inst/extdata/example_params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ offset_ref_initial_exp_growth_rate_prior_sd = 0.025

autoreg_p_hosp_a = 1 # shape1 parameter of autoreg term on IHR(t) trend
autoreg_p_hosp_b = 100 # shape2 parameter of autoreg term on IHR(t) trend
eta_sd_mean = 0.0278 # from posterior of fit to long time series
eta_sd_sd = 0.01
infection_feedback_prior_logmean = 6.37408 # log(mode) + q^2 mode = 500, q = 0.4
infection_feedback_prior_logsd = 0.4
infection_feedback_prior_logmean = 4.498 # log(~90) from posterior of fit to long
# time series
infection_feedback_prior_logsd = 0.636 # log(~1.9)

[hospital_admission_observation_process]
# Hospitalization parameters (informative priors)
Expand Down
3 changes: 2 additions & 1 deletion inst/stan/wwinference.stan
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ data {
real sd_log_sigma_ww_site_prior_mode;
real<lower=0> sd_log_sigma_ww_site_prior_sd;
real<lower=0> eta_sd_sd;
real<lower=0> eta_sd_mean;
real p_hosp_prior_mean;
real<lower=0> p_hosp_sd_logit;
real<lower=0> p_hosp_w_sd_sd;
Expand Down Expand Up @@ -325,7 +326,7 @@ model {
offset_ref_logit_i_first_obs_prior_sd);
offset_ref_initial_exp_growth_rate ~ normal(offset_ref_initial_exp_growth_rate_prior_mean,
offset_ref_initial_exp_growth_rate_prior_sd);
eta_sd ~ normal(0, eta_sd_sd);
eta_sd ~ normal(eta_sd_mean, eta_sd_sd);
autoreg_rt_subpop ~ beta(autoreg_rt_subpop_a, autoreg_rt_subpop_b);

autoreg_rt ~ beta(autoreg_rt_a, autoreg_rt_b);
Expand Down
3 changes: 1 addition & 2 deletions tests/testthat/test_preprocess_ww_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,7 @@ test_that("Function handles LOD values equal to concentration values", {

test_that("Constant population per site", {
wrong_pop <- ww_data

wrong_pop$site_pop <- 1e6 + seq_len(nrow(ww_data))
wrong_pop$site_pop[1] <- ww_data$site_pop[1] + 1000

expect_error(
preprocess_ww_data(
Expand Down

0 comments on commit bb1478d

Please sign in to comment.