cv.apple: cross validation for apple path

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/cv.R

Description

Does K-fold cross validation for apple.

Usage

1
2
3
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)

Arguments

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="poisson", binary for family="binomial".

family

response type.

penalty

LASSO and MCP are provided.

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 lambda, as a fraction of max.lam, the (data derived) entry value. the default depends on the sample size n relative to the number of variables p. if n > p, the default is 0.0001. otherwise, the default is 0.01.

max.iter

maximum number of iteration in the computation.

max.num

optional input. maximum number of nonzero coefficients.

n.lambda

the number of lambda values.

Value

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

Author(s)

Yi Yu and Yang Feng

References

Yi Yu and Yang Feng, APPLE: Approximate Path for Penalized Likelihood Estimator, manuscript.

See Also

plot.apple, apple and predict.apple

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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)

apple documentation built on May 2, 2019, 3:23 a.m.

Related to cv.apple in apple...