Learn R Programming

R2BayesX (version 1.1-5)

GCV: Gerneralized Cross Validation Criterion

Description

Generic function returning the generalized cross validation criterium of a fitted model object.

Usage

GCV(object, ...)

# S3 method for bayesx GCV(object, ...)

Arguments

object

an object of class "bayesx".

...

specify for which model the criterion should be returned, e.g. type model = 1 to obtain the value for the first model. Only meaningful if object contains of more than one model.

Author

Nikolaus Umlauf, Thomas Kneib, Stefan Lang, Achim Zeileis.

See Also

bayesx.

Examples

Run this code
if (FALSE) {
## generate some data
set.seed(121)
n <- 200

## regressors
dat <- data.frame(x = runif(n, -3, 3))

## generate response 
dat$y <- with(dat, 1.5 + sin(x) + rnorm(n, sd = 0.6))

## estimate model
b <- bayesx(y ~ sx(x), data = dat, method = "REML")

## extract GCV
GCV(b)
}

Run the code above in your browser using DataLab