A.Robinson at ms.unimelb.edu.au
2008-Feb-14 00:40 UTC
[Rd] GCV in lm.ridge (MASS) (PR#10755)
Full_Name: Andrew Robinson Version: 2.6.2 Patched (2008-02-12 r44439) OS: FreeBSD 6.3-RC1 Submission from: (NULL) (211.28.206.186) I believe that the computation for GCV is incorrect in the lm.ridge function in MASS.>From lm.ridge:GCV <- colSums((Y - X %*% coef)^2)/ (n - colSums(matrix(d^2/div, dx)))^2 The denominator does not tally with the formula on p. 141 of Ripley's Pattern Recognition & Neural Networks. I think that it should be GCV <- colSums((Y - X %*% coef)^2)/ (1 - colSums(matrix(d^2/div, dx))/n)^2 / n Also, neither formula (above) counts the intercept amongst the parameters This makes sense from the point of view that the intercept is not shrunk in ridge regression, but if it has been conditioned on for computing the residual sum of squares, then there is an argument that it should be included in the trace of the mapping matrix anyway. Thanks Andrew> sessionInfo()R version 2.6.2 Patched (2008-02-12 r44439) i386-unknown-freebsd6.3 locale: C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] MASS_7.2-40 loaded via a namespace (and not attached): [1] rcompgen_0.1-17