Repository navigation
BUG: Preserve seasonal and sparse lags in ARIMA GLS whitening - #10713
Merged
bashtage merged 1 commit intoNov 10, 2026
Merged
Conversation
Member
|
Thanks. |
4 of 5 tasks
bashtage
added a commit
that referenced
this pull request
Nov 10, 2026
Follow up #10713, which made gls use the reduced (product) AR and MA lag polynomials when whitening. Its tests each had a single factor, so replacing the product by the sum of the non-seasonal and seasonal polynomials (losing the cross terms) was not detected, and nothing had differencing. Add test_gls_whitening_polynomial_products: models with a non-seasonal and a seasonal factor, a sparse non-seasonal lag with a seasonal AR, D=1 and d=1 models, for innovations_mle and statespace, and sparse lags with the hannan_rissanen estimator. The reference does not use the innovations algorithm: it differences endog and exog itself, multiplies the lag polynomials built from the estimated parameters with np.convolve, takes the autocovariances from arma_acovf and solves the GLS normal equations with np.linalg.solve (agreement to 1e-8). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
bashtage
added a commit
that referenced
this pull request
Nov 10, 2026
Follow up #10713. Add the missing PR reference to the release note, drop the blank line after the bullet and say which calls are affected: statsmodels.tsa.arima.estimators.gls.gls and ARIMA.fit for a model with exog or a trend when the method is not "statespace" or gls=True. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
bashtage
added a commit
that referenced
this pull request
Nov 10, 2026
TST: Follow up #10713 (lag polynomial products in the ARIMA GLS whitening)
This was referenced Nov 15, 2026
bashtage
added a commit
that referenced
this pull request
Nov 16, 2026
Move the bullet of #10742 to the end of the "Time series analysis" bug fix list, add its :pr: role, and say what users see: loglike now equals loglikeobs().sum(), llf and the fixed_scale value, also for conserve_memory settings; values and fitted parameters change when the diffuse periods contain finite innovations (several observed series with one diffuse state, a diffuse state observed only later), and single series models without such innovations (local level, local linear trend, SARIMAX with concentrate_scale) are unchanged. The bullet stays under Bug Fixes, as the neighbouring merged #10713 bullet. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ARIMA GLS estimator passed compact, nonseasonal coefficient arrays to the innovations whitening step. Seasonal AR/MA terms were omitted, and nonconsecutive lags were interpreted as consecutive. This can produce incorrect regression coefficient estimates even when the ARMA error parameters are estimated correctly.
Use the reduced AR and MA lag polynomials for whitening so missing lags are represented by zeros and seasonal factors are included. The compact parameter arrays remain unchanged for result storage and optimizer warm starts.
For example, in the sparse MA regression case in the new tests, the old slope is approximately 0.92744 while the independent matrix GLS calculation gives approximately 0.76720. The corrected result agrees with the matrix calculation.
Validation:
innovations_mleandstatespaceestimators.pytest statsmodels/tsa/arima -q --cov=statsmodels.tsa.arima.estimators.gls: 208 passed, 3 xfailed; the changed whitening code is covered.ruff check .andgit diff --checkpassed.A release note is included.
AI Disclosure
Contributions must comply with the statsmodels AI Policy.
Tick exactly one of the following. If AI tools were used, replace the
<...>placeholders in the second option with the tool name(s) and how the tool's output was
used.
Tool(s): OpenAI Codex.
Used for: investigating the GLS lag handling, drafting the fix and regression tests, running validation, and preparing the PR.
I have personally read, understood, and can explain every line of this diff, and
have verified the statistical/numerical correctness of the change.