Skip to content

[gallant_tauchen] Add a lecture on Gallant and Tauchen's efficient method of moments - #1087

Merged
mmcky merged 3 commits into
mainfrom
gallant_tauchen
Oct 12, 2026
Merged

mmcky merged 3 commits into
mainfrom
gallant_tauchen

Conversation

@mmcky

@mmcky mmcky commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Author: @thomassargent30 wrote this lecture and is its primary author. @mmcky opened the PR and is handling the review process.

The lecture explains how to choose moments when a structural model can be simulated but its likelihood cannot be written down. It distinguishes the structural parameter vector from the auxiliary parameter vector, derives the score moment conditions as the negative gradient of a Kullback-Leibler divergence, and states Gallant and Tauchen's efficiency results.

Two examples estimate an AR(1) inside an AR(2), where the estimator matches maximum likelihood, and a stochastic volatility model with a GARCH score generator. The examples compute standard errors, J tests, and quasi-t-ratios. Four exercises cover the KL reading, a Monte Carlo check of Theorem 2, identification failure, and the weighting matrix when scores are serially correlated.

…thod of moments

The lecture explains how to choose moments when a structural model can be
simulated but its likelihood cannot be written down. It distinguishes the
structural parameter vector from the auxiliary parameter vector, derives the
score moment conditions as the negative gradient of a Kullback-Leibler
divergence, and states Gallant and Tauchen's efficiency results.

Two examples estimate an AR(1) inside an AR(2), where the estimator matches
maximum likelihood, and a stochastic volatility model with a GARCH score
generator. The examples compute standard errors, J tests, and quasi-t-ratios.
Four exercises cover the KL reading, a Monte Carlo check of Theorem 2,
identification failure, and the weighting matrix when scores are serially
correlated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 11, 2026 23:35
@mmcky
mmcky marked this pull request as draft October 11, 2026 23:36

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.

🔵 Needs a closer look

It adds a large, mathematically dense new lecture whose printed numeric results and figures can only be fully validated by executing the notebooks in a full build, which is outside automated review.

1 open finding
What changed in this PR

This PR adds a new QuantEcon lecture, gallant_tauchen.md ("Which Moments to Match?"), explaining Gallant and Tauchen's efficient method of moments (EMM) for estimating structural models that can be simulated but whose likelihood cannot be written down. It develops the score-based moment conditions, their Kullback-Leibler interpretation, and the efficiency results, then illustrates them with an AR(1)-in-AR(2) example (checked against maximum likelihood) and a stochastic volatility example with a GARCH score generator, plus four exercises. The lecture fits into the probability/likelihood group of the book (alongside divergence_measures, likelihood_ratio_process, mle, and hansen_singleton_1982), which it cross-references.

Changes:

  • New lecture gallant_tauchen.md with theory, two worked examples, and four exercises with solutions.
  • Registered the lecture in _toc.yml under the likelihood/probability part.
  • Added 17 new BibTeX entries to quant-econ.bib to support the lecture's citations.
File Description
lectures/​gallant_tauchen.md New lecture; the substantive content of the PR, including derivations, simulation code, and exercises.
lectures/​_toc.yml Adds gallant_tauchen to the table of contents so the lecture is included in the build.
lectures/​_static/​quant-econ.bib Adds the references cited by the new lecture; all keys are unique and Hansen1982 already existed.

Notes from verification: all {cite} keys resolve to bib entries, all {doc} targets exist, all internal {ref}/{eq}/footnote labels are defined with no cross-file collisions, and the numeric claims I could check analytically (kurtosis formulas ≈4.7 and ≈15.5, simulation factors 1.05/1.04, Parzen weights 0.72/0.25/0.03, AR(2) and GARCH score formulas) are consistent. The one issue found is a minor, negligible-impact inconsistency in the stochastic-volatility simulator's initialization.

🧠 Review effort: Balanced


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

Comment thread lectures/gallant_tauchen.md
@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

📖 Netlify Preview Ready!

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

Commit: 648d138

📚 Changed Lectures


Build Info

@mmcky
mmcky marked this pull request as ready for review October 12, 2026 00:43
… style conventions

Seed the stochastic volatility simulator's first observation from the
stationary draw and start the loop at t = 1, matching simulate_ar1. The
old loop consumed η[0] twice, which gave the first observation a
log-volatility variance 1.6 times the stationary value at a = 0.95.
Exercise 4 averages GARCH scores over 300 short simulated samples, so its
simulated estimate of the score variance was inflated. The revised prose
reports the corrected ratios: two to four times the outer product, Theorem 1
standard errors understated by about a third, and Parzen closing less than
half of the gap. The main examples move only in the third decimal place.

Use {cite:t} where authors are the subject of the sentence and ^\top for
transposes, following the QuantEcon style rules and sibling lectures.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@mmcky

mmcky commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Review notes on the first commit, now addressed in 7cf294b.

Content and numbers. The math checks out (AR(2) score, KL-gradient identity, kurtosis values 4.7 and 15.5, Parzen weights, the identity behind Theorem 2, the quasi-t variance). Every printed number in the preview matched its prose claim, all 17 new bib entries have correct details with no key collisions, and all cross-references resolve. The lecture runs in about 15 seconds.

Changes in 7cf294b.

  • Copilot's simulate_sv finding is correct and mattered more than it looked: Exercise 4's simulated estimate of the score variance was inflated by the initialization at a = 0.95. Fixed the simulator and revised four sentences in the Exercise 4 solution to the corrected ratios (two to four times the outer product; Theorem 1 standard errors understated by about a third; Parzen closes less than half the gap; autocorrelations 0.16 to 0.37). The qualitative lesson is unchanged. Main examples move only in the third decimal place and all other prose still holds.
  • {cite} to {cite:t} in 20 places where the authors are the subject of the sentence, as in hansen_singleton_1982.
  • Transposes written with ^\top rather than a prime, as in sibling lectures.

Left as is, for Tom's judgment. The four figures set figsize and have no captions or names; TOC placement in Statistics and Information fits the KL-projection framing. Two claims I could not check against the papers: the Duffee and Stanton (2008) characterization and the Section 4.1 / 4.2 pointers into Gallant and Tauchen (1996).

Bibliography: rewrite the 17 new entries to the manual's bibliography rules.
Titles in title case with {Markov} braced, a doi on every entry (the
published version, not the SSRN or NBER working paper), accented characters
typed directly, and no fields a reader never sees.

Figures: caption and name the two main-text figures through mystnb metadata,
drop the explicit figsize settings, and use lw=2 on the criterion curves. The
return series keeps lw=0.6 because at lw=2 two thousand points render as a
solid band. The Exercise 2 scatter stays uncaptioned for the PDF build.

Notation: N(0, 1) for the normal distribution, \mathbb{E} and \mathbb{V} for
expectation and variance, and IID in place of i.i.d.

No printed number changes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@mmcky

mmcky commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

thanks @thomassargent30 merging this now.

@mmcky
mmcky merged commit f8d7e33 into main Oct 12, 2026
2 checks passed
@mmcky
mmcky deleted the gallant_tauchen branch October 12, 2026 02:30
@mmcky

mmcky commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

✅ Translation sync completed (zh-cn)

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

  • lectures/gallant_tauchen.md
  • lectures/_toc.yml

mmcky added a commit to QuantEcon/lecture-python.zh-cn that referenced this pull request Oct 22, 2026
QuantEcon/lecture-python.myst#1087 added gallant_tauchen; its sync PR,
#294, could not build until #286 landed. When #286 merged, the rebase
automation re-translated the lecture at @v0 (v0.29.6) and force-pushed
the branch, and GitHub shut that PR in the same second (the
QuantEcon/action-translation#280 race). The lecture and its state file
are taken unchanged from that branch (5d35ce7).

Checked against the English source: identical directive sequence (43),
math blocks, anchors, the 54 cross-references and citations, headings
and code cells; all 23 code cells execute with numerical output
identical to the English.

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 sync recorded source-sha as f8d7e33, the merge commit of
QuantEcon/lecture-python.myst#1087, which was a true merge rather than
a squash. translate status compares source-sha with the file's last
commit, 648d138 (the PR's head), so it reported this lecture OUTDATED
although the source blob is identical at both. Recorded as 648d138, the
convention translate init and the other 138 state files in this edition
follow; nothing else in the file changes.

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
…closed #294 and #296) (#300)

* Add gallant_tauchen, as the sync's rebase delivered it at v0.29.6

QuantEcon/lecture-python.myst#1087 added gallant_tauchen; its sync PR,
#294, could not build until #286 landed. When #286 merged, the rebase
automation re-translated the lecture at @v0 (v0.29.6) and force-pushed
the branch, and GitHub shut that PR in the same second (the
QuantEcon/action-translation#280 race). The lecture and its state file
are taken unchanged from that branch (5d35ce7).

Checked against the English source: identical directive sequence (43),
math blocks, anchors, the 54 cross-references and citations, headings
and code cells; all 23 code cells execute with numerical output
identical to the English.

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

* gallant_tauchen: localise the two English figure captions

Both mystnb figure captions arrived in English, the
QuantEcon/action-translation#255 class. Each uses the lecture's own
terms: 公共随机数 and 重新抽取扰动项 (the two curves' descriptions in
the text above the figure), 准则函数, 随机波动率 and 收益率.

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

* Seed social_security_depletion, the lecture its sync could not deliver

QuantEcon/lecture-python.myst#1091 added social_security_depletion, but
its sync failed the structural parity check (the model dropped the
leading {raw} header block), filed as
QuantEcon/lecture-python.myst#1092, so its sync PR (#296) opened with a
_toc.yml change and no lecture.

translate init -f social_security_depletion.md at engine v0.29.6 (@v0),
claude-sonnet-5, from lecture-python.myst main (9ad04de; the file's
last change is 97c5894). The first attempt failed parity the same way
and wrote nothing; the second passed.

Output as written by the CLI. Its font path is repaired in the next
commit.

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

* social_security_depletion: font path

The engine writes FONTPATH as _fonts/...; this edition keeps the font in
lectures/fonts/, so the build would fail with FileNotFoundError. The
block is already in the imports cell, and nothing after it resets
font.family.

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

* bib: add the 21 entries the two lectures cite

gallant_tauchen cites 17 keys and social_security_depletion 4 that
this edition's bibliography lacks. Each is copied verbatim from the
source bib and placed after the nearest preceding entry the two files
share, keeping the source's order. Additions only; the same 21 keys the
sync's rebase added on the two closed PRs' branches.

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

* _toc.yml: add gallant_tauchen and social_security_depletion

At their source positions: gallant_tauchen after market_diffusion, and
social_security_depletion after two_computation, before
lq_mean_field_games. Built on main's _toc.yml, so the Chinese part
captions are untouched.

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

* gallant_tauchen state: record the file's last source commit

The sync recorded source-sha as f8d7e33, the merge commit of
QuantEcon/lecture-python.myst#1087, which was a true merge rather than
a squash. translate status compares source-sha with the file's last
commit, 648d138 (the PR's head), so it reported this lecture OUTDATED
although the source blob is identical at both. Recorded as 648d138, the
convention translate init and the other 138 state files in this edition
follow; nothing else in the file changes.

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

---------

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