Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

lasso

Set up a lasso prior in brms


Description

Function used to set up a lasso prior for population-level effects in brms. The function does not evaluate its arguments – it exists purely to help set up the model.

Usage

lasso(df = 1, scale = 1)

Arguments

df

Degrees of freedom of the chi-square prior of the inverse tuning parameter. Defaults to 1.

scale

Scale of the lasso prior. Defaults to 1.

Details

The lasso prior is the Bayesian equivalent to the LASSO method for performing variable selection (Park & Casella, 2008). With this prior, independent Laplace (i.e. double exponential) priors are placed on the population-level effects. The scale of the Laplace priors depends on a tuning parameter that controls the amount of shrinkage. In brms, the inverse of the tuning parameter is used so that smaller values imply more shrinkage. The inverse tuning parameter has a chi-square distribution and with degrees of freedom controlled via argument df of function lasso (defaults to 1). For instance, one can specify a lasso prior using set_prior("lasso(1)"). To make sure that shrinkage can equally affect all coefficients, predictors should be one the same scale. If you do not want to standardized all variables, you can adjust the general scale of the lasso prior via argument scale, for instance, lasso(1, scale = 10).

Value

A character string obtained by match.call() with additional arguments.

References

Park, T., & Casella, G. (2008). The Bayesian Lasso. Journal of the American Statistical Association, 103(482), 681-686.

See Also

Examples

set_prior(lasso(df = 1, scale = 10))

brms

Bayesian Regression Models using 'Stan'

v2.15.0
GPL-2
Authors
Paul-Christian Bürkner [aut, cre], Jonah Gabry [ctb], Sebastian Weber [ctb], Andrew Johnson [ctb], Martin Modrak [ctb]
Initial release
2021-03-10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.