1.2.8 Standardization and the intercept
By default each predictor is scaled to unit variance before fitting and the coefficients are reported on the original scale, which is also the R package’s default. The penalty acts on the standardized coefficients, so predictors measured in different units are penalized evenly. Pass #:standardize? #f to penalize the raw coefficients instead; a penalized fit then changes:
> (coef (ridge X y #:lambda 0.1)) '#(1.2920771248987886 1.443502076515797 -0.5633072982644314)
> (coef (ridge X y #:lambda 0.1 #:standardize? #f)) '#(1.2034029065292362 1.6263449581758462 -0.7070118065802423)
Every family except Cox fits an unpenalized intercept. Pass #:intercept? #f to force it to zero:
> (coef (ols X y #:intercept? #f)) '#(0.0 2.0803147261867574 -0.8175493048307874)