Thanks for your reply Mehmet. I've found that the problem was that I
didn't scale the lambda value. My original example did not follow the
instruction not to give a single lambda value, but that in itself
wasn't the problem. Example shown below.
library(glmnet)
library(MASS)
set.seed(1)
n <- 20
This is interesting, can you post your lm.ridge solution as well? I
suspect in glmnet, you need to use model.matrix with intercept, that
could be the reason.
-m
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/m
Dear R-help,
I'm having trouble understanding how glmnet converts its coefficient
estimates back to the original scale. Here's an example with ridge
regression:
library(glmnet)
set.seed(1)
n <- 20 # sample size
d <- data.
3 matches
Mail list logo