Skip to content

Fix Kalman volatility date alignment - #1116

Open
bennibyx wants to merge 2 commits into
QuantEcon:mainfrom
bennibyx:fix-1108-kalman-volatility-alignment
Open

bennibyx wants to merge 2 commits into
QuantEcon:mainfrom
bennibyx:fix-1108-kalman-volatility-alignment

Conversation

@bennibyx

@bennibyx bennibyx commented Nov 9, 2026

Copy link
Copy Markdown

Summary

  • Fixes the off-by-one volatility alignment in kalman_forward.
  • Uses h[1:] when constructing the observation covariance matrices so that each observation is paired with its corresponding volatility date.

Validation

  • Ran a focused numerical check using synthetic data with deliberately different volatility values at dates 0 and 1.
  • Verified filtered means, filtered covariances, and predicted covariances.
  • git diff --check passed.

Fixes #1108

@mmcky

mmcky commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

@bennibyx thanks for picking up #1108. The one-line change matches the fix proposed there, and we'll review its effect on the lecture's results separately.

QuantEcon welcomes AI-assisted contributions under our Code of AI Use (QEP-5). Before we review further, three things please:

  1. Disclose. Add one line to the PR description: Assisted-by: <tool> (<model>) if AI tools meaningfully contributed to the code or the description (for example Assisted-by: Claude Code (Claude Fable 5.1)), or Assisted-by: none if they did not.
  2. Human in the loop. Reply here to confirm that you chose this task, read the result before submitting it, and will answer review on it yourself.
  3. Verify before you claim. The description says you ran a focused numerical check on synthetic data and verified the filtered means, filtered covariances and predicted covariances. Please share that check (a gist with the script and its output is fine) so a reviewer can see what was compared against what.

None of this decides the merits of the change; it is how we keep review time well spent. Thanks!

@mmcky mmcky added the awaiting-response Waiting on the author or reporter to reply label Dec 3, 2026
@mmcky
mmcky requested an adaptive review from Copilot December 3, 2026 01:30

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.

🟢 Approval recommended

No active review issues remain for the Kalman filter’s volatility date-alignment correction.

No open issues 🎉

What changed in this PR

Fixes the Kalman filter’s volatility date alignment in the Phillips-curve lecture, addressing #1108.

Changes:

  • Constructs observation covariances from h[1:], pairing each observation with its same-date volatility.
File Description
lectures/​phillips_drifts_volatilities.md Corrects volatility indexing in kalman_forward.

Review effort: Balanced (adaptive)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-response Waiting on the author or reporter to reply

Projects

None yet

Development

Successfully merging this pull request may close these issues.

phillips_drifts_volatilities: kalman_forward pairs each observation with the previous date's volatility

3 participants