50% off: Unlimited data and AI learning.
State of Data and AI Literacy Report 2025

EpiNow2 (version 1.3.2)

create_stan_data: Create Stan Data Required for estimate_infections

Description

Takes the output of stan_opts() and converts it into a list understood by stan. Internally calls the other create_ family of functions to construct a single list for input into stan with all data required present.

Usage

create_stan_data(
  reported_cases,
  generation_time,
  rt,
  gp,
  obs,
  delays,
  horizon,
  backcalc,
  shifted_cases,
  truncation
)

Arguments

reported_cases

A data frame of confirmed cases (confirm) by date (date). confirm must be integer and date must be in date format.

generation_time

A list containing the mean, standard deviation of the mean (mean_sd), standard deviation (sd), standard deviation of the standard deviation and the maximum allowed value for the generation time (assuming a gamma distribution).

rt

A list of options as generated by rt_opts() defining Rt estimation. Defaults to rt_opts(). Set to NULL to switch to using back calculation rather than generating infections using Rt.

gp

A list of options as generated by gp_opts() to define the Gaussian process. Defaults to gp_opts().Set to NULL to disable the Gaussian process.

obs

A list of options as generated by obs_opts() defining the observation model. Defaults to obs_opts().

delays

A call to delay_opts() defining delay distributions and options. See the documentation of delay_opts() and the examples below for details.

horizon

Numeric, forecast horizon.

backcalc

A list of options as generated by backcalc_opts() to define the back calculation. Defaults to backcalc_opts().

shifted_cases

A dataframe of delay shifted cases

truncation

A list of options as generated by trunc_opts() defining the truncation of observed data. Defaults to trunc_opts(). See estimate_truncation() for an approach to estimating truncation from data.

Value

A list of stan data