pbreheny / grpreg

Regularization paths for regression models with grouped covariates
http://pbreheny.github.io/grpreg/
34 stars 14 forks source link

Numerical instability #28

Closed bryorsnef closed 4 years ago

bryorsnef commented 4 years ago

Hi there,

I'm having an issue with numerical instability with the package. I'm trying to fit a group lasso on some cases where p approaches n. Groups are over basis functions for some splines set up with ns(intercept=T) from the splines package. I'm running into what seems like some numerical issues - I seem to be getting coefficients, most often the intercept, that are implausibly large or small, i.e. many many orders of magnitude different from the rest of the coefficients. The issue isn't deterministic, but doesn't seem to happen when I run models with larger n. Changing the eps arguments in grpreg doesn't seem to stabilize things. Any ideas how to fix, besides running the model and checking for any bizarrely huge/small coefficients?

pbreheny commented 4 years ago

Can you provide a reproducible example (i.e., a dataset where this happens and the code you're using)?

bryorsnef commented 4 years ago

Looks like the issue was how I set up the splines. Specifying a spline with too low df and an intercept leads to the instability. Sorry for your time.

pbreheny commented 4 years ago

No problem -- glad you were able to figure it out!