From A.Robinson at ms.unimelb.edu.au  Thu Feb 14 01:40:11 2008
From: A.Robinson at ms.unimelb.edu.au (A.Robinson at ms.unimelb.edu.au)
Date: Thu, 14 Feb 2008 01:40:11 +0100 (CET)
Subject: [Rd] GCV in lm.ridge (MASS) (PR#10755)
Message-ID: <20080214004011.D08AD2834613@mail.pubhealth.ku.dk>

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



[Rd] GCV in lm.ridge (MASS) (PR#10755)
A.Robinson at ms.unimelb.edu.au