cv.apple {apple} | R Documentation |
Does K-fold cross validation for apple.
cv.apple(X, y, family="binomial", penalty="LASSO", gamma, K = 10, alpha=0, seed = 1, cha.poi = 1, eps = 1e-15, lambda.min.ratio, max.iter = 100, max.num, n.lambda = 100)
X |
input matrix, of dimension nobs x nvars; each row is an observation vector. |
y |
response variable, of dimension nobs x 1. non-negative counts for
|
family |
response type. |
penalty |
|
gamma |
the MCP concavity parameter. |
K |
number of folds used in cross validation. The default it 10. |
alpha |
weight used in the cross validation cost function, with Q (λ) =α Dev(λ)+ (1-α) s(λ) \log n/n. |
seed |
random seed used to sample the training sets and test sets |
cha.poi |
the value used to change from Newton Raphson correction to Coordinate Descent correction, which is the α in the following inequality, k> α√{n}, where k is the size of current active set. when this inequality holds, the correction method changes from Newton Raphson to Coordinate Descent. |
eps |
the precision used to test the convergence. |
lambda.min.ratio |
optional input. smallest value for |
max.iter |
maximum number of iteration in the computation. |
max.num |
optional input. maximum number of nonzero coefficients. |
n.lambda |
the number of |
cv |
list of cross validation loss |
lambda |
list of lambda |
a0 |
the list of intercept |
beta |
the list of coefficients |
cv.loc |
location of cv selected solution in the path |
ebic.loc |
the location of the EBIC selected solution in the path |
cv.beta |
cross validation selected beta |
ebic.beta |
ebic selected beta |
cv.a0 |
cv selected intercept |
ebic.a0 |
ebic selected intercept |
Yi Yu and Yang Feng
Yi Yu and Yang Feng, APPLE: Approximate Path for Penalized Likelihood Estimator, manuscript.
plot.apple
, apple
and predict.apple
p=10 n=200 d=5 coefs=c(3,1.5,0,0,2) intercept=0 beta=rep(0,p) beta[1:d]=coefs X=matrix(rnorm(p*n), nrow=n) mu=1/(1+exp(-X %*% beta-intercept)) y=rbinom(n,1,mu) fit.cv=cv.apple(X, y, family="binomial", alpha=0.25, K=5) plot(fit.cv)