Skip to contents

[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)

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.

Value

A list as produced by create_stan_data().

Examples

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)
#> Replacing specified priors with those passed through the `prior` dataframe.
#> $obs_scale_mean
#> [1] 3
#> 
#> $obs_scale_sd
#> [1] 1
#>