pzivich / Delicatessen

Delicatessen: the Python one-stop sandwich (variance) shop 🥪
https://deli.readthedocs.io/en/latest/index.html
MIT License
22 stars 2 forks source link

[BUG] ee_lasso_regression() missing return #41

Closed yuyangstat closed 6 months ago

yuyangstat commented 7 months ago

Describe the bug The ee_lasso_regression() in delicatessen.estimating_equations.regression is missing return at the end.

pzivich commented 7 months ago

Yes it is! Thanks, I will fix in the v2.1 release

pzivich commented 7 months ago

I will point out a nuance with LASSO and the sandwich here. As stated in the documentation,

As the derivative of the estimating equation for LASSO is not defined at zero, the bread (and sandwich) cannot be used to estimate the variance in all settings

So, I didn't have a check in pytest on ee_lasso_regression (hence why the bug).

In general, I would recommend ridge regression currently, as convergence is a bit unstable since the derivative doesn't exist at 0 and the sandwich is invalid since the corresponding estimating equation is non-differentiable. I do plan on adding a twice-differentiable LASSO in the future, which should be valid with the sandwich variance estimator (that I still need to verify) #36

yuyangstat commented 7 months ago

Nice, good to know! Thanks!