| format_simulation_output | R Documentation |
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
)
stan_fit |
A |
data |
A list of the data supplied to the simulation. |
reported_dates |
A vector of dates to report estimates for. |
imputed_dates |
A vector of dates to report imputed reports for. |
reported_inf_dates |
A vector of dates to report infection estimates for. |
drop_length_1 |
Logical; drop dimensions of length 1 in arrays extracted from the stan fit. Used in simulations where there's only 1 realization. |
merge |
if TRUE, merge samples into a single data.table using rbindlist. If FALSE returns a list of samples by parameter. |
A list of <data.frame>'s each containing the simulated trajectories
of each parameter, or a single merged data.table if merge = TRUE.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.