phillips_drifts_volatilities: `kalman_forward` pairs each observation with the previous date's volatility
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 77/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- numpy, python
- Domain
- data, machine-learning
Research direction
Find kalman_forward and inspect how it constructs r from the volatility path h; the issue identifies the current indexing and the intended h[1:] alignment. Read the sampler code that builds h and the filter loop to confirm dates 1 through T align with the observations. Done when each observation uses the same date's volatility and a focused check confirms the final volatility row is used.
Written by the indexing model from the issue text.
Description
kalman_forward builds r from the whole volatility path h, whose rows are dates 0 to T: run_sampler starts it with T + 1 rows, and draw_volatility_path updates log h_0 to log h_T. The filter's loop then uses r[t] for y[t], the observation at date t + 1, so each observation is filtered with R built from the previous date's volatility: R_1 comes from h_0, and h_T is never used. The rest of the sampler pairs h[t] with date t: draw_volatility_path matches h[t] with the residual at date t, draw_β standardises the residuals by h[1:], and the retained draws keep h[1:]. The model is R_t = B^{-1} H_t B^{-1}′ at the same date, which is also what the line's own comment (# R_1, ..., R_T) says.
This came in with the vectorised filter in #1105. The version before it paired h[t] with y[t - 1] in draw_coefficient_path.
The change is to build r from h[1:]:
r = np.einsum('ij,tj,kj->tik', b_inverse, h[1:], b_inverse) # R_1, ..., R_T
The size of the effect on the posterior has not been measured: the figures and tables would need re-running with the change.
Found by Copilot's review of QuantEcon/lectures#36, which copies this lecture at 4d82fff: https://github.com/QuantEcon/lectures/pull/36#discussion_r4464453856
- Dominant language
- TeX
- Stars
- 129
- Forks
- 61
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 12
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from QuantEcon/lecture-python.myst
-
Link Checker ReportOpenautomated issue linkchecker report
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
QuantEcon/lecture-python.myst#1130 ·
Maintainers usually reply within 1 day
-
[newton_method] Exercise 2 solution stops after the first starting valuePossibly taken @officialasishkumar claimed this 5 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
QuantEcon/lecture-python.myst#1115 · 1 comment ·
Maintainers usually reply within 1 day
-
Link Checker ReportOpenautomated issue linkchecker report
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
QuantEcon/lecture-python.myst#1098 ·
Maintainers usually reply within 1 day
-
Link Checker ReportOpenautomated issue linkchecker report
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
QuantEcon/lecture-python.myst#1094 ·
Maintainers usually reply within 1 day
-
Link Checker ReportOpenautomated issue linkchecker report
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
QuantEcon/lecture-python.myst#1062 ·
Maintainers usually reply within 1 day
All issues in QuantEcon/lecture-python.myst
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
alltheplaces/alltheplaces#20592 ·
Maintainers usually reply within 1 day
-
OCR
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Robin-IA/Congressional-Letters-Dev#852 ·
Maintainers usually reply within 1 day