Learn R Programming

BigTSP (version 1.0)

cv.LDCA: Cross validation for LDCA

Description

Cross validation for LDCA

Usage

cv.LDCA(X, y, lambda = NULL, nfolds)

Arguments

X
input matrix, of dimension nobs x nvars; each row is an observation vector.
y
response variable.
lambda
user specified lambda sequence
nfolds
number of folds - default is 10.

Value

an object of class "cv.LDCA" is returned, which is a list with the ingredients of the cross-validation fit.
lambda
the values of lambda used in the fits.
cvm
The mean cross-validated error - a vector of length length(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.
name
a text string indicating type of measure (for plotting purposes).
glmnet.fit
a fitted glmnet object for the full data.
lambda.min
value of lambda that gives minimum cvm.
lambda.1se
largest value of lambda such that error is within 1 standard error of the minimum.

References

Friedman, J., Hastie, T. and Tibshirani, R. (2008) Regularization Paths for Generalized Linear Models via Coordinate Descent, http://www.stanford.edu/~hastie/Papers/glmnet.pdf Journal of Statistical Software, Vol. 33(1), 1-22 Feb 2010 http://www.jstatsoft.org/v33/i01/ Simon, N., Friedman, J., Hastie, T., Tibshirani, R. (2011) Regularization Paths for Cox's Proportional Hazards Model via Coordinate Descent, Journal of Statistical Software, Vol. 39(5) 1-13 http://www.jstatsoft.org/v39/i05/

See Also

print.cv.LDCA,predict.cv.LDCA,

Examples

Run this code
library(glmnet)
x=matrix(rnorm(50*20),50,20)
y=rbinom(50,1,0.5)
cvfit=cv.LDCA(x,y,nfolds=5)
predict(cvfit,x[1:10,],s="lambda.min")

Run the code above in your browser using DataLab