statsmodels
statsmodels copied to clipboard
ENH: Segmented knots rebased
rebased version of #2677
removed last commit which was compat fixes for numpy < 1.9 (in percentile)
status not clear see old comments https://github.com/statsmodels/statsmodels/pull/2677#issuecomment-226978367 predict and results info incomplete or missing
old notebook https://github.com/josef-pkt/misc/blob/segmented/notebooks/ex_segmented_regression_sm.ipynb
segmented is in base
get_objective
needs llf as alternative to ssr
then we could try a poisson or similar example
Hello @josef-pkt! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:
- In the file
statsmodels/base/_segmented.py
:
Line 177:9: E306 expected 1 blank line before a nested definition, found 0
does this use (effective) degrees of freedom corresponding to the number of segments?
This pull request introduces 1 alert when merging a0b57b41417c8eb93c0724375e11fad344a4f0ce into 152e27dcc667a423f798810a1b0fee2f6340f73d - view on LGTM.com
new alerts:
- 1 for Variable defined multiple times
unit tests pass, pep-8 style failures
not clear from a quick look at this PR:
usage for other models than OLS? The module is base/_segmented.py and seems to be designed for generically for models. However, I don't see a non-OLS example here. For OLS only, it would fit better in regression.special_model(s)