Formats simulation output from Stan models into structured data.tables with
dates. This is an internal function used by
simulate_infections() and
forecast_infections() to process simulation results.
This differs from get_samples() in that it's designed for simulation
outputs which have different array structures (especially with
drop_length_1 = TRUE) and need different date ranges for different
parameters.
format_simulation_output(
stan_fit,
data,
reported_dates,
imputed_dates,
reported_inf_dates,
drop_length_1 = FALSE,
merge = FALSE
)A list of <data.frame>'s each containing the simulated trajectories
of each parameter, or a single merged data.table if merge = TRUE.
A <stanfit> or <CmdStanMCMC> object as returned by
fit_model().
A list of the data supplied to the simulation.
A vector of dates to report estimates for.
A vector of dates to report imputed reports for.
A vector of dates to report infection estimates for.
Logical; drop dimensions of length 1 in arrays extracted from the stan fit. Used in simulations where there's only 1 realization.
if TRUE, merge samples into a single data.table using rbindlist. If FALSE returns a list of samples by parameter.