diff --git a/R/create.R b/R/create.R index efaccdca2..8f6b1afd3 100644 --- a/R/create.R +++ b/R/create.R @@ -625,7 +625,7 @@ create_initial_conditions <- function(data) { if (data$seeding_time > 1) { out$initial_growth <- array(rnorm(1, data$prior_growth, 0.01)) } - out$base_cov <- rnorm( + out$base_cov <- array(rnorm( n = 1, mean = convert_to_logmean(data$r_mean, data$r_sd), sd = convert_to_logsd(data$r_mean, data$r_sd) * 0.1 )) diff --git a/inst/stan/data/simulation_rt.stan b/inst/stan/data/simulation_rt.stan index 3beae3161..f53ba0a4d 100644 --- a/inst/stan/data/simulation_rt.stan +++ b/inst/stan/data/simulation_rt.stan @@ -1,4 +1,4 @@ - array[n, 1] real initial_infections; // initial logged infections + array[n, seeding_time ? 1 : 0] real initial_infections; // initial logged infections array[n, seeding_time > 1 ? 1 : 0] real initial_growth; //initial growth matrix[n, t - seeding_time] R; // reproduction number diff --git a/inst/stan/simulate_secondary.stan b/inst/stan/simulate_secondary.stan index 3e9a11476..6fabff25c 100644 --- a/inst/stan/simulate_secondary.stan +++ b/inst/stan/simulate_secondary.stan @@ -62,7 +62,9 @@ generated quantities { // weekly reporting effect if (week_effect > 1) { - secondary = day_of_week_effect(secondary, day_of_week, to_vector(day_of_week_simplex[i])); + secondary = day_of_week_effect( + secondary, day_of_week, to_vector(day_of_week_simplex[i]) + ); } // truncate near time cases to observed reports @@ -79,6 +81,8 @@ generated quantities { } // simulate secondary reports - sim_secondary[i] = report_rng(tail(secondary, all_dates ? t : h), rep_phi[i], obs_dist); + sim_secondary[i] = report_rng( + tail(secondary, all_dates ? t : h), rep_phi[i], obs_dist + ); } }