cv.glm1path(object, block = NULL, best="min", plot=TRUE, prop.test=0.2, n.split = 10,
seed=NULL, show.progress=FALSE, ...)
glm1path
fit.NULL
) will randomly split rows into test and training "1se"
uses the one standard error rule, "min"
(or any other value) will return the model with best predictive performance. WARNING: David needs to check se calculatios...glm1path
.glm1
.lambdas
.k
.glm1path
. The main difference is that the best fitting model is selected by cross-validation, using n.test
different random training/test splits to estimate predictive performance on new (test) data. Mean predictive log-likelihood (per test observation) is used as the criterion for choosing the best model, which has connections with the Kullback-Leibler distance. The best
argument controls whether to select the model that maximises predictive log-likelihood, or the smallest model within 1se of the maximum (the '1 standard error rule').
All other details of this function are as for glm1path
.glm1path
, \code{glm1}, glm
, family
data(spider)
Alopacce <- spider$abund[,1]
X <- cbind(1,spider$x)
# fit a LASSO-penalised negative binomial regression:
ft = glm1path(Alopacce,X,lam.min=0.1)
coef(ft)
# now estimate the best-fitting model by cross-validation:
cvft = cv.glm1path(ft)
coef(cvft)
Run the code above in your browser using DataLab