Dear all,

If I am not mistaken, I think that I have found a bug in glmnet 1.7.1 (latest 
version) for multinomial when alpha=0. Here is the code
> library(glmnet)
Loading required package: Matrix
Loading required package: lattice
Loaded glmnet 1.7.1

> x=matrix(rnorm(40*500),40,500)
> g4=sample(1:7,40,replace=TRUE)
> fit=glmnet(x,g4,family="multinomial",alpha=0)
> fit$lambda
[1] NA  0

In my opinion lambda values for alpha=0 (ridge) should be different from that. 
Below is an example of lambdas for alpha=0.03. Thanks DK

> fit=glmnet(x,g4,family="multinomial",alpha=0.03)
> fit$lambda
  [1] 6.87012630 6.55786846 6.25980322 5.97528550 5.70369955 5.44445761
  [7] 5.19699861 4.96078700 4.73531157 4.52008435 4.31463954 4.11853252
 [13] 3.93133886 3.75265344 3.58208955 3.41927805 3.26386659 3.11551881
 [19] 2.97391367 2.83874471 2.70971938 2.58655845 2.46899538 2.35677573
 [25] 2.24965663 2.14740627 2.04980334 1.95663661 1.86770446 1.78281441
 [31] 1.70178274 1.62443409 1.55060105 1.48012384 1.41284993 1.34863372
 [37] 1.28733624 1.22882482 1.17297283 1.11965941 1.06876916 1.02019195
 [43] 0.97382265 0.92956091 0.88731093 0.84698128 0.80848468 0.77173780
 [49] 0.73666112 0.70317874 0.67121818 0.64071028 0.61158901 0.58379134
 [55] 0.55725713 0.53192893 0.50775194 0.48467383 0.46264466 0.44161674
 [61] 0.42154458 0.40238473 0.38409572 0.36663798 0.34997372 0.33406687
 [67] 0.31888302 0.30438929 0.29055433 0.27734818 0.26474228 0.25270934
 [73] 0.24122331 0.23025934 0.21979369 0.20980373 0.20026783 0.19116535
 [79] 0.18247659 0.17418274 0.16626587 0.15870883 0.15149527 0.14460957
 [85] 0.13803685 0.13176286 0.12577403 0.12005741 0.11460061 0.10939184
 [91] 0.10441981 0.09967377 0.09514344 0.09081903 0.08669116 0.08275091
 [97] 0.07898976 0.07539955 0.07197253 0.06870126

                                          
        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to