sd_prior: Specify priors for the estimated parameters.

View source: R/priors.R

sd_priorR Documentation

Specify priors for the estimated parameters.

Description

sd_prior returns a list characterising the features of the prior.

Usage

sd_prior(par_name, dist, dist_pars, type = "constant", min = NULL, max = NULL)

Arguments

par_name

A string indicating the name of the estimated parameter.

dist

A string indicating the name of the prior distribution. This name should be consistent with Stan language. For instance, "normal" indicates the normal distribution in Stan language.

dist_pars

A numeric vector. For instance, if dist = "normal", then dist_pars will be a vector of size 2 corresponding to the location (mean) and scale (standard deviation).

type

A string. It can be either 'constant' or 'init'. It is 'constant' by default. 'init' refers to parameters that have only affect the model at time 0.

min

An optional numeric or a string value indicating the estimated parameter's lower bound. This value overrides the inferred bound from the prior distribution. For instance, specifying a beta distribution for the estimated parameter inherently sets the lower bound to 0. Providing a value to min will override this default with the supplied value. If the supplied value is a string, it should be the name of another estimated parameter.

max

An optional numeric value or a string indicating the estimated parameter's upper bound. This value overrides the inferred bound from the prior distribution. For instance, specifying a beta distribution for the estimated parameter inherently sets the upper bound to 1. Providing a value to max will override this default with the supplied value. If the supplied value is a string, it should be the name of another estimated parameter.

Value

A list

Examples

sd_prior("par_beta", "lognormal", c(0, 1))
sd_prior("par_rho", "normal", c(0, 1), min = 0)

jandraor/readsdr documentation built on May 26, 2024, 5:51 p.m.