cv.glmpath {glmpath} | R Documentation |
Computes cross-validated (minus) log-likelihoods or prediction errors for glmpath
Description
This function computes cross-validated (minus) log-likelihoods or
prediction errors for glmpath.
Usage
cv.glmpath(x, y, data, family = binomial, weight = rep(1, n),
offset = rep(0, n), nfold = 10,
fraction = seq(0, 1, length = 100),
type = c("loglik", "response"), mode = c("norm", "lambda"),
plot.it = TRUE, se = TRUE, ...)
Arguments
x |
matrix of features |
y |
response |
data |
a list consisting of |
family |
name of a family function that represents the distribution of y to
be used in the model. It must be |
weight |
an optional vector of weights for observations |
offset |
an optional vector of offset. If a column of |
nfold |
number of folds to be used in cross-validation. Default is
|
fraction |
the fraction of L1 norm or log( |
type |
If |
mode |
If |
plot.it |
If |
se |
If |
... |
other options for glmpath |
Author(s)
Mee Young Park and Trevor Hastie
References
Mee Young Park and Trevor Hastie (2007) L1 regularization path algorithm for generalized linear models. J. R. Statist. Soc. B, 69, 659-677.
See Also
glmpath, plot.glmpath, predict.glmpath
Examples
data(heart.data)
attach(heart.data)
cv.a <- cv.glmpath(x, y, family=binomial)
cv.b <- cv.glmpath(x, y, family=binomial, type="response")
detach(heart.data)