sample_lm_ridge {countSTAR} | R Documentation |
Sample linear regression parameters assuming a ridge prior
Description
Sample the parameters for a linear regression model assuming a
ridge prior for the (non-intercept) coefficients. The number of predictors
p
may exceed the number of observations n
.
Usage
sample_lm_ridge(y, X, params, A = 10^4, XtX = NULL, X_test = NULL)
Arguments
y |
|
X |
|
params |
the named list of parameters containing
|
A |
the prior scale for |
XtX |
the |
X_test |
matrix of predictors at test points (default is NULL) |
Value
The updated named list params
with draws from the full conditional distributions
of sigma
and coefficients
(along with updated mu
and mu_test
if applicable).
Note
The parameters in coefficients
are:
-
beta
: thep x 1
vector of regression coefficients -
sigma_beta
: the prior standard deviation for the (non-intercept) components ofbeta