Description Usage Arguments Details Value References Examples
Calculates Generalized Cross-Validation (GCV) for "lm" and "glm" objects.
1 | GCV(model)
|
model |
a "lm" or "glm" object |
GCV (Koc and Bozdogan, 2015) is calculated as
RSS/(n(1 - k/n))
RSS is the residual sum of squares.
GCV measurement of the model
Koc, E. K., & Bozdogan, H. (2015). Model selection in multivariate adaptive regression splines (MARS) using information complexity as the fitness function. Machine Learning, 101(1), 35-58.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | x1 <- rnorm(100, 3, 2)
x2 <- rnorm(100, 5, 3)
x3 <- rnorm(100, 67, 5)
err <- rnorm(100, 0, 4)
## round so we can use it for Poisson regression
y <- round(3 + 2*x1 - 5*x2 + 8*x3 + err)
m1 <- lm(y~x1 + x2 + x3)
m2 <- glm(y~x1 + x2 + x3, family = "gaussian")
m3 <- glm(y~x1 + x2 + x3, family = "poisson")
GCV(m1)
GCV(m2)
GCV(m3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.