Displaying 1 result from an estimated 1 matches for "vr4ex".
Did you mean:
rex
2010 Apr 26
0
lm.ridge {MASS} intercept questions
...{
Xm <- colMeans(X[, -Inter])
Ym <- mean(Y)
p <- p - 1
X <- X[, -Inter] - rep(Xm, rep(n, p))
Y <- Y - Ym
} else Ym <- Xm <- NA
Xscale <- drop(rep(1/n, n) %*% X^2)^0.5
X <- X/rep(Xscale, rep.int(n, p))
(the full code is on page 24 here:
http://www.stats.ox.ac.uk/pub/MASS4/VR4ex.pdf )
If there is an intercept term, lm.ridge removes it and centers the
remaining X columns by subtracting each column's mean from all the
values. Then it divides the centered X's by Xscale, which is the
standard deviation (of the population). This all makes sense to me.
What I don't...