Observation weights; defaults to 1 per observation
type.measure
loss to use for cross-validation. Currently two
options:
squared-error (type.measure="mse") or
mean-absolute error ( type.measure="mae" )
...
Other arguments that can be passed to sparsenet.
nfolds
number of folds - default is 10. Although nfolds
can be as large as the sample size (leave-one-out CV), it is not
recommended for large datasets. Smallest value allowable is nfolds=3
foldid
an optional vector of values between 1 and nfold
identifying whhat fold each observation is in. If supplied,
nfold can be missing.
trace.it
If TRUE, then we get a printout that shows the
progress
Details
The function runs sparsenetnfolds+1 times; the
first to get the lambda sequence, and then the remainder to
compute the fit with each of the folds omitted. The error is
accumulated, and the average error and standard deviation over the
folds is computed.
Value
an object of class "cv.sparsenet" is returned, which is a
list with the ingredients of the cross-validation fit.
lambda
the values of lambda used in the fits. This is an
nlambda x ngamma matrix
cvm
The mean cross-validated error - a matrix shaped like lambda
cvsd
estimate of standard error of cvm.
cvup
upper curve = cvm+cvsd.
cvlo
lower curve = cvm-cvsd.
nzero
number of non-zero coefficients at each lambda,
gamma pair.
name
a text string indicating type of measure (for plotting
purposes).
sparsenet.fit
a fitted sparsenet object for the full data.
call
The call that produced this object
parms.min
values of gamma, lambda that gives minimum
cvm.
which.min
indices for the above
lambda.1se
gamma, lambda of smallest model (df) such that error is
within 1 standard error of the minimum.