These functions specify prior distributions for the modelling functions epirt and epiobs (and, for some, in epiinf). They construct lightweight lists that are interpreted internally by epim. The functions and their arguments mirror the prior helpers in rstanarm, and are provided directly by epidemia so that rstanarm is not required.

normal(location = 0, scale = NULL, autoscale = FALSE)

student_t(df = 1, location = 0, scale = NULL, autoscale = FALSE)

cauchy(location = 0, scale = NULL, autoscale = FALSE)

exponential(rate = 1, autoscale = FALSE)

laplace(location = 0, scale = NULL, autoscale = FALSE)

lasso(df = 1, location = 0, scale = NULL, autoscale = FALSE)

hs(df = 1, global_df = 1, global_scale = 0.01, slab_df = 4, slab_scale = 2.5)

hs_plus(
  df1 = 1,
  df2 = 1,
  global_df = 1,
  global_scale = 0.01,
  slab_df = 4,
  slab_scale = 2.5
)

product_normal(df = 2, location = 0, scale = 1)

lkj(regularization = 1, scale = 10, df = 1, autoscale = TRUE)

decov(regularization = 1, concentration = 1, shape = 1, scale = 1)

Arguments

location

Prior location. For normal and student_t (and so cauchy) this is the prior mean. Defaults to 0.

scale

Prior scale. A positive number (or NULL to use a sensible internal default, in which case the scale may be rescaled if autoscale = TRUE).

autoscale

If TRUE, the scale is adjusted automatically according to the scale of the predictors. See the priors vignette and prior_summary.

df, df1, df2

Prior degrees of freedom. For student_t a single positive number; for product_normal an integer \(\ge 1\) giving the number of normal factors; for hs_plus, df1 and df2 are the degrees of freedom for the local shrinkage parameters.

rate

Prior rate for the exponential distribution (a positive number). The scale is the reciprocal of the rate.

global_df, global_scale, slab_df, slab_scale

Hyperparameters for the regularised horseshoe priors hs and hs_plus. See Piironen and Vehtari (2017).

regularization

Exponent for an LKJ prior on the correlation matrix.

concentration

Concentration parameter for a symmetric Dirichlet distribution over the relative variances of the group-specific terms (decov).

shape

Shape parameter for the Gamma prior on the standard deviation of group-specific terms (decov).

Value

A named list to be used internally by epim.

Details

The functions return a named list that epidemia parses into the Stan program's prior representation. Which distributions are permitted depends on the role of the parameter:

  • Regression coefficients (prior in epirt and epiobs): normal, student_t, cauchy, hs, hs_plus, laplace, lasso, product_normal, and the epidemia-specific shifted_gamma.

  • Intercepts (prior_intercept): normal, student_t, cauchy.

  • Auxiliary parameters (prior_aux): normal, student_t, cauchy, exponential.

  • Covariance of group-specific terms (prior_covariance): decov, lkj.

References

Piironen, J., and Vehtari, A. (2017). Sparsity information and regularization in the horseshoe and other shrinkage priors. Electronic Journal of Statistics. 11(2), 5018-5051.