Skip to content

[rational_expectations] Update content and styling - #764

Merged
jstac merged 5 commits into
mainfrom
update_rational_expectations
Aug 6, 2026
Merged

[rational_expectations] Update content and styling#764
jstac merged 5 commits into
mainfrom
update_rational_expectations

Conversation

@xuanguang-li

Copy link
Copy Markdown
Contributor

This pull request makes a series of stylistic and clarity improvements to the lectures/rational_expectations.md file. There are no code changes, as the control problem is solved using quantecon.LQ, for which numpy works well.

Key changes:

Mathematical and technical clarifications:

  • Clarified the meaning of $Y_{t+1}$ in different places.
  • Updated the Euler equation to use the belief function $H$ consistently, and added an equivalent form for clarity.
  • Added an explanation for the failure of contractivity using Blackwell's condition, improving conceptual understanding.
  • Clarified and corrected the law of motion for the case of a unit measure of firms in the first exercise.

Formatting and reference improvements:

  • Converted links to internal documentation references
  • Added a proper definition block.
  • Changed all section and subsection headings to sentence case

@xuanguang-li xuanguang-li changed the title [rational expectations] Update content and styling [rational_expectations] Update content and styling Dec 14, 2025
@github-actions

Copy link
Copy Markdown

📖 Netlify Preview Ready!

Preview URL: https://pr-764--sunny-cactus-210e3e.netlify.app (f2c363d)

📚 Changed Lecture Pages: rational_expectations

@jstac

jstac commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🤖 Status note for a future session — from a maintainer investigation on 2026-07-08 into why open-PR previews 404. Context only, not instructions.

Netlify preview: https://pr-764--sunny-cactus-210e3e.netlify.app/ currently returns 404.

Why previews are down (repo-wide findings)

1. This branch is stale — 94 commits behind main. A preview build compiles the whole site from this branch. This branch's lectures/house_auction.md still has unpinned !pip install prettytable, which now breaks on a wcwidth incompatibility. main fixed this on 2026-06-28 by pinning prettytable<3.18 (#939). This alone fails any rebuild of this branch until it's updated to main.

2. The arviz failure was a red herring — do NOT pin arviz or rewrite plotting. A 2026-07-07 rebuild also failed in ar1_bayes/ar1_turningpts with an arviz_plots figsize ValueError. That was a transient bug in an intermediate arviz-plots 1.x release, already fixed in arviz 1.2.0. Verified locally on a clean latest-stack venv: the real az.plot_trace(trace) cell (pymc + numpyro InferenceData) runs green. The lectures use only 1.x-compatible arviz APIs (plot_trace, summary, from_numpyro, compare).

Recommended first step for this PR

Update this branch to main (merge or rebase — pulls in #939 plus ~94 other commits), then let CI rebuild. On today's latest libraries the site builds clean, so the preview should return. house_auction is the known blocker; updating also picks up other since-merged fixes — rebuild and address any remaining per-lecture failures. Verify with:

curl -sI https://pr-764--sunny-cactus-210e3e.netlify.app/rational_expectations.html

This PR touches: rational_expectations.md. Last CI build: success@2025-12-14. Branch: 94 commits behind main as of 2026-07-08.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

📖 Netlify Preview Ready!

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

Commit: f0eaf7e

📚 Changed Lectures


Build Info

jstac and others added 2 commits August 6, 2026 09:22
- Key insight: the Euler equation {eq}`ree_comp7` now carries H(Y_t)
  rather than Y_{t+1}, so matching it to the planner's equation
  {eq}`comp16` needs the equilibrium condition H(Y_t) = Y_{t+1} as well
  as y_t = Y_t. Previously the text claimed the two were identical by
  algebra alone, which is no longer true. State the condition explicitly.

- Replace a literal Unicode omega (U+03C9) with \omega in the new
  exercise derivation, where the neighbouring integral already used
  \omega. MathJax may tolerate the raw character but the LaTeX builder
  is unlikely to.

- Add the missing blank lines around that display block; without them
  the $$ ran straight into the preceding sentence and into
  {solution-end}.

- Blackwell paragraph: fix "intuively", "monotoncity" and "the
  Blackwell's", and write the aggregate law of motion as Y_{t+1} rather
  than y_{t+1}, since h(Y_t, Y_t) is aggregate output rather than an
  individual firm's.

- Add the missing space in a {doc} role, matching the other two in this
  lecture.

Co-Authored-By: xuanguang-li <xuanguang-li@users.noreply.github.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jstac
jstac marked this pull request as ready for review August 6, 2026 00:05
@jstac jstac added review and removed in-work labels Aug 6, 2026
@jstac

jstac commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Thanks @xuanguang-li — this one is in good shape, and I've merged current main and made a few fixes on top rather than leave it sitting.

Worth saying first: declining to convert this lecture to JAX was the right call, and the reasoning in the PR description is exactly right. The control problem goes through quantecon.LQ, which is NumPy internally, so a conversion would have moved the array constructors and left the computation where it was.

One substantive fix. Changing the Euler equation {eq}ree_comp7 to carry $H(Y_t)$ rather than $Y_{t+1}$ is a good clarification — it makes the belief-dependence explicit and matches your new note that $Y_{t+1}$ means perceived output at that stage. But it has a knock-on effect two sections later. Key insight said:

Return to equation {eq}ree_comp7 and set $y_t = Y_t$ for all $t$. A small amount of algebra will convince you that when $y_t=Y_t$, equations {eq}comp16 and {eq}ree_comp7 are identical.

With $Y_{t+1}$ in the Euler equation that really was algebra alone. With $H(Y_t)$, matching {eq}comp16 also needs $H(Y_t) = Y_{t+1}$, which is the equilibrium fixed-point condition. So I've stated it:

In a rational expectations equilibrium the perceived and actual laws of motion agree, so $H(Y_t) = Y_{t+1}$.

Imposing this alongside $y_t = Y_t$, a small amount of algebra will convince you that equations {eq}comp16 and {eq}ree_comp7 are identical.

A likely build breaker. In the new derivation for the unit measure of firms, the second integral ended with a literal Unicode omega (U+03C9) where the neighbouring one correctly used d\omega. MathJax might have coped; the LaTeX builder almost certainly would not. That block was also missing blank lines on both sides, so the $$ ran straight into the preceding sentence and into {solution-end} — enough to break the rendering on its own. Both fixed. The mathematics itself checks out against the $n$-firm result just above it at $n = 1$.

The Blackwell paragraph is a genuinely useful addition and I've kept the argument, with some tidying: intuivelyintuitively, monotoncitymonotonicity, the Blackwell's conditionBlackwell's condition, and $y_{t+1} = h(Y_t, Y_t)$$Y_{t+1}$, since $h(Y_t, Y_t)$ is the aggregate law of motion rather than an individual firm's output. I also split it into one-sentence paragraphs to match the lecture, and made the conclusion explicit — that $\Phi$ reverses the ordering of beliefs, which is why monotonicity fails.

Minor: added the missing space in {doc}... ``, matching the other two roles in the lecture.

The branch was 57 commits behind main, which is why the preview was 404ing; that's merged now and the PR is marked ready. The lecture executes clean.

@jstac

jstac commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Thanks @xuanguang-li , comments from Claude above. This should be good to merge when green --- I'll do so if it looks good.

@jstac
jstac merged commit d7cdb96 into main Aug 6, 2026
1 check passed
@jstac
jstac deleted the update_rational_expectations branch August 6, 2026 00:34
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Review Lectures & Modernise Code Aug 6, 2026
@mmcky

mmcky commented Aug 6, 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#243
Files synced (1):

  • lectures/rational_expectations.md

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

Projects

Development

Successfully merging this pull request may close these issues.

3 participants