cv.cocktail {fastcox} | R Documentation |
Cross-validation for cocktail
Description
Does k-fold cross-validation for cocktail, produces a plot,
and returns a value for lambda
. This function is modified based on the cv
function from the glmnet
package.
Usage
cv.cocktail(x,y,d,lambda=NULL,nfolds=5,foldid,...)
Arguments
x |
matrix of predictors, of dimension |
y |
a survival time for Cox models. Currently tied failure times are not supported. |
d |
censor status with 1 if died and 0 if right censored. |
lambda |
optional user-supplied lambda sequence; default is
|
nfolds |
number of folds - default is 5. Although |
foldid |
an optional vector of values between 1 and |
... |
other arguments that can be passed to cocktail. |
Details
The function runs cocktail
nfolds
+1 times; the
first to get the lambda
sequence, and then the remainder to
compute the fit with each of the folds omitted. The average error and standard deviation over the
folds are computed.
Value
an object of class cv.cocktail
is returned, which is a
list with the ingredients of the cross-validation fit.
lambda |
the values of |
cvm |
the mean cross-validated error - a vector of length
|
cvsd |
estimate of standard error of |
cvup |
upper curve = |
cvlo |
lower curve = |
nzero |
number of non-zero coefficients at each |
name |
a text string indicating partial likelihood (for plotting purposes). |
cocktail.fit |
a fitted |
lambda.min |
The optimal value of |
lambda.1se |
The largest value of |
Author(s)
Yi Yang and Hui Zou
Maintainer: Yi Yang <yi.yang6@mcgill.ca>
References
Yang, Y. and Zou, H. (2013),
"A Cocktail Algorithm for Solving The Elastic Net Penalized Cox's Regression in High Dimensions", Statistics and Its Interface, 6:2, 167-173.
https://github.com/emeryyi/fastcox
Friedman, J., Hastie, T., and Tibshirani, R. (2010), "Regularization paths for generalized
linear models via coordinate descent," Journal of Statistical Software, 33, 1.
http://www.jstatsoft.org/v33/i01/
See Also
Examples
data(FHT)
cv1<-cv.cocktail(x=FHT$x[,1:10],y=FHT$y,d=FHT$status,alpha=0.5,nfolds=3)
cv1
plot(cv1)