10

I know the glmnet() function cannot exclude the intercept by users, but does anyone know how to derive the fit without intercept from the glmnet()?

chl
  • 53,725
  • 2
    It's not obvious to me that this would be possible. The model could be completely different without an intercept, and I'm not sure why there should be an easy path from one model to the other. Can you explain why you think this is feasible? Perhaps you could use another method instead? For instance, bayesglm in the arm package can fit regularized glms without intercepts (although they aren't sparse). Might be worth looking into other options as well, rather than forcing glmnet to do something it doesn't want to. – David J. Harris Aug 03 '12 at 19:01
  • You can also try the penalized package, see http://stats.stackexchange.com/a/4554/930. – chl Aug 04 '12 at 10:48
  • I wonder how to overcome this difficulty since glmnet() takes less computation time than other function (e.g. lars(), penalized(), lassoshooting()) for solving the LASSO problem and the linear model I consider has to be through the origin. – Direstraits Aug 05 '12 at 09:09

1 Answers1

20

For compleness' sake (and because I accidentally bumped in to this question): starting with version 1.9-3, fitting without intercepts is supported (intercept=FALSE).

chl
  • 53,725
Nick Sabbe
  • 12,819
  • 2
  • 37
  • 47