Usage
cvLm(object, cost = rmspe, K = 5, R = 1, foldType =
c("random", "consecutive", "interleaved"), folds =
NULL, seed = NULL, ...) cvLmrob(object, cost = rtmspe, K = 5, R = 1, foldType =
c("random", "consecutive", "interleaved"), folds =
NULL, seed = NULL, ...)
cvLts(object, cost = rtmspe, K = 5, R = 1, foldType =
c("random", "consecutive", "interleaved"), folds =
NULL, fit = c("reweighted", "raw", "both"), seed =
NULL, ...)
Arguments
object
for cvLm
, an object of class
"lm"
computed with lm
. For
cvLmrob
, an object of class "lmrob"
computed with
cost
a cost function measuring prediction loss.
It should expect the observed values of the response to
be passed as the first argument and the predicted values
as the second argument, and must return a non-negative
scalar value. The default is to use
K
an integer giving the number of groups into
which the data should be split (the default is five).
Keep in mind that this should be chosen such that all
groups are of approximately equal size. Setting K
equal to n
yields
R
an integer giving the number of replications for
repeated $K$-fold cross-validation. This is ignored
for for leave-one-out cross-validation and other
non-random splits of the data.
foldType
a character string specifying the type of
folds to be generated. Possible values are
"random"
(the default), "consecutive"
or
"interleaved"
.
folds
an object of class "cvFolds"
giving
the folds of the data for cross-validation (as returned
by cvFolds
). If supplied, this is
preferred over K
and R
. fit
a character string specifying for which fit to
estimate the prediction error. Possible values are
"reweighted"
(the default) for the prediction
error of the reweighted fit, "raw"
for the
prediction error of the raw fit,
seed
optional initial seed for the random number
generator (see .Random.seed
). ...
additional arguments to be passed to the
prediction loss function cost
.