Learn R Programming

SIS (version 0.4)

scadglm: SCAD regularized loglikelihood for generalized linear models

Description

These functions solve SCAD regularized loglikelihood for generalized linear models; scadcox does the one-step SCAD while fullscadcox solves the SCAD in a fully iterative method.

Usage

scadglm(x, y, wt.initsoln=NULL, lambda, initsoln=NULL, 
family = binomial(), weight = NULL, offset = NULL, 
function.precision=1e-10, nopenalty.subset=NULL)
       
fullscadglm(x, y, lambda, initsoln=NULL, family = binomial(),
   weight = NULL, offset = NULL, function.precision=1e-10,
   nopenalty.subset=NULL, eps0=1e-5, maxloop=10)

Arguments

x
an (n * p) matrix of features.
y
an (n) vector of response.
wt.initsoln
a (p+1) vector of initial solution for one-step SCAD.
lambda
regularization parameter for the SCAD.
initsoln
a (p+1) vector of initial solution.
family
a description of the error distribution and link function to be used in the model.
weight
an optional (n) vector of weights to be used in the fitting process.
offset
this can be used to specify an a priori known component to be included in the linear predictor during fitting.
function.precision
function.precision parameter used in the internal solver. Default is 1e-10.
nopenalty.subset
a set of indices for the predictors that are not subject to the L1 penalty.
eps0
an effective zero.
maxloop
the maximum number of loops for the SCAD iteration.

Value

  • They return a (p+1) vector of estimated coefficients.

References

Jianqing Fan and Runze Li (2001) Variable selection via nonconcave penalized likelihood and its oracle properties. Journal of American Statistical Association, 96, 1348-1360. Hui Zou and Runze Li (2008) One-step Sparse Estimates in Nonconcave Penalized Likelihood Models (with discussion). The Annals of Statistics, 36, 1509-1533

See Also

wtlassoglm

Examples

Run this code
set.seed(0)
b <- c(1,1,1,-3*sqrt(2)/2)
n=400
p=30
truerho=0.5
x=matrix(rnorm(n*p, mean=0, sd=1), n, p)
feta=x[, 1:4]%*%b
fprob=exp(feta)/(1+exp(feta))
y=rbinom(n, 1, fprob)
scadglm(x,y,lambda=0.0015)
coef(glm(y~x,family=binomial()))

Run the code above in your browser using DataLab