Learn R Programming

apple (version 0.3)

apple: Approximate Path for Penalized Likelihood Estimator

Description

Fit a generalized linear model via penalized maximum likelihood. The regularization path is computed for the LASSO or MCP penalty at a grid of values for the regularization parameter lambda. Can deal all shapes of data, including very large sparse data matrices. Fits binomial-logistic and poisson regression models.

Usage

apple(X, y, family="binomial", penalty = "LASSO", gamma, cha.poi = 1, eps = 1e-15, lam.list, 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.
cha.poi
the value used to change from Newton Raphson correction to Coordinate Descent correction, which is the $\alpha$ in the following inequality, $k> \alpha\sqrt{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.
lam.list
a user supplied $\lambda$ sequence. typical usage is to have the program compute its own lambda sequence based on lambda.min.ratio and n.lambda. supplying a value of $\lambda$ overrides this.
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

a0
intercept vector of length(lambda).
beta
nvar x length(lambda) matrix of coefficients.
lambda
the list of lambda derived the solution path.
ebic
the list of EBIC values.
ebic.loc
the location of the EBIC selected solution in the path.
family
the family of the supplied dataset.

References

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

See Also

plot.apple, cv.apple and predict.apple

Examples

Run this code

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.apple=apple(X, y, family= "binomial")


plot(fit.apple)

Run the code above in your browser using DataLab