Skip to content

[stationary_densities] Fix typos and align with style manual#331

Merged
jstac merged 3 commits into
mainfrom
fix/statd-typos
Jun 5, 2026
Merged

[stationary_densities] Fix typos and align with style manual#331
jstac merged 3 commits into
mainfrom
fix/statd-typos

Conversation

@jstac

@jstac jstac commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Two commits cleaning up the stationary_densities lecture:

1. Typos and minor code issues

  • "for all $s$" → "for all $x$" in the state-space remark
  • Off-by-one comment on density dates (1,...,T+11,...,T)
  • Stray trailing comma in the boxplot data display
  • "discrete-time" → "discrete time" (noun usage)
  • Missing period after the Markov operator definition
  • Initialize X[0] in the exercise 1 solution (was uninitialized np.empty memory)
  • Boxplot panel titles now label the initial condition as $X_0$, not $t$
  • Comments corrected to $B \sim N(0, a_\sigma^2)$ since a_σ is the standard deviation

2. Style-manual alignment

  • Links: intersphinx {doc} links for finite_markov references, normalized the outdated python-intro.quantecon.org domain, auto-title link for arma
  • Citations: {cite:t} for the in-sentence Hopenhayn–Rogerson reference
  • Definitions: bold (not italic) for stochastic kernel, Markov operator, look-ahead, stationary, global stability, ergodicity
  • Math: square brackets for expectation, \mathrm{LN} for the lognormal, "CDFs" capitalization
  • Figures: ax.set_titlemystnb caption on the main example, caption for the static stability figure, dropped unneeded figsize settings, ex-3 panel titles formatted to one decimal
  • Code: migrated to the np.random.default_rng() Generator API, with random_state=rng on all scipy .rvs() calls for reproducibility

Deliberate deviations from the style manual

  • Kept figsize=(11, 8) on the 2×2 panel in the ex-2 solution: this repo has no series-wide figure-size default in _config.yml, and at matplotlib defaults the grid's labels collide. (The repo may want the standard figure-size config added separately.)
  • Kept the ex-3 subplot titles: mystnb captions break the PDF build inside solution directives, and the titles carry the per-panel initial conditions.
  • Kept \mathscr D for the set of densities (plain $D$ would collide visually with other notation).

Verification

Converted with jupytext --to py and executed end-to-end — clean run. Visually inspected all five generated figures: density sequences converge, the look-ahead estimator remains visibly tighter than the kernel estimate, and the ex-2/ex-3 convergence patterns match the live site, so the surrounding narrative still holds. Note figures will differ from the live site in exact draws (PCG64 vs legacy global state) per the RNG migration guidance.

🤖 Generated with Claude Code

jstac and others added 2 commits June 4, 2026 07:42
- Fix "for all s" -> "for all x" in state space remark
- Correct off-by-one comment on density dates (1,...,T)
- Remove stray trailing comma in boxplot data display
- "discrete-time" -> "discrete time" (noun usage)
- Add missing period after Markov operator definition
- Initialize X[0] in exercise 1 solution (was uninitialized np.empty)
- Boxplot titles: label initial condition as X_0, not t
- Comments: B ~ N(0, a_σ**2) since a_σ is the std dev

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Links: use intersphinx {doc} links for finite_markov references,
  normalize outdated python-intro.quantecon.org domain, auto-title
  link for arma
- Citation: use {cite:t} for in-sentence Hopenhayn-Rogerson reference
- Definitions: bold (not italic) for stochastic kernel, Markov
  operator, look-ahead, stationary, global stability, ergodicity
- Math: square brackets for expectation, \mathrm{LN} for lognormal,
  "CDFs" capitalization
- Figures: replace ax.set_title with mystnb caption on the main
  example, caption the static stability figure, drop unneeded
  figsize settings, format ex-3 panel titles to one decimal
- RNG: migrate to np.random.default_rng Generator API; seed scipy
  .rvs calls via random_state for reproducibility

Verified by executing the full lecture via jupytext --to py and
inspecting all five generated figures.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@netlify

netlify Bot commented Jun 3, 2026

Copy link
Copy Markdown

Deploy Preview for lustrous-melomakarona-3ee73e ready!

Name Link
🔨 Latest commit fa83d87
🔍 Latest deploy log https://app.netlify.com/projects/lustrous-melomakarona-3ee73e/deploys/6a211f8b3908a20008f8580a
😎 Deploy Preview https://deploy-preview-331--lustrous-melomakarona-3ee73e.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jstac

jstac commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

@Chihiro2000GitHub @xuanguang-li If either of you have time could you please review these changes, which should be in line with the manual, fix the build error (ask claude to investigate), and let me know when you are done? If you can't do it please pass it to @mmcky

The auto-title link `[](arma)` was ambiguous: MyST found both a doc
target (Covariance Stationary Processes) and an equation labelled
`arma`, raising myst.xref_ambiguous. With warnings treated as errors
the book build failed. Use the explicit `{doc}` role to resolve to the
document while keeping the auto-generated title.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

@github-actions github-actions Bot temporarily deployed to pull request June 4, 2026 06:57 Inactive
@xuanguang-li

Copy link
Copy Markdown

Thanks, @mmcky, for fixing the compilation error.

I’ll be able to review this lecture in one or two weeks, as I’m currently reviewing the conversion of DP Vol. II.

Maybe we can discuss the schedule and decide how to proceed. @Chihiro2000GitHub

@jstac

jstac commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Many thanks @mmcky

@jstac jstac merged commit b0d5f76 into main Jun 5, 2026
9 checks passed
@jstac jstac deleted the fix/statd-typos branch June 5, 2026 02:37
@Chihiro2000GitHub

Copy link
Copy Markdown

Hi @jstac, @mmcky, @xuanguang-li,

Sorry for the delayed response.

Many thanks, @mmcky, for fixing this. Glad this has been resolved.

Nice to meet you here, @xuanguang-li.
I hope we'll have another chance to work together sometime.

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.

4 participants