Skip to contents

These functions are used to specify prior distributions for the model parameters.

Usage

normal(location = 0, scale)

half_normal(scale)

log_normal(location, scale)

cauchy(location = 0, scale)

half_cauchy(scale)

student_t(location = 0, scale, df)

half_student_t(scale, df)

log_student_t(location, scale, df)

exponential(scale = 1/rate, rate = 1/scale)

flat()

Arguments

location

Prior location. Typically prior mean (see details).

scale

Prior scale. Typically prior standard deviation (see details).

df

Prior degrees of freedom.

rate

Prior rate.

Value

Object of class nma_prior.

Details

The location and scale parameters are typically the prior mean and standard deviation, with the following exceptions:

  • For the Cauchy distribution location is the prior median and scale is the prior scale.

  • For the log-Normal distribution, location and scale are the prior mean and standard deviation of the logarithm.

Compatibility with model parameters

The following table summarises which prior distributions may be used with which model parameters. Essentially, priors that take only non-negative values (e.g. half-Normal) may only be used for non-negative parameters (heterogeneity SD/variance/precision, and any auxiliary parameter). If a real-valued prior distribution is specified for a non-negative parameter, it will be truncated at 0 to be non-negative.

Intercept prior_interceptTreatment effects prior_trtHeterogeneity prior_hetRegression coefficients prior_regAuxiliary parameter prior_aux
Normal normal()YesYesYesYesYes
half-Normal half_normal()--Yes-Yes
log-Normal log_normal()--Yes-Yes
Cauchy cauchy()YesYesYesYesYes
half-Cauchy half_cauchy()--Yes-Yes
Student t student_t()YesYesYesYesYes
half-Student t half_student_t()--Yes-Yes
log-Student t log_student_t()--Yes-Yes
Exponential exponential()--Yes-Yes
Flat flat()YesYesYesYesYes

The flat() prior is a special case where no prior information is added to the model, resulting in an implicit flat uniform prior distribution over the entire support for a parameter. This will be an improper prior if the parameter is unbounded, and is not generally advised. See the Stan user's guide for more details.

See also

summary.nma_prior() for summarising details of prior distributions. plot_prior_posterior() for plots comparing the prior and posterior distributions of model parameters.