cv.morals: Cross-validation for Morals fit

View source: R/cv.morals.R

cv.moralsR Documentation

Cross-validation for Morals fit

Description

Performs a k-fold CV on Morals objects and returns the CV error.

Usage

cv(object, folds = 10, verbose = FALSE, ...)

Arguments

object

Object of class "morals"

folds

Number of folds for cross-validation (for LOOCV set it equal to n).

verbose

If TRUE, iteration is printed out

...

Additional arguments (ignored here)

Examples

## mimic linear regression
xknots <- knotsGifi(neumann[,1:2], "E")  
yknots <- knotsGifi(neumann[,3], "E")
fitlin <-  morals(neumann[,1:2], neumann[,3], xknots = xknots, yknots = yknots, 
                  xdegrees = 1, ydegrees = 1, xordinal = FALSE, yordinal = FALSE)
cv(fitlin)  ## CV error of prediction

Gifi documentation built on Oct. 4, 2022, 1:06 a.m.

Related to cv.morals in Gifi...