Learn R Programming

RAMP (version 1.0)

RAMP: Regularization Algorithm under Marginality Principle (RAMP) for high dimensional generalized quadratic regression.

Description

RAMP

Usage

RAMP(X, y, family = "gaussian", penalty = "LASSO", gamma, inter = TRUE,
 eps = 1e-15, tune = "EBIC", lam.list, lambda.min.ratio, max.iter = 100, 
 max.num, n.lambda = 100, ebic.gamma = 1, refit = TRUE, trace = FALSE)

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. Default is "gaussian".
penalty
Currently, only LASSO is implemented.
gamma
concavity parameter. Experimental feature.
inter
whether to select interaction effects. Default is TRUE.
eps
the precision used to test the convergence. Default is 1e-15.
tune
tuning parameter selection method. "AIC", "BIC" and "EBIC" are available options. Default is EBIC.
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 >
max.iter
maximum number of iteration in the computation. Default is 100.
max.num
optional input. maximum number of nonzero coefficients.
n.lambda
the number of lambda values. Default is 100.
ebic.gamma
the gamma parameter value in the EBIC criteria. Default is 1.
refit
whether to perform a MLE refit on the selected model. Default is TRUE.
trace
whether to trace the fitting process. Default is FALSE.

Value

  • a0intercept vector of length(lambda).
  • betanvar x length(lambda) matrix of coefficients.

See Also

predict.RAMP

Examples

Run this code
set.seed(0)
n = 500
p = 100 #Can be changed to a much larger number say 100000
x = matrix(rnorm(n*p),n,p)
eta = 1 * x[,1] + 2 * x[,3]  + 3*x[,6]  + 4*x[,1]*x[,3] + 5*x[,1]*x[,6]
y =  eta + rnorm(n)

fit1 = RAMP(x, y)
fit1    ###examine the results


y = rbinom(n, 1, 1/(1+exp(-eta)))
fit2 = RAMP(x, y, family='binomial')  ###for binary response

Run the code above in your browser using DataLab