michael
2010-Dec-06 01:10 UTC
[R] How to get lasso fit coefficient(given penalty tuning parameter \lambda) using lars package
Hi, all, I am using the lars package for lasso estimate. So I get a lasso fit first: lassofit = lars(x,y,type ="lasso",normalize=T, intercept=T) Then I want to get coefficient with respect to a certain value of \lambda (the tuning parameter), I know lars has three mode options c("step", "fraction", "norm"), but can I use the \lambda value instead of the norm which is the L1 norm of coefficients? Thanks, Michael [[alternative HTML version deleted]]
michael
2010-Dec-06 01:13 UTC
[R] How to get lasso fit coefficient(given penalty tuning parameter \lambda) using lars package
Oh, I just realize that I can actually just use this: beta = coef(lassofit, s=5, mode="lambda") Michael On Sun, Dec 5, 2010 at 8:10 PM, michael <tufemichael@gmail.com> wrote:> Hi, all, > > I am using the lars package for lasso estimate. So I get a lasso > fit first: > > lassofit = lars(x,y,type ="lasso",normalize=T, intercept=T) > Then I want to get coefficient with respect to a certain value of \lambda > (the tuning parameter), I know lars has three mode options c("step", > "fraction", "norm"), but can I use the \lambda value instead of the norm > which is the L1 norm of coefficients? > > Thanks, > > Michael >[[alternative HTML version deleted]]
caolinii
2012-Jul-19 14:23 UTC
[R] How to get lasso fit coefficient(given penalty tuning parameter \lambda) using lars package
I have this problem as well.... Could you please kindly let me know what s is please. Is s equals to the value of lambda? Many thanks Lini -- View this message in context: r.789695.n4.nabble.com/How-to-get-lasso-fit-coefficient-given-penalty-tuning-parameter-lambda-using-lars-package-tp3073831p4637042.html Sent from the R help mailing list archive at Nabble.com.