diff --git a/inst/stan/estimate_secondary.stan b/inst/stan/estimate_secondary.stan index 246647ef5..15836243c 100644 --- a/inst/stan/estimate_secondary.stan +++ b/inst/stan/estimate_secondary.stan @@ -73,13 +73,6 @@ transformed parameters { secondary = day_of_week_effect(secondary, day_of_week, day_of_week_simplex); } - // accumulate reports - if (any_accumulate) { - profile("accumulate") { - secondary = accumulate_reports(secondary, accumulate); - } - } - // truncate near time cases to observed reports if (trunc_id) { vector[delay_type_max[trunc_id]] trunc_rev_cmf = get_delay_rev_pmf( @@ -90,6 +83,13 @@ transformed parameters { ); secondary = truncate_obs(secondary, trunc_rev_cmf, 0); } + + // accumulate reports + if (any_accumulate) { + profile("accumulate") { + secondary = accumulate_reports(secondary, accumulate); + } + } } model {