cv.morals | R Documentation |
Performs a k-fold CV on Morals objects and returns the CV error.
cv(object, folds = 10, verbose = FALSE, ...)
object |
Object of class |
folds |
Number of folds for cross-validation (for LOOCV set it equal to n). |
verbose |
If |
... |
Additional arguments (ignored here) |
## 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.