casact / chainladder-python

Actuarial reserving in Python
https://chainladder-python.readthedocs.io/en/latest/
Mozilla Public License 2.0
192 stars 71 forks source link

Formulaic and statsmodels dependencies #369

Open jbogaardt opened 2 years ago

jbogaardt commented 2 years ago

chainladder currently relies on patsy for Wilkinson formulas (R-style formulas). This gets used in BarnettZehnwirth and TweedieGLM. However, patsy is no longer maintained and is instead replaced by formulaic. This has expanded features including pickling of estimators that use these formulas.

TweedieGLM could be greatly simplified (and relied on in the BootstrapODPSample if we had a few additional statistics associated with the model fit. sklearn.linear_model.TweedieRegressor only produces coefficients. statsmodels has a full GLM suite that would elminate the need for us to calculate our own statistics such as the pearson residuals or hat matrix.

All statsmodels dependencies are chainladder dependencies so this does not cause an alarming increase in dependency footprint.

jbogaardt commented 2 years ago

This enhancement might also make #291 viable.

lorentzenchr commented 11 months ago

Might be worth to consider https://github.com/Quantco/glum.