FUNCTION REFERENCE

ridge

Ridge coefficients for centered, sample-standardized predictors.

Ridge coefficients for centered, sample-standardized predictors.

Syntax

B = ridge(y,X,k,scaled)

Each nonnegative k produces one column. scaled=1 (default) returns standardized coefficients without an intercept. scaled=0 restores original units and places the intercept in the first row. Do not include a constant predictor. NaN rows are removed.

Example

b = ridge([1;3;5],[0;1;2],[0 1],0);   % first column [1;2]

Differences from MATLAB: Two-dimensional real numeric data only; constant predictors are rejected. Solves augmented least-squares systems by SVD.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.