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.
create_stan_data(data, seeding_time, rt, gp, obs, backcalc, forecast, params)A list of stan data
A <data.frame> of disease reports (confirm) by date (date).
confirm must be numeric and date must be in date format. Optionally,
data can also have a logical accumulate column which indicates whether
data should be added to the next data point. This is useful when modelling
e.g. weekly incidence data. See also the fill_missing() function which
helps add the accumulate column with the desired properties when dealing
with non-daily data. If any accumulation is done this happens after
truncation as specified by the truncation argument. If all entries
of confirm are missing (NA) the returned estimates will represent the
prior distributions.
Integer; seeding time, usually obtained using
get_seeding_time().
A list of options as generated by rt_opts() defining Rt
estimation. Defaults to rt_opts(). To generate new infections using
the non-mechanistic model instead of the renewal equation model, use
rt = NULL. The non-mechanistic model internally uses the setting
rt = rt_opts(use_rt = FALSE, future = "project", gp_on = "R0").
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.
A list of options as generated by obs_opts() defining the
observation model. Defaults to obs_opts().
A list of options as generated by backcalc_opts() to
define the back calculation. Defaults to backcalc_opts().
A list of options as generated by forecast_opts() defining
the forecast opitions. Defaults to forecast_opts(). If NULL then no
forecasting will be done.
A list of <EpiNow2.params> as created by make_param()
if (FALSE) {
create_stan_data(
example_confirmed, 7, rt_opts(), gp_opts(), obs_opts(), 7,
backcalc_opts(), create_shifted_cases(example_confirmed, 7, 14, 7)
)
}
Run the code above in your browser using DataLab