Skip to content

fix(volatility): prevent look-ahead in GARCH forecasts - #83

Merged
stefan-jansen merged 4 commits into
mainfrom
codex/garch-no-lookahead
Oct 14, 2026
Merged

stefan-jansen merged 4 commits into
mainfrom
codex/garch-no-lookahead

Conversation

@stefan-jansen

@stefan-jansen stefan-jansen commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Closes #82. Supersedes the GARCH portion of #71.

Initialize variance from the first observed return and forecast using information available at each row. A later shock no longer changes forecasts made before it is observed. The one-step forecast uses the current return; longer horizons apply the conditional expectation recurrence.

At reviewed head 69bab62, after incorporating qualified main 1cd06f3, all 64 volatility tests and the full 3,956-test suite pass (57 intentional deselections). Twelve permanent regressions covering horizons 1, 2 and 5 through eager and lazy public expressions all fail against an isolated installation of published 0.1.6 and pass on this fix. The numerical oracle is independently calculated from fixed one-step variances and the closed-form multi-step expectation, not copied from the implementation.

Ruff, formatting, ty, all-file hooks, lock validation, package build/import and strict MkDocs pass. Fresh supported-platform hosted qualification is required before merge. The earlier 53-test evidence remains pinned to its original submitted revision 436eea1.

Forecast values change and warrant inclusion in the eventual qualified patch release. This PR does not publish a release. Cursor Agent source-fix authorship is retained; the expanded regressions are a separate Stefan Jansen commit. Codex assisted public-package reproductions, the numerical regressions, review, checks and this description.

cursoragent and others added 2 commits October 10, 2026 05:38
The initial variance was the sample variance of the next 20 returns, so a
future shock raised earlier forecasts. The horizon recursion also ignored
the current return. Initialization now uses only the first return, and the
forecast at each row uses information available at that row.

Co-authored-by: quantum-like <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 14, 2026 20:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@stefan-jansen
stefan-jansen merged commit c3dd417 into main Oct 14, 2026
31 checks passed
@stefan-jansen
stefan-jansen deleted the codex/garch-no-lookahead branch October 14, 2026 23:41
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.

fix: prevent future returns from changing earlier GARCH forecasts

3 participants