B = ridge(y, X, k)
B = ridge(y, X, k, scaled)
ridge returns coefficient estimates for ridge regression models of response vector y on predictor matrix X.
Predictors are centered and scaled before fitting. If scaled is 0, coefficients are restored to the original predictor scale and an intercept row is included.
y = [1; 2.1; 2.9; 4.2; 5.1; 5.9];
X = [(1:6)' [2; 1; 4; 3; 7; 6]];
B = ridge(y, X, [0 0.5 2])
| Version | Description |
|---|---|
| 2.0.0 | initial version |