View source: R/lm_multiv_ridge.R
| lm_multiv_ridge | R Documentation |
Estimate regression coefficients by using ridge regression.
lm_multiv_ridge(Y, X, lambda = 0, do_scale = FALSE)
Y |
An N x K matrix of dependent variables. |
X |
An N x M matrix of regressors. |
lambda |
Numeric vector of lambda values |
do_scale |
If true, X is centered and scaled, and Y is centered. |
Consider the multivariate regression:
\mathbf{Y} = \mathbf{X \Psi} + \mathbf{e}.
\mathbf{\Psi} is a M-by-K matrix of regression coefficients.
The ridge regression estimate for the coefficients is
\mathbf{\Psi} = (\mathbf{X'X} + \lambda \mathbf{I})^{-1}
\mathbf{X'Y}.
A list object with the components: 1) Psi - A list of
estimated \mathbf{\Psi} matrices, 2) lambda - A vector of
\lambda values, 3) GCV - A vector of GCV values
G. H. Golub, M. Heath, G. Wahba (1979). Generalized cross-validation as a method for choosing a good ridge parameter. Technometrics 21(2), 215-223. doi: 10.2307/1268518
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.