set.seed(0)
a <- runif(100)
b <- runif(100)
c <- runif(100)
d <- b + runif(100)/10
e <- a + runif(100)/10
library(glmnet)
test <- cv.glmnet(cbind(a,b,c), cbind(d,e), family = "mgaussian",
relax = TRUE, gamma = 0.5)
In this example, printing test directly gives something like:
test
#Measure: Mean-Squared Error
#
# Gamma Index Lambda Index Measure SE Nonzero
#min 0.5 1 0.001617 56 0.001872 0.0001121 4
#1se 0.5 1 0.015082 32 0.001967 0.0001393 3
It appears that lambda.min should be 0.001617. However, I get a different number when I extract this value:
test$lambda.min
#[1] 0.0007682971
Anyone know why there is a difference? I'm using glmnet 4.1-4. My R version is:
> R.version
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 4
minor 1.2
year 2021
month 11
day 01
svn rev 81115
language R
version.string R version 4.1.2 (2021-11-01)
nickname Bird Hippie