Fits ridge regression for every penalty value in lambdas via a
single thin SVD of X, returning coefficients for all penalties
at once.
Arguments
- X
Numeric matrix or
adgeMatrixof predictors, shape[n, p].- Y
Numeric matrix, vector, or
adgeMatrixof responses, shape[n, q].- lambdas
Positive numeric vector of ridge penalty values. Must satisfy
all(lambdas > 0).- k
Integer or
NULL. Number of singular values to retain in the truncated SVD. WhenNULL, defaults tomin(nrow(X), ncol(X)).- ...
Additional arguments forwarded to
svd_factor.
Value
An object of class "ridge_path", a named list
containing:
- coef
Numeric array of shape
[p, q, length(lambdas)]; coefficient matrix for each penalty.- lambdas
The input penalty vector.
- svd
The
amSVDfactor object used internally.- k
Integer number of singular values actually used.