Skip to content

[var_dmd, svd_intro, measurement_models] Correct math, add exercises - #1055

Merged
jstac merged 3 commits into
mainfrom
tom_sept
Sep 15, 2026
Merged

jstac merged 3 commits into
mainfrom
tom_sept

Conversation

@jstac

@jstac jstac commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Revisions by @thomassargent30 to var_dmd.md, svd_intro.md and measurement_models.md, plus new bib entries (branch tom_sept, see Tom's email "tom_sept branch(es)"). Tom notes that the live versions of the DMD and VAR material contained substantive mathematical errors that this PR corrects.

var_dmd.md

  • Reframe DMD as a rank-$r$ VAR (principal components regression).
  • Replace the incorrect identity $A = \Phi \Lambda \Phi^+$ with the exact modal representation $A = \Phi \Lambda \Psi$, $\Psi = (W \Lambda)^{-1} U_r^\top$.
  • Add a state-space form, long-run responses, a simulated example, and three exercises.
  • Cite the published Sargent–Selvakumar–Yang (IER 2026) paper.

svd_intro.md

  • Fix the "not not" typo and several errors: four-subspaces code mislabeled $V^\top$, the Eckart–Young statement, reduced-SVD identities, PCA score dimensions and indices, and the polar decomposition.
  • Fix DecomAnalysis for tall matrices and use it.
  • Add two exercises bridging to var_dmd.

measurement_models.md

  • Use the innovation covariance $\Sigma_\eta$ (not the unconditional $R$) in the quasi-differenced Kalman filter.
  • Fix the bracket in the consumption rule and the shock timing.
  • Add an ordering-free Granger causality check, note the exact identity in filtered data, and add three exercises.

Other

  • _static/quant-econ.bib: 49 lines of new references.

Note: the branch is one commit behind main; should merge cleanly but CI will confirm.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UZWhdWQnrKdbgHbyvX4UYs

var_dmd: reframe DMD as a rank-r VAR (principal components regression);
replace the incorrect identity A = Phi Lambda Phi^+ with the exact modal
representation A = Phi Lambda Psi, Psi = (W Lambda)^{-1} U_r^T; add a
state-space form, long-run responses, a simulated example, and three
exercises. Cite the published Sargent-Selvakumar-Yang (IER 2026) paper.

svd_intro: fix the "not not" typo and other errors (four-subspaces code
mislabeled V^T, Eckart-Young statement, reduced-SVD identities, PCA
score dimensions and indices, polar decomposition); fix DecomAnalysis
for tall matrices and use it; add two exercises bridging to var_dmd.

measurement_models: use the innovation covariance Sigma_eta (not the
unconditional R) in the quasi-differenced Kalman filter; fix the bracket
in the consumption rule and shock timing; add an ordering-free Granger
causality check, note the exact identity in filtered data, and add three
exercises.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

📖 Netlify Preview Ready!

Preview URL: https://pr-1055--sunny-cactus-210e3e.netlify.app

Commit: 051b9ba

📚 Changed Lectures


Build Info

jstac and others added 2 commits September 15, 2026 18:08
…ntouts, docstring timing, heading case

- measurement_models: print V2 eigenvalues in scientific notation so the
  tiny second eigenvalue and the third (= ε) are visible, as the text claims
- measurement_models: relabel the Friedman step in the meas_ex1 solution
  as the second claim; align steady_state_kalman docstring with the w_t
  timing convention
- svd_intro: sentence-case section headings per the style manual
- var_dmd: i.i.d. -> IID
- quant-econ.bib: add trailing newline

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jstac
jstac merged commit 63880c0 into main Sep 15, 2026
2 checks passed
@jstac
jstac deleted the tom_sept branch September 15, 2026 09:53
@mmcky

mmcky commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

\translate-resync

Re-running the zh-cn sync of var_dmd, svd_intro and measurement_models: the run for this PR failed on Bad credentials before translating and filed nothing. None of the three lectures has changed on main since this merge, and each zh-cn translation sits at its pre-PR English. The bibliography has moved on since, so the resulting PR's quant-econ.bib will be repaired by hand. Tracked in QuantEcon/lecture-python.zh-cn#298.

mmcky added a commit to QuantEcon/action-translation that referenced this pull request Oct 22, 2026
…tions' fence-line text (#407) (#408)

* sync: route a changed title or intro by emptiness (#362)

Update mode needs old English, new English and the current translation,
and translateSectionUpdate treats an empty string as missing. So a
source PR that added an intro to a lecture, or removed one, failed the
whole file ("Update mode requires oldEnglish, newEnglish, and
currentTranslation"), and every later sync of that lecture ran against
a stale target.

The title and intro branches of processSectionBased now go through one
helper, translateChangedPreamblePart, which routes as #362 specifies:

- new English empty -> written empty, no Claude call
- old English or current translation empty -> mode 'new' on the new
  English
- otherwise -> mode 'update', as before

The rebase-cache fast paths are unchanged. Three tests: intro added
(new mode), intro removed (no call, the stale translation is gone), an
ordinary intro edit (still update). The first two fail on main.

Field cases: hoist_failure and ge_arrow (intro added) and, on
2026-10-22, var_dmd (intro removed; QuantEcon/lecture-python.myst#1095).

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

* parity: body admonitions take translatable fence-line text (#407)

In ```{note} Text... MyST renders the text after the directive name as
the opening of the admonition's body, so it is prose and is translated.
The guard compared it byte for byte as a structural argument and
refused every correct translation of such a file.

note, warning, tip, important, hint, caution, attention, danger, error
and seealso join FLEXIBLE_ARG_DIRECTIVES: the argument must be present
on both sides or absent on both, and its text may differ. Two tests:
the field case passes, and a note that drops its fence-line text still
fails (presence must match).

Field case: lecture-python.myst measurement_models, refused by the
resync of QuantEcon/lecture-python.myst#1055 on 2026-10-22
(QuantEcon/lecture-python.myst#1095) and by four translate init -f
attempts the same day. It is the only such fence in that repository.

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

* build: rebuild dist-action; CHANGELOG for #362 and #407

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@mmcky

mmcky commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

\translate-resync zh-cn

Re-running the zh-cn sync at action-translation v0.30.0, which carries the two fixes the first resync lacked: var_dmd's removed intro (QuantEcon/action-translation#362) and the text on measurement_models's {note} fence line (QuantEcon/action-translation#407). svd_intro was delivered by QuantEcon/lecture-python.zh-cn#303, so it will be dropped from the new sync PR by hand. None of the three lectures has changed on main since this PR merged.

@mmcky

mmcky commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

✅ Translation sync completed (zh-cn)

Target repo: QuantEcon/lecture-python.zh-cn
Translation PR: QuantEcon/lecture-python.zh-cn#304
Files synced (3):

  • lectures/measurement_models.md
  • lectures/svd_intro.md
  • lectures/var_dmd.md

mmcky added a commit to QuantEcon/lecture-python.zh-cn that referenced this pull request Oct 22, 2026
The resync of QuantEcon/lecture-python.myst#1055 regenerates all three of
its lectures, but svd_intro.md was delivered by #303 from the same
English. Applying #1055's changes again altered 9 lines of a translation
that was already current, so svd_intro.md and its state file go back to
main's versions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mmcky added a commit to QuantEcon/lecture-python.zh-cn that referenced this pull request Oct 22, 2026
The resync translated the rewritten sections of
QuantEcon/lecture-python.myst#1055 afresh, so the conventions Songyi Wang
and Humphrey Yang set in their 2025 review of this lecture did not
survive. Restored, text only (structure unchanged: 992 lines, 16 headings,
28 directives, 88 math lines, 12 code cells, 2 links):

- pseudo-inverse is 广义逆矩阵 and Moore-Penrose is 穆尔-彭罗斯 (7 lines),
  with the reviewers' Baidu Baike link and their note on the choice;
- the case labels are 短胖型情况 and 高瘦型情况, and tall-skinny is 高瘦型;
- reduced SVD is 简化 (the resync wrote 约化);
- a dimension before 矩阵 takes 的: `$m \times n$ 的矩阵` (18 places).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mmcky added a commit to QuantEcon/lecture-python.zh-cn that referenced this pull request Oct 22, 2026
… math, add exercises (#304)

* Update translation: lectures/measurement_models.md

* Update translation: .translate/state/measurement_models.md.yml

* Update translation: lectures/svd_intro.md

* Update translation: .translate/state/svd_intro.md.yml

* Update translation: lectures/var_dmd.md

* Update translation: .translate/state/var_dmd.md.yml

* Update translation: lectures/_static/quant-econ.bib

* Drop svd_intro from this resync: #303 already delivered it

The resync of QuantEcon/lecture-python.myst#1055 regenerates all three of
its lectures, but svd_intro.md was delivered by #303 from the same
English. Applying #1055's changes again altered 9 lines of a translation
that was already current, so svd_intro.md and its state file go back to
main's versions.

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

* var_dmd: restore the 2025 reviewers' conventions lost in the resync

The resync translated the rewritten sections of
QuantEcon/lecture-python.myst#1055 afresh, so the conventions Songyi Wang
and Humphrey Yang set in their 2025 review of this lecture did not
survive. Restored, text only (structure unchanged: 992 lines, 16 headings,
28 directives, 88 math lines, 12 code cells, 2 links):

- pseudo-inverse is 广义逆矩阵 and Moore-Penrose is 穆尔-彭罗斯 (7 lines),
  with the reviewers' Baidu Baike link and their note on the choice;
- the case labels are 短胖型情况 and 高瘦型情况, and tall-skinny is 高瘦型;
- reduced SVD is 简化 (the resync wrote 约化);
- a dimension before 矩阵 takes 的: `$m \times n$ 的矩阵` (18 places).

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
mmcky added a commit to QuantEcon/action-translation that referenced this pull request Oct 22, 2026
… published (#413)

The log 2026-10-22-forward-language-codes covers:

- the zh-cn delivery of QuantEcon/lecture-python.myst#1055 and its
  human-edit review;
- #348, landed by PR #412;
- the four forward lectures that needed no forward run;
- the sir_model repair (QuantEcon/lecture-python.zh-cn#305);
- the publish and its live-site checks;
- the updates to #349, #280 and #295.

STATE.md: the release paragraph's next step is done, so Malayalam's
state-file backfill and sync-scope wiring now lead.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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