[R] lasso/lars error

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Aug 2 17:48:14 CEST 2007


This looks like a question for the package maintainer (as the posting 
guide said), as was the one you referred to.  Please bear in mind

> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

Anyone who is going to be able to help will need such an example.

It seems that a reply like this needs to go on the archive for future 
reference.


On Thu, 2 Aug 2007, Jake Michaelson wrote:

> I'm having the exact problem outlined in a previous post from 2005 -
> unfortunately the post was never answered:
>
> http://tolstoy.newcastle.edu.au/R/help/05/10/15055.html
>
> When running:
>
> lm2=lars(x2,y,type="lasso",use.Gram=F)
>
> I get an error:
>
> Error in if (zmin < gamhat) { : missing value where TRUE/FALSE needed
>
> ...when running lasso via lars() on a 67x3795 set of predictors.  I hacked
> the lars() function to print out the zmin, gamhat, and also z1 values (used
> to calculate zmin) - it seems that the error comes up during the lasso
> process when all the z1's are negative - unfortunately I have no idea what
> this means. This leads to both zmin and gamhat being NA.  The error can be
> worked around by forcing max.steps to some low value, but this isn't an
> ideal solution.
>
> I hope this post won't suffer the same fate as the previous one on the same
> topic.  If I can provide any more useful information please let me know.
>
> Thanks,
>
> Jake
>
>> sessionInfo()
> R version 2.5.0 (2007-04-23)
> i686-pc-linux-gnu
>
> locale:
> LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C
>
> attached base packages:
> [1] "stats"     "graphics"  "grDevices" "utils"     "datasets"  "methods"
> [7] "base"
>
> other attached packages:
>        lars randomForest      corpcor  cairoDevice
>     "0.9-7"     "4.5-18"      "1.4.5"        "2.3"
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list