Cookies on Macro by Mark.We use essential cookies for sign-in, locale, and security. With your permission, we also use optional cookies for preferences, for analytics, and for advertising measurement with the Meta (Facebook) Pixel. Read our cookie policy.
L2-penalized linear regression - shrinks coefficients toward zero to stabilize forecasts when predictors are many or collinear.
Graph workspace
The ridge trace - coefficient values plotted against (or equivalently, effective degrees of freedom) - is the canonical visualization. It shows how each coefficient shrinks toward zero as regularization increases, and reveals which predictors are stable (coefficients barely move) versus unstable (coefficients swing wildly at low ). No other plot captures the bias-variance tradeoff as directly.
OLS MSE
Mean squared error of the unpenalized OLS coefficients against the true ones, averaged over the p coefficients. Baseline against which ridge improvement is measured.
0.0605
squared standardized units
Ridge MSE at optimal lambda
Mean squared coefficient error of ridge at the oracle penalty: of zero (OLS itself) and the 12-point penalty grid , the penalty whose coefficients come closest to the true ones. Only a synthetic sample, where the true coefficients are known, can choose this way; with real data GCV or cross-validation picks it and does somewhat worse. Never above the OLS MSE, and equal to it when no penalty brings this sample's coefficients closer to the truth, as at the defaults; ridge's expected gain under collinearity is an average over samples, and on this one it shows from up.
0.0605
squared standardized units
Effective degrees of freedom
Number of effective parameters at the selected penalty, computed from the design's population eigenvalues (one root , the other at ). Equal to when the oracle penalty is zero (as at the defaults), and lower by however much complexity the penalty removes.
6.00
dimensionless
Shrinkage ratio
Share of the OLS coefficient length the penalty removes: 0 means no shrinkage, values near 1 mean the coefficients are pulled almost to zero. At 0.05, ridge kept 95 percent of the OLS length; it is exactly 0 when the oracle penalty is zero.
0.0000
proportion
Predictor correlation: 0.8
How closely the predictors move together; the closer they are, the shakier plain regression gets.
High makes the OLS (right) end of the trace erratic - coefficients overshoot, and the benefit of shrinkage becomes more dramatic. On this sample the oracle penalty is zero for every from 0.03 to 0.88, the default 0.8 included, and positive from 0.89 up; at 0.99 ridge cuts the coefficient error by more than four fifths.
How much random error clouds the data; more noise makes coefficients harder to pin down.
Increasing moves the oracle penalty toward the stronger penalties at the left of the path panel (more shrinkage pays): at the default correlation it stays at zero up to about and rises after.
How many predictor variables the regression uses; more of them add estimation uncertainty.
The panel draws the first five coefficient paths whatever p is. On this one fixed sample the oracle penalty does not move steadily with p, because each p draws a different design.
How many data points there are; with more, coefficients need less pulling toward zero.
Increasing n makes the OLS end more stable. Less shrinkage is needed on average, but on this one fixed sample the oracle penalty jumps around as n changes, because each n draws different noise.
How large the strongest true effect is; all the true effects scale with it.
Larger signals push the coefficient paths further from zero at all values, and the oracle penalty favors less shrinkage (at the default correlation it is zero from up).