Repository navigation
ENH: 2-D tsa.seasonal_decompose with trend extrapolation - #3031
Conversation
|
Because I cannot block a gravatar, I blocked the user from the statsmodels organization |
|
Thanks for the change in gravatar. I'm currently busy with other things but try to look at it soon. |
| def _interpolate_trend(trend, npoints): | ||
| """ | ||
| Replace nan values on trend's end-opoints with least-squares interpolated | ||
| values wiith regression considering npoints closest defined points. |
There was a problem hiding this comment.
two typos end-opoints and wiith
|
Thanks, looks interesting and useful. I will have to look more closely at the details. (and this makes me think that we could use other methods for trend estimation in this case, |
|
Sorry for having it take so long. This has been updated to work with 2d data. I used and slightly amended your commit from #2820 (comment). |
|
@kernc The test failure is not related to this PR. |
|
Now that 0.8.0 is released, would you care to have another look at this? It includes your 2D patch from #2820. |
Codecov Report
@@ Coverage Diff @@
## master #3031 +/- ##
==========================================
+ Coverage 79.31% 80.28% +0.96%
==========================================
Files 544 544
Lines 81651 86828 +5177
Branches 9248 10795 +1547
==========================================
+ Hits 64760 69707 +4947
- Misses 14799 14949 +150
- Partials 2092 2172 +80
Continue to review full report at Codecov.
|
|
The trend extrapolation affects the estimate of the seasonal component because the detrended series is now not truncated anymore. One question is whether there should be an automatic bandwidth choice (number of observations) in the extrapolation trend regression, e.g. analogous to the default |
|
just realized 'interpolation' is a misnomer in this case, should be 'extrapolation' |
|
allowing |
|
a nice example trend extrapolation also looks good with nobs=10 and nobs=15 |
|
my suggestion: change name of keyword and allow |
|
All mentions of interpolation replaced with extrapolation. I knew that. 😊 A sensible inferred default sounds very reasonable. Added |
|
Yes, That looks good, and is ready for merge Can you rebase? Not strictly necessary but makes a nicer history. |
|
Already did. The branch splits from f11930d. |
|
merged @kernc Thanks for the improvements and I'm sorry for the long delay. |
fixes #2820
closes #3684
Includes patch from #3684, with tests.