Skip to content

Allow posterior prediction to extend state-centered temporal processes beyond the fitted time horizon. - #888

Merged
cdc-mitzimorris merged 71 commits into
mainfrom
mem_issue_886_post_pred
Sep 18, 2026
Merged

cdc-mitzimorris merged 71 commits into
mainfrom
mem_issue_886_post_pred

Conversation

@cdc-mitzimorris

Copy link
Copy Markdown
Collaborator

This PR lets users can select either parameterization and get the same forecast-horizon behavior:

  • Posterior prediction at the fitted horizon replays the fitted trajectory.
  • Posterior prediction at a longer horizon replays the fitted trajectory and samples the missing suffix.

Changes made:

  • Converted state branches of RandomWalk, AR1, and DifferencedAR1 to NumPyro scan.
  • _state sites now use (time, process) layout as innovation processes.
  • Added posterior-extension and terminal-carry tests.
  • Added forecasting parity tests for state and innovation parameterizations.

Files changed:

  • pyrenew/latent/temporal_processes.py
  • test/test_temporal_processes.py
  • latent/init.py (pyrenew/latent/init.py)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The unrelated repository instruction file should be removed or explicitly documented and reviewed as part of this PR.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Enables state-centered temporal processes to extend posterior forecasts beyond fitted horizons.

Changes:

  • Reimplemented state transitions with NumPyro scan.
  • Added replay, extension, terminal-carry, and parity tests.
  • Preserved state-distribution exports and added repository guidance.
File summaries
File Description
pyrenew/latent/temporal_processes.py Implements time-leading scanned state transitions.
test/test_temporal_processes.py Tests state replay and forecast extension.
pyrenew/latent/__init__.py Preserves state-distribution exports.
AGENTS.md Adds unrelated repository-wide contributor guidance.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread AGENTS.md
@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Thank you for your contribution @cdc-mitzimorris 🚀! Your github-pages is ready for download 👉 here 👈!
(The artifact expires on 2026-09-25T16:12:18Z. You can re-generate it by re-running the workflow here.)

Comment thread pyrenew/latent/__init__.py Outdated
@codecov

codecov Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.82%. Comparing base (9493a0a) to head (c477d4f).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #888      +/-   ##
==========================================
+ Coverage   98.79%   98.82%   +0.02%     
==========================================
  Files          59       58       -1     
  Lines        2240     2124     -116     
==========================================
- Hits         2213     2099     -114     
+ Misses         27       25       -2     
Flag Coverage Δ
unittests 98.82% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread pyrenew/latent/temporal_processes.py

@dylanhmorris dylanhmorris left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple key things.

@cdc-mitzimorris

Copy link
Copy Markdown
Collaborator Author

A couple key things.

@dylanhmorris - all requested changes made.

Comment thread test/test_temporal_processes.py Outdated
Comment thread test/test_temporal_processes.py

@dylanhmorris dylanhmorris left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @cdc-mitzimorris. Please reconcile merge conflicts with main so there's no AGENTS.md in this diff.

Longer term we may wish to think about a full refactor of how we handle processes (as PyRenew base RVs vs NumPyro distributions vs TemporalProcess wrappers of PyRenew base RVs. But I think we should land this to unblock you.

@cdc-mitzimorris
cdc-mitzimorris merged commit e6e7645 into main Sep 18, 2026
8 checks passed
@cdc-mitzimorris
cdc-mitzimorris deleted the mem_issue_886_post_pred branch September 18, 2026 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants