Re: [R] glmnet: converting coefficients back to original scale

2015-04-04 Thread Mark Seeto
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

Re: [R] glmnet: converting coefficients back to original scale

2015-04-03 Thread Suzen, Mehmet
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

[R] glmnet: converting coefficients back to original scale

2015-03-19 Thread Mark Seeto
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 -