Description Usage Arguments Details Author(s) See Also
View source: R/functions_ridge.R
Computes a vector of regression coefficients for a provided ridge penalty.
1 |
lambda |
ridge penalty factor |
X |
design matrix for the regression. |
y |
outcome vector. Unless |
penalize |
vector giving penalty structure. Values must be in [0, 1]. See Details for more information. |
XtX |
(optional) cross product of the design matrix. If running simulations or
other procedure for identical |
The input penalize is a vector of ridge penalty factors,
such that the penalty for covariate j is lambda*penalize[j].
Although its primary purpose is for indicating which variables to penalize (1)
and which to not penalize (0), fractional values between 0 and 1 are accepted.
Defaults to c(0, rep(1, p-1)), where
p is number of columns in X (this penalizes all coefficients but
the first).
The design matrix X is assumed to contain only numeric values, so
any factors should be coded according to desired contrast (e.g., via model.matrix)
Joshua Keller
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.