Re: [R] cv.lars() function in LARS package

From: Niels Richard Hansen <Niels.R.Hansen+lists_at_math.ku.dk>
Date: Thu, 07 Apr 2011 21:05:24 -0700

Minxolee

Cross validation is based on random splits of the data, hence it can not be expected that the results are exactly identical.

If you want to do lasso, the glmnet package by the same authors is a better choice.

On 07/04/11 16.08, minxolee wrote:
>
> I am trying to get familiar with the lars package and find out by repeating
> the cv.lars() function, I am not getting the same result consistently. Could
> someone help on that? Here is a simple reproducible example.
>
>> library(lars)
>> data(diabetes)
>> attach(diabetes)
>> cv.lars(x,y,K=2)
>> cv.lars(x,y,K=2)
>
> The last two runs of cv.lars give out different cross-validation plots.
>
> Thanks,
> minxolee
>
> --
> View this message in context: http://r.789695.n4.nabble.com/cv-lars-function-in-LARS-package-tp3434822p3434822.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Niels Richard Hansen                     Web:   www.math.ku.dk/~richard	
Associate Professor                      Email: Niels.R.Hansen_at_math.ku.dk
Department of Mathematical Sciences             nielsrichardhansen_at_gmail.com
University of Copenhagen                 Skype: nielsrichardhansen.dk	
Universitetsparken 5                     Phone: +1 510 502 8161	
2100 Copenhagen Ø
Denmark

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 08 Apr 2011 - 04:15:10 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 08 Apr 2011 - 04:20:30 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive