cv.morals {Gifi} | R 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 |
folds |
Number of folds for cross-validation (for LOOCV set it equal to n). |
verbose |
If |
... |
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
[Package Gifi version 0.4-0 Index]