Repository navigation
ENH: Add new version of ARIMA-type estimators (AR, ARIMA, SARIMAX) - #5827
Conversation
|
Hello @ChadFulton! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2019-09-11 22:40:15 UTC |
|
A couple of additional implementation details that might be useful:
|
|
Thanks for expanding on that. Should I think of this PR as a Proof Of Concept, or something you would like to merge in this form? After the release, are you hoping to get this done soonish (i.e. does this block other goals?) or can the review be more leisurely? |
Basically, I think that the setup here is good, and potentially mergeable after I clean up everything and add more tests. Maybe it should be merged soon after the next release so that other people besides me can start using it. My main goal, actually, is that we can start some real documentation on how to use But I think that as we write "good" documentation for this entry point to ARIMA-type models, we'll probably figure out that I didn't do some things quite right in this PR (like I set up some things in a way that turns out to be counter-intuitive, or hard to explain), and we'll need to change the implementation. I think that's okay for a new set of models that haven't been in a release yet, but it's something to keep in mind. And of course the more of those things that we can figure out in this PR already, the better. |
563b96f to
598a9cb
Compare
Codecov Report
@@ Coverage Diff @@
## master #5827 +/- ##
==========================================
+ Coverage 84.1% 84.39% +0.29%
==========================================
Files 611 638 +27
Lines 97065 99279 +2214
Branches 10549 10815 +266
==========================================
+ Hits 81636 83786 +2150
- Misses 13052 13104 +52
- Partials 2377 2389 +12
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #5827 +/- ##
==========================================
+ Coverage 84.1% 84.36% +0.25%
==========================================
Files 613 640 +27
Lines 97768 99981 +2213
Branches 10661 10928 +267
==========================================
+ Hits 82232 84346 +2114
- Misses 13121 13201 +80
- Partials 2415 2434 +19
Continue to review full report at Codecov.
|
1856c1a to
2e9072f
Compare
fae01ae to
240923b
Compare
|
Unless there are any concerns, I will merge this once I get Windows to stop complaining about precision issues in tests (so hopefully tonight). |
|
I'll take another look this evening, if you're OK with "tonight" being Pacific Time |
That would be much appreciated, thanks! (I know it's a huge PR so whatever you have time for would be a great check). |
|
Ran out of gas before getting through all of it. A few comments about the pytest.mark.todo marker possibly being redundant, otherwise looks really good, particularly the documentation on where the test results are coming from. Big picture I'd be more comfortable putting these in place if there was an agreed-upon gameplan for getting rid of the old versions (and potential overlap with #6087). But you've been pretty patient about this so I can't in good conscience ask you to wait any more on my account. |
Thanks
But I think there is a game plan for getting rid of older versions - once we are comfortable that this code works, we will follow this deprecation strategy: In any case, presumably the deprecation will look like:
The only thing that's unclear to me is whether we can set x=11, since if we want to release in October that may not be enough time to make sure the new classes are robust. However, that is what I hope for.
:) this is going in tonight. |
|
Merging when green. |
|
Thanks @jbrockmendel and @bashtage! |
Update: TODOs:
ARIMAmodel class / currentARIMAdeprecation strategy.This is very much a WIP, and basically none of the design / organizational things have been thought through (e.g. where to put it, what to call things, etc.). But is concrete enough already that hopefully there may be some useful discussion at this point about the general goals of such a project.
A couple of preliminaries:
My starting point for this project was:
We should have a wider range of estimator options for ARIMA-type models (e.g. Hannan-Rissanen, etc.), and these should be, as much as possible, stand-alone functions and be standardized.
We should have a single model class that is the point of entry for all ARIMA-type models.
It is not worth it to salvage the old AR / ARIMA models.
So this PR adds
tsa2.sarimax.estimators, which has the following estimators for ARIMA-type models:yule_walkerfor AR(p) models (wrapper aroundlinear_model.yule_walker)burgfor AR(p) models (wrapper aroundlinear_model.burg)durbin_levinsonfor fast computation of Yule-Walker across consecutive AR(p) orders (not sure why I didn't wraptsatools.levinson_durbin- maybe it'll come to me if I look back at it later).innovationsfor MA(q) models (wrapper aroundstattools.innovations_algo)hannan_rissanenfor ARMA models with a sum-of-squares approach (implementation based on Brockwell and Davis)innovations_mlefor SARIMA models with numerical likelihood maximization (implementation based on Brockwell and Davis, ultimately wraps thearma_innovationscode)statespacefor SARIMAX model (wrapper aroundstatespace.SARIMAX)glsfor regression with ARIMA-type errors, where the ARIMA parameters for the error process can be estimated using any of the above (implementation based on Brockwell and Davis, uses innovation algorithm for fast transformation of endog / exog to induce homoskedasticity).Input is standardized using the
SARIMAXSpecificationclass, which handles a lot of things that ARIMA-type models need to worry about (handling different ways of specifying model orders, like non-consecutive lags, handling trends, getting parameter names, describing which of the above estimators are valid for a given set of model orders, etc.).Output is standardized using the
SARIMAParamsclass, which handles a lot of things that ARIMA-type parameters need to worry about (getting and settings parameters based on the usual econometric form vs lag polynomial form, checking for stationarity and invertibilty, etc.).Finally, there is a new model class
ARIMA, which is meant to (eventually) be a single point of entry for all ARIMA-type models (including SARIMAX models). It is a subclass ofstatespace.SARIMAXbut allows fitting using any of the estimators above. It returns results that (will be) a subclass ofstatespace.SARIMAXResults, so that all postestimation can be done through the state space framework.Anyway, I hope that this can be a step forward on
tsa.