From abb8d1ceba097faded6064836a009db4190e9f3a Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Sat, 23 Nov 2024 12:16:12 +0000 Subject: [PATCH] accumulate after truncation --- inst/stan/estimate_secondary.stan | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 {