CDLasso-package: Coordinate descent algorithms for L1 and L2 regression

Description Details Author(s) References See Also Examples

Description

Greedy coordinate descent for L1 regression and cyclic coordinate descent for L2 regression with p predictors and n cases

Details

Package: CDLasso
Title: Coordinate Descent for L1 and L2 Regression
Version: 1.1
Date: 2013-13-03
Author: Edward Grant, Kenneth Lange, Tong Tong Wu
Maintainer: Edward Grant <edward.m.grant@gmail.com>
Description: Coordinate Descent for L1, L2, and Logistic Regression
License: GPL-2

Author(s)

Edward Grant, Kenneth Lange, Tong Tong Wu

Maintainer: Edward Grant edward.m.grant@gmail.com

References

Wu, T.T. and Lange, K. (2008). Coordinate Descent Algorithms for Lasso Penalized Regression. Annals of Applied Statistics, Volume 2, No 1, 224-244.

See Also

l1.reg

l2.reg

logit.reg

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
set.seed(1001)
n=500
p=2000
nz = c(1:5)
true.beta<-rep(0,p)
true.beta[nz] = c(1,1,1,1,1)

x=matrix(rnorm(n*p),p,n)
y = t(x) %*% true.beta

logity=exp(y)/(1+exp(y))
ylog=rbinom(n=length(logity),prob=logity,size=1)

rownames(x)<-1:nrow(x)
colnames(x)<-1:ncol(x)

#L1
outL1<-l1.reg(x,y,lambda=50)
outL1est<-l1.reg(x[outL1$selected,],y,lambda=0)

#L2
outL2<-l2.reg(x,y,2)
outL2est<-l2.reg(x[outL2$selected,],y,lambda=0)

#Logistic
outLOGIT<-logit.reg(x,ylog,lambda=50)
outLOGITest<-logit.reg(x[outLOGIT$selected,],ylog,lambda=0)

CDLasso documentation built on May 1, 2019, 8:02 p.m.