feat!: graduate StateSpaceTimeSeries, deprecate BayesianBasisExpansionTimeSeries - #1113
Draft
anevolbap wants to merge 3 commits into
Draft
feat!: graduate StateSpaceTimeSeries, deprecate BayesianBasisExpansionTimeSeries#1113anevolbap wants to merge 3 commits into
anevolbap wants to merge 3 commits into
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
This was referenced Jul 31, 2026
anevolbap
force-pushed
the
issue-758-ssts-graduate
branch
from
July 31, 2026 02:07
061fa2e to
1e8d8ce
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## issue-758-ssts-variable-selection #1113 +/- ##
==================================================================
Coverage 97.19% 97.20%
==================================================================
Files 120 120
Lines 21100 21143 +43
Branches 1140 1142 +2
==================================================================
+ Hits 20508 20551 +43
Misses 396 396
Partials 196 196 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
anevolbap
force-pushed
the
issue-758-ssts-graduate
branch
2 times, most recently
from
July 31, 2026 03:49
7b0298e to
f82cde5
Compare
anevolbap
force-pushed
the
issue-758-ssts-graduate
branch
2 times, most recently
from
July 31, 2026 17:28
29a1d0c to
d1c2cec
Compare
anevolbap
force-pushed
the
issue-758-ssts-graduate
branch
from
August 3, 2026 20:19
d1c2cec to
27c2dce
Compare
anevolbap
force-pushed
the
issue-758-ssts-graduate
branch
from
August 4, 2026 02:36
27c2dce to
29c2147
Compare
Reject seasonal_length below 2 (previously an obscure ZeroDivisionError inside pymc-extras) and warn when out-of-sample dates do not continue the training frequency (forecast values map onto X's dates by position). Lock missing-value support with a test: the Kalman filter handles NaN in y natively and predictions stay finite, which covers the P2 item of #758 for this model.
…nTimeSeries Remove the experimental FutureWarning from StateSpaceTimeSeries: the API is now aligned with the other PyMCModel subclasses, covariates and variable selection are supported, and edge cases are guarded and tested. Flip BayesianBasisExpansionTimeSeries to DeprecationWarning pointing at StateSpaceTimeSeries, removal one minor release out. Completes the P0 graduation decision for #758.
New its_bsts.ipynb covers the graduated StateSpaceTimeSeries with InterruptedTimeSeries: trend and seasonality only, exogenous control covariates, and spike-and-slab covariate selection with inclusion probabilities. Executed end to end. Adds the Brodersen et al. (2015) reference, updates the ITS toctree and the ARCHITECTURE.md model list, documents the smoothed-posterior R2 caveat on score(), and drops a stale BSTS comment in the ITS experiment. Closes #696 and the documentation item of #758 P0.
anevolbap
force-pushed
the
issue-758-ssts-graduate
branch
from
August 4, 2026 11:23
29c2147 to
d598dd7
Compare
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.
Part of #982 and of #758 (P0). Closes #696. Stacked on #1112, review that one first. Targets
pymc6_and_pymcmarketing1_migration.FutureWarningfromStateSpaceTimeSeries.BayesianBasisExpansionTimeSeriesto aDeprecationWarningpointing atStateSpaceTimeSeries, with removal one minor release out. Note the visibility change: the oldFutureWarningshowed by default, while Python hidesDeprecationWarningoutside__main__.DeprecationWarningis what the rest of the codebase uses (experiments/base.py, the design-alias deprecations), so this follows house style, but users who ignored the experimental warning will now see nothing until removal.seasonal_lengthbelow 2, missing values iny(the Kalman filter imputes them natively, which covers the P2 item of Feature parity with Google's CausalImpact #758 for this model), integer-index error path, and a warning when out-of-sample dates do not continue the training frequency.interrupted-time-series-bsts.ipynb: trend and seasonality, then covariates, then spike-and-slab with inclusion probabilities. Added togallery.yaml.score().Open question before this leaves draft: #758 and #982 both ask whether
BayesianBasisExpansionTimeSeriesshould be deprecated at all. If you would rather keep both models, I can drop the deprecation commit and still graduateStateSpaceTimeSeries.Three items from #982 are deliberately not here, since each is a separate behavior change worth its own review: making
StateSpaceTimeSeriesthe default model forInterruptedTimeSeries, exporting it at top level, and adding acp.InterruptedTimeSeries(data, treatment_time)convenience entry point. The first depends on data-scaled priors (#935). Thenp.ndarraysignature item listed in #982 is already stale: both time-series models takexr.DataArraytoday, andInterruptedTimeSeries.algorithm()dispatches onPyMCModelagainstRegressorMixin, not on the model class.Note for reviewers:
score()is computed on smoothed in-sample predictions, so it reads optimistic relative to other models. Documented, not changed here.Verified locally with pymc 6.2.0, arviz 1.2.0, pymc-extras 0.14.0: 1412 passed, 17 skipped, and 100% patch coverage against the base branch. The notebook was re-executed end to end on that stack (
runner.py --full, no mocks): the covariate model estimates the effect at 1.81 against a true 2.0 and recoversbeta_exogat 2.0 and -1.5. Theaz.summarycall now passesci_kind="hdi", ci_prob=0.94explicitly, since arviz 1.x defaults to 0.89 ETI and the notebook was silently reporting a different interval from the rest of the docs. Sampling now uses 4 chains,tune=1000andtarget_accept=0.95: the trend-only and covariate models are clean apart from 3 divergences, down from 15 in the pymc 5 run. The selection model still reports rhat above 1.01, which is inherent to a spike-and-slab posterior rather than a sampling setup problem, so the notebook says so and points the reader at the inclusion probabilities.