Skip to content

ENH: Improve SARIMAX start_params if too few nobs - #6102

Merged
ChadFulton merged 1 commit into
statsmodels:masterfrom
ChadFulton:ss-start-params
Aug 15, 2019
Merged

ChadFulton merged 1 commit into
statsmodels:masterfrom
ChadFulton:ss-start-params

Conversation

@ChadFulton

Copy link
Copy Markdown
Member
  • tests added / passed.
  • code/documentation is well formatted.
  • properly formatted commit message.

Fixes the uninformative ValueError ("maxlag should be < nobs") reported in e.g. #4465. Technically, the ValueError is being raised during computation of start_params, which is not really the place to raise an error about the number of observations. We should probably separately do something more in the SARIMAX constructor if given too few observations to estimate the model.

This PR changes the start_params behavior to issue a warning if there are not enough observations to compute starting parameters via CSS, and then sets the starting parameters for ar/ma/trend to zeros if they can't be computed.

@coveralls

coveralls commented Aug 15, 2019 •

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.007%) to 86.528% when pulling c176bc3 on ChadFulton:ss-start-params into e6632b6 on statsmodels:master.

@codecov

codecov Bot commented Aug 15, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #6102 into master will decrease coverage by <.01%.
The diff coverage is 85.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6102      +/-   ##
==========================================
- Coverage   84.05%   84.05%   -0.01%     
==========================================
  Files         613      613              
  Lines       97582    97604      +22     
  Branches    10657    10659       +2     
==========================================
+ Hits        82022    82040      +18     
- Misses      13138    13140       +2     
- Partials     2422     2424       +2
Impacted Files Coverage Δ
statsmodels/tsa/statespace/tests/test_sarimax.py 100% <100%> (ø) ⬆️
statsmodels/tsa/statespace/sarimax.py 93.19% <79.31%> (-0.45%) ⬇️

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 e6632b6...c176bc3. Read the comment docs.

@ChadFulton
ChadFulton merged commit a9c2a9c into statsmodels:master Aug 15, 2019
@ChadFulton
ChadFulton deleted the ss-start-params branch August 15, 2019 19:46
@bashtage bashtage added this to the 0.11 milestone Dec 18, 2019
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.

3 participants