plot.cv.l1.reg: Cross validation plot

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

Description

Plot cross validation results across lambdas for greedy coordinate descent for L1 regression

Usage

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

Arguments

x

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

...

N/A

Details

plot.cv.l1.reg plots the prediction error of k fold cross validation across lambda values.

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

cv.l1.reg

l1.reg

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
set.seed(100)
n=50 
p=200
nzfixed = c(1:5)
true.beta<-rep(0,p)
true.beta[nzfixed] = 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)

crossval<-cv.l1.reg(x,y,10,(0:20)*2)
plot(crossval)
out<-l1.reg(x,y,lambda=crossval$lam.opt)
out

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