Learn R Programming

EpiNow2 (version 1.6.1)

update_secondary_args: Update estimate_secondary default priors

Description

[Stable] This functions allows the user to more easily specify data driven or model based priors for estimate_secondary() from example from previous model fits using a <data.frame> to overwrite other default settings. Note that default settings are still required.

Usage

update_secondary_args(data, priors, verbose = TRUE)

Value

A list as produced by create_stan_data().

Arguments

data

A list of data and arguments as returned by create_stan_data().

priors

A <data.frame> of named priors to be used in model fitting rather than the defaults supplied from other arguments. This is typically useful if wanting to inform a estimate from the posterior of another model fit. Priors that are currently use to update the defaults are the scaling fraction ("frac_obs"), and delay parameters ("delay_params"). The <data.frame> should have the following variables: variable, mean, and sd.

verbose

Logical, defaults to FALSE. Should verbose progress messages be returned.

Examples

Run this code
priors <- data.frame(variable = "frac_obs", mean = 3, sd = 1)
data <- list(obs_scale_mean = 4, obs_scale_sd = 3)
update_secondary_args(data, priors)

Run the code above in your browser using DataLab