create_stan_data: Create Stan Data Required for estimate_infections

create_stan_dataR Documentation

Create Stan Data Required for estimate_infections

Description

[Stable] 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(
  data,
  seeding_time,
  rt,
  gp,
  obs,
  horizon,
  backcalc,
  shifted_cases
)

Arguments

data

A ⁠<data.frame>⁠ of confirmed cases (confirm) by date (date). confirm must be numeric and date must be in date format.

seeding_time

Integer; seeding time, usually obtained using get_seeding_time().

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().

horizon

Numeric, defaults to 7. Number of days into the future to forecast.

backcalc

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

shifted_cases

A ⁠<data.frame>⁠ of delay shifted cases

Value

A list of stan data

Examples

create_stan_data(
 example_confirmed, 7, rt_opts(), gp_opts(), obs_opts(), 7,
 backcalc_opts(), create_shifted_cases(example_confirmed, 7, 14, 7)
)

epiforecasts/EpiNow2 documentation built on April 27, 2024, 9:15 p.m.