lambda
## S3 method for class 'formula':
cv.glmreg(formula, data, weights, offset=NULL, ...)
## S3 method for class 'matrix':
cv.glmreg(x, y, weights, offset=NULL, ...)
## S3 method for class 'default':
cv.glmreg(x, ...)
## S3 method for class 'cv.glmreg':
plot(x,se=TRUE,ylab=NULL, main=NULL, width=0.02, col="darkgrey", ...)
## S3 method for class 'cv.glmreg':
coef(object,which=object$lambda.which, ...)
model.frame
.x
matrix as in glmreg
. It could be object of cv.glmreg
.y
as in glmreg
.cv.glmreg
lambda
at which
estimates are extracted. By default, the one which generates the optimal cross-validation value.TRUE
, standard error curve is also plottedglmreg
."cv.glmreg"
is returned, which is a
list with the ingredients of the cross-validation fit.lambda
and column values for k
th cross-validationlambda
and column values for k
th cross-validationlength(lambda)
.cv
.nfold
identifying what fold each observation is in.lambda
values with length of lambda
lambda
that gives maximum cv
value.lambda
that gives maximum cv
value.glmreg
nfolds
+1 times; the
first to compute the lambda
sequence, and then to
compute the fit with each of the folds omitted. The error or the log-likelihood value is
accumulated, and the average value and standard deviation over the
folds is computed. Note that cv.glmreg
can be used to search for
values for alpha
: it is required to call cv.glmreg
with a fixed vector foldid
for different values of alpha
.glmreg
and plot
, predict
, and coef
methods for "cv.glmreg"
object.data("bioChemists", package = "pscl")
fm_pois <- cv.glmreg(art ~ ., data = bioChemists, family = "poisson")
plot(fm_pois)
title("Poisson Family",line=2.5)
Run the code above in your browser using DataLab