print.l1.reg: Print results of Greedy Coordinate Descent for L1 Regression

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

Description

Print short summary of results of Greedy Coordinate Descent for L1 Regression. Includes number of cases and predictors, lambda used, estimate of coeffcients produced, the number of selected predictors, and the names of selected predictors.

Usage

1
2
## S3 method for class 'l1.reg'
print(x, ...)

Arguments

x

Output of l1.reg. Must be of class "l1.reg"

...

N/A

Details

print.l1.reg produces selected output from l1.reg. For more output, see summary.l1.reg.

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

summary.l1.reg

l1.reg

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
set.seed(100)
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

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

#Lasso penalized L1 regression
out<-l1.reg(x,y,lambda=50)

#Re-estimate parameters without penalization
out2<-l1.reg(x[out$selected,],y,lambda=0)
print(out2)

Example output

 Call: 
l1.reg.default(x[out$selected, ], y, lambda = 0)
# of cases= 500 
# of predictors= 5 

 Lambda used: 0 


 Intercept: 
[1] 0

 Selected Coefficient Estimates: 
     Predictor Estimate           
[1,] "1"       "1.00000000489118" 
[2,] "2"       "1.00000000020971" 
[3,] "3"       "0.999999996731973"
[4,] "4"       "0.99999999756147" 
[5,] "5"       "0.999999999034168"

 Number of Active Variables: 
[1] 5

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