Hi here is the code as example
lars is in package lars
x<-matrix(rnorm(20*5,0,1),20,5)
bs<-matrix(sample(seq(1:10),5),5,1)
er<-rnorm(20,0,1)
y<-x%*%bs+er
lobj<-lars(x,y,type="lasso")
names(lobj)
[1] "call" "type" "df" "lambda" "R2"
[6] "RSS" "Cp" "actions" "entry" "Gamrat"
[11] "arc.length" "Gram" "beta" "mu" "normx"
[16] "meanx"
I do not know what does RSS, arc.length, mu mean???
If mu means \hat{miu}, it does not seems to be right. I did not simulate my
data with mean.
besides I caculated R2 by myself but it cannot match the R2here
I think R2=1-sum((y-x%*%lobj$beta)^2)/var(y)*19 #I have 20 observations...my
R2 is lower than the one here
Thanks a lot