Skip to content

ENH: Replacement for AR - #6087

Merged
bashtage merged 1 commit into
statsmodels:masterfrom
bashtage:immutable-ar
Dec 2, 2019
Merged

bashtage merged 1 commit into
statsmodels:masterfrom
bashtage:immutable-ar

Conversation

@bashtage

@bashtage bashtage commented Aug 8, 2019

Copy link
Copy Markdown
Member

A replacement for the error-prone AR class that only uses OLS
and refers users to SARIMAX for MLE.

  • closes #xxxx
  • tests added / passed.
  • code/documentation is well formatted.
  • properly formatted commit message. See
    NumPy's guide.
Details

Notes:

  • It is essential that you add a test when making code changes. Tests are not
    needed for doc changes.
  • When adding a new function, test values should usually be verified in another package (e.g., R/SAS/Stata).
  • When fixing a bug, you must add a test that would produce the bug in master and
    then show that it is fixed with the new code.
  • New code additions must be well formatted. Changes should pass flake8. If on Linux or OSX, you can
    verify you changes are well formatted by running
    git diff upstream/master -u -- "*.py" | flake8 --diff --isolated
    
    assuming flake8 is installed. This command is also available on Windows
    using the Windows System for Linux once flake8 is installed in the
    local Linux environment. While passing this test is not required, it is good practice and it help
    improve code quality in statsmodels.
  • Docstring additions must render correctly, including escapes and LaTeX.

@bashtage

bashtage commented Aug 8, 2019

Copy link
Copy Markdown
Member Author

@ChadFulton my part in revamping tsa to get rid of problematic things. I think there is still room for a pure AR that only uses OLS since it avoids initial values. This model is also an ARDL when using exog rather than an OLS with AR errors.

@codecov

codecov Bot commented Aug 8, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #6087 into master will increase coverage by 0.16%.
The diff coverage is 97.7%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6087      +/-   ##
==========================================
+ Coverage   84.78%   84.94%   +0.16%     
==========================================
  Files         640      640              
  Lines      100853   101972    +1119     
  Branches    11054    11193     +139     
==========================================
+ Hits        85506    86624    +1118     
+ Misses      12900    12886      -14     
- Partials     2447     2462      +15
Impacted Files Coverage Δ
statsmodels/tsa/tsatools.py 89.97% <ø> (ø) ⬆️
...dels/multivariate/factor_rotation/_gpa_rotation.py 87.27% <ø> (ø) ⬆️
statsmodels/sandbox/stats/diagnostic.py 65.37% <ø> (ø) ⬆️
statsmodels/tsa/statespace/mlemodel.py 88.53% <ø> (ø) ⬆️
statsmodels/tsa/api.py 100% <100%> (ø) ⬆️
statsmodels/tools/docstring.py 77.99% <100%> (+5.06%) ⬆️
statsmodels/tsa/arima_model.py 93.9% <100%> (-0.24%) ⬇️
statsmodels/tools/linalg.py 73.07% <100%> (ø) ⬆️
statsmodels/tsa/tests/test_arima.py 99.52% <100%> (ø) ⬆️
statsmodels/tsa/ar_model.py 96.95% <95.6%> (-2.23%) ⬇️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6469d32...9155a9d. Read the comment docs.

@coveralls

coveralls commented Aug 8, 2019 •

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.1%) to 87.355% when pulling 3057c6f on bashtage:immutable-ar into 3ef5c30 on statsmodels:master.

@bashtage
bashtage force-pushed the immutable-ar branch 3 times, most recently from 7126147 to 7112594 Compare August 8, 2019 22:25
@pep8speaks

pep8speaks commented Aug 8, 2019 •

Copy link
Copy Markdown

Hello @bashtage! 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-12-01 22:39:25 UTC

@bashtage
bashtage force-pushed the immutable-ar branch 3 times, most recently from 34b16e6 to ab93e95 Compare August 8, 2019 23:13
@ChadFulton

Copy link
Copy Markdown
Member

I think there is still room for a pure AR that only uses OLS since it avoids initial values. This model is also an ARDL when using exog rather than an OLS with AR errors.

Very nice! Definitely people will like the ARDL and seasonal-via-OLS option.

I'll take another look tomorrow or Saturday - with my other tsa-related stuff, one of the main goals was to get more consistency in tsa, and for me what was easiest was just subclassing everything from SARIMAX. I think that's not an option here because of how exog is entering as intercept while in SARIMAX it's the mean, but we can make sure that what we're all doing keeps the consistency anyway.

Are you planning to do a deprecation cycle and eventually make this the AR model?

@bashtage

bashtage commented Aug 9, 2019

Copy link
Copy Markdown
Member Author

Are you planning to do a deprecation cycle and eventually make this the AR model?

Yes, a loud, hard to silence warning (no flag, so users have to use warnings.simplefilter explicitly).

I will use the same pattern as your tsa2. If We rename, then I'll use AutoReg. If we use a new submod, then this will become tsa.NEWLOC.AR. The latter is starting to seem better. We can leave tsa.NEWLOC.AR for a very long time (possibly forever, even if we also have this function at tsa.AR eventually.

@bashtage
bashtage force-pushed the immutable-ar branch 15 times, most recently from 0a5796f to 230b207 Compare August 15, 2019 22:10
@bashtage
bashtage force-pushed the immutable-ar branch 3 times, most recently from a0688eb to 31a98d7 Compare August 18, 2019 14:07
@bashtage
bashtage force-pushed the immutable-ar branch 2 times, most recently from 8d80900 to cac10df Compare November 29, 2019 00:29
@lgtm-com

lgtm-com Bot commented Nov 29, 2019

Copy link
Copy Markdown

This pull request introduces 4 alerts when merging cac10df into 112458b - view on LGTM.com

new alerts:

  • 2 for Module-level cyclic import
  • 1 for Unused local variable
  • 1 for __init__ method calls overridden method

@bashtage
bashtage force-pushed the immutable-ar branch 2 times, most recently from aa2f72a to 9a35d1b Compare November 29, 2019 14:26
@lgtm-com

lgtm-com Bot commented Nov 29, 2019

Copy link
Copy Markdown

This pull request introduces 4 alerts when merging 9a35d1b into 112458b - view on LGTM.com

new alerts:

  • 2 for Module-level cyclic import
  • 1 for Unused local variable
  • 1 for __init__ method calls overridden method

@lgtm-com

lgtm-com Bot commented Nov 29, 2019

Copy link
Copy Markdown

This pull request introduces 4 alerts when merging 3adc77c into 112458b - view on LGTM.com

new alerts:

  • 2 for Module-level cyclic import
  • 1 for Unused local variable
  • 1 for __init__ method calls overridden method

@lgtm-com

lgtm-com Bot commented Nov 30, 2019

Copy link
Copy Markdown

This pull request introduces 3 alerts when merging 49329a2 into 3ef5c30 - view on LGTM.com

new alerts:

  • 2 for Module-level cyclic import
  • 1 for __init__ method calls overridden method

@lgtm-com

lgtm-com Bot commented Nov 30, 2019

Copy link
Copy Markdown

This pull request introduces 4 alerts and fixes 24 when merging 6e28048 into 3ef5c30 - view on LGTM.com

new alerts:

  • 2 for Module-level cyclic import
  • 1 for Unused import
  • 1 for __init__ method calls overridden method

fixed alerts:

  • 20 for Module is imported with 'import' and 'import from'
  • 4 for Module is imported more than once

@lgtm-com

lgtm-com Bot commented Nov 30, 2019

Copy link
Copy Markdown

This pull request introduces 3 alerts when merging bd5262f into 3ef5c30 - view on LGTM.com

new alerts:

  • 2 for Module-level cyclic import
  • 1 for __init__ method calls overridden method

@lgtm-com

lgtm-com Bot commented Dec 1, 2019

Copy link
Copy Markdown

This pull request introduces 3 alerts when merging da23413 into 3ef5c30 - view on LGTM.com

new alerts:

  • 2 for Module-level cyclic import
  • 1 for __init__ method calls overridden method

@lgtm-com

lgtm-com Bot commented Dec 1, 2019

Copy link
Copy Markdown

This pull request introduces 3 alerts when merging 3057c6f into 3ef5c30 - view on LGTM.com

new alerts:

  • 2 for Module-level cyclic import
  • 1 for __init__ method calls overridden method

A replacement for the error-prone AR class that only uses OLS
and refers users to SARIMAX for MLE.
@lgtm-com

lgtm-com Bot commented Dec 1, 2019

Copy link
Copy Markdown

This pull request introduces 3 alerts when merging 9155a9d into 6469d32 - view on LGTM.com

new alerts:

  • 2 for Module-level cyclic import
  • 1 for __init__ method calls overridden method

@bashtage bashtage changed the title WIP/ENH: Replacement for AR ENH: Replacement for AR Dec 2, 2019
@bashtage
bashtage merged commit 17f7c34 into statsmodels:master Dec 2, 2019
@bashtage
bashtage deleted the immutable-ar branch December 2, 2019 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants