Skip to content

[mix_model]: Fix issues and improve the lecture#642

Merged
jstac merged 1 commit into
mainfrom
mixmodel-fixes
Jul 19, 2026
Merged

[mix_model]: Fix issues and improve the lecture#642
jstac merged 1 commit into
mainfrom
mixmodel-fixes

Conversation

@bishmaybarik

@bishmaybarik bishmaybarik commented Oct 1, 2025

Copy link
Copy Markdown
Member

This PR fixes the following issues:

The issue was the following:

  • style guide review
  • fix full web links that are currently used across the lectures with a range of link text, doc links.

@bishmaybarik bishmaybarik self-assigned this Oct 1, 2025
@github-actions

github-actions Bot commented Oct 1, 2025

Copy link
Copy Markdown

📖 Netlify Preview Ready!

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

📚 Changed Lecture Pages: mix_model

@github-actions

github-actions Bot commented Oct 1, 2025

Copy link
Copy Markdown

📖 Netlify Preview Ready!

Preview URL: https://pr-642--sunny-cactus-210e3e.netlify.app (7cba5eb)

📚 Changed Lecture Pages: mix_model

@bishmaybarik
bishmaybarik marked this pull request as ready for review October 1, 2025 10:44
@bishmaybarik
bishmaybarik requested a review from mmcky October 1, 2025 10:44
@bishmaybarik

Copy link
Copy Markdown
Member Author

hi @mmcky , I have made some changes and made sure I pushed everything to this branch. although I have checked it myself, it'll be nice to have it reviewed by you :-)

if there are further issues with the lecture, please let me know!

@bishmaybarik bishmaybarik added ready and removed in-work labels Oct 1, 2025
@bishmaybarik bishmaybarik changed the title [FIX]: Improve the mix_model.md lecture [mix_model.md]: Fix issues and improve the lecture Oct 1, 2025
@bishmaybarik bishmaybarik changed the title [mix_model.md]: Fix issues and improve the lecture [mix_model]: Fix issues and improve the lecture Oct 1, 2025
@github-actions

github-actions Bot commented Oct 1, 2025

Copy link
Copy Markdown

📖 Netlify Preview Ready!

Preview URL: https://pr-642--sunny-cactus-210e3e.netlify.app (67c3a4b)

📚 Changed Lecture Pages: mix_model

@bishmaybarik
bishmaybarik requested a review from Copilot October 6, 2025 08: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.

Pull Request Overview

This PR fixes formatting, style, and link issues in the mix_model lecture to align with style guidelines and improve readability. The changes primarily involve converting raw URLs to proper markdown links, fixing capitalization in headings, and correcting a few punctuation errors.

Key Changes

  • Converted raw web links to proper markdown format with descriptive text
  • Fixed capitalization in section headings to follow consistent style
  • Made minor punctuation and text corrections

@bishmaybarik

Copy link
Copy Markdown
Member Author

hi @mmcky, may I know if you have any thoughts on this? I would humbly request you to review this whenever you have the time :-)

@HumphreyYang HumphreyYang left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks @bishmaybarik! These are great changes!

Noted that if we use

{doc}`lecture_name`

It will give use a hyperlink with the lecture title. So we can reduce the usage of "this lecture" in the lectures.

There are also a few lines of code that's touching 80-character limit so please have a go at breaking them into two lines!

Please let me know what you think.

Comment thread lectures/mix_model.md Outdated
Comment thread lectures/mix_model.md Outdated
Comment thread lectures/mix_model.md Outdated
Comment thread lectures/mix_model.md Outdated
Comment thread lectures/mix_model.md Outdated
Comment thread lectures/mix_model.md Outdated
Comment thread lectures/mix_model.md Outdated
Comment thread lectures/mix_model.md Outdated
Comment thread lectures/mix_model.md Outdated
@HumphreyYang HumphreyYang added review and removed ready labels Oct 21, 2025
@bishmaybarik

Copy link
Copy Markdown
Member Author

Thanks for all the suggestions @HumphreyYang -- all of the suggestions are helpful!

I'll make the necessary changes and update this PR as soon as possible.

@github-actions

github-actions Bot commented Nov 7, 2025

Copy link
Copy Markdown

📖 Netlify Preview Ready!

Preview URL: https://pr-642--sunny-cactus-210e3e.netlify.app (77881b7)

📚 Changed Lecture Pages: mix_model

@bishmaybarik

Copy link
Copy Markdown
Member Author

thanks again for these great suggestions @HumphreyYang. All the changes have been made -- it would be great if you could have a look at it whenever you have time :-)

@github-actions

github-actions Bot commented Nov 7, 2025

Copy link
Copy Markdown

📖 Netlify Preview Ready!

Preview URL: https://pr-642--sunny-cactus-210e3e.netlify.app (5b63456)

📚 Changed Lecture Pages: mix_model

@github-actions

github-actions Bot commented Nov 7, 2025

Copy link
Copy Markdown

📖 Netlify Preview Ready!

Preview URL: https://pr-642--sunny-cactus-210e3e.netlify.app (76c9249)

📚 Changed Lecture Pages: mix_model

@github-actions

github-actions Bot commented Nov 7, 2025

Copy link
Copy Markdown

📖 Netlify Preview Ready!

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

📚 Changed Lecture Pages: mix_model

@github-actions

github-actions Bot commented Nov 7, 2025

Copy link
Copy Markdown

📖 Netlify Preview Ready!

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

📚 Changed Lecture Pages: mix_model

@github-actions

github-actions Bot commented Nov 7, 2025

Copy link
Copy Markdown

📖 Netlify Preview Ready!

Preview URL: https://pr-642--sunny-cactus-210e3e.netlify.app (11f108d)

📚 Changed Lecture Pages: mix_model

@github-actions

github-actions Bot commented Nov 7, 2025

Copy link
Copy Markdown

📖 Netlify Preview Ready!

Preview URL: https://pr-642--sunny-cactus-210e3e.netlify.app (92cd96e)

📚 Changed Lecture Pages: mix_model

@github-actions

github-actions Bot commented Nov 7, 2025

Copy link
Copy Markdown

📖 Netlify Preview Ready!

Preview URL: https://pr-642--sunny-cactus-210e3e.netlify.app (4b926c0)

📚 Changed Lecture Pages: mix_model

@github-actions

github-actions Bot commented Nov 7, 2025

Copy link
Copy Markdown

📖 Netlify Preview Ready!

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

📚 Changed Lecture Pages: mix_model

@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-642--sunny-cactus-210e3e.netlify.app/ currently returns 404.

Why previews are down (repo-wide findings)

1. This branch is stale — 174 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 ~174 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-642--sunny-cactus-210e3e.netlify.app/mix_model.html

This PR touches: mix_model.md. Last CI build: success@2025-11-07. Branch: 174 commits behind main as of 2026-07-08.

Rebased onto main. Fixes #577: converts bare/awkward links to MyST
{doc} and inline-link form, applies sentence-case section headings,
and cleans up prose/whitespace. Preserves the rng changes from #978.
jstac pushed a commit that referenced this pull request Jul 19, 2026
Rebased onto main on top of the style-guide branch (#642). Converts
the Numba/NumPy simulation code to JAX (jax.random keys, jax.lax.scan,
jax.vmap), replacing the interim np.random Generator migration from
#978. Keeps #642's link/heading/prose fixes.

Verified: lecture runs end-to-end (JAX cells + numpyro MCMC) on CPU.
@github-actions

Copy link
Copy Markdown

📖 Netlify Preview Ready!

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

Commit: 2d31ac8

📚 Changed Lectures


Build Info

@jstac

jstac commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Many thanks for putting this in @bishmaybarik , it took a long time to get to it but we're merging now!

@jstac
jstac merged commit 2632849 into main Jul 19, 2026
2 checks passed
@jstac
jstac deleted the mixmodel-fixes branch July 19, 2026 01:38
jstac pushed a commit that referenced this pull request Jul 19, 2026
Rebased onto main (now containing the #642 style pass). Converts the
Numba/NumPy simulation code to JAX (jax.random keys, jax.lax.scan,
jax.vmap), superseding the interim np.random Generator migration (#978).

draw_lottery_MC now uses jax.scipy.stats.beta.cdf and a jax.random key
instead of scipy.stats + np.random, so the lecture no longer touches
NumPy's legacy RNG at all.

Verified: full lecture (JAX cells + numpyro NUTS MCMC) runs end-to-end
on CPU; MC draws match the target mixture density.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jstac pushed a commit that referenced this pull request Jul 19, 2026
Rebased onto main (post #642 style pass). Converts the Numba/NumPy
simulation code to JAX (jax.random keys, jax.lax.scan, jax.vmap),
superseding the interim np.random Generator migration (#978).

Randomness uses explicit jax.random.key threading (keys passed into
simulate / draw_lottery / draw_lottery_MC / simulate_mixed / plot_π_seq
/ π_lim, split where needed) rather than deriving seeds from parameter
values, matching the JAX conversion style guide. draw_lottery_MC uses
jax.scipy.stats.beta.cdf, so the lecture no longer touches NumPy's
legacy RNG. Single seed 42 throughout.

Verified: full lecture (JAX cells + numpyro NUTS MCMC) runs end-to-end
on CPU; MC draws match the target mixture density.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jstac added a commit that referenced this pull request Jul 19, 2026
* [mix_model] Convert code to JAX

Rebased onto main (post #642 style pass). Converts the Numba/NumPy
simulation code to JAX (jax.random keys, jax.lax.scan, jax.vmap),
superseding the interim np.random Generator migration (#978).

Randomness uses explicit jax.random.key threading (keys passed into
simulate / draw_lottery / draw_lottery_MC / simulate_mixed / plot_π_seq
/ π_lim, split where needed) rather than deriving seeds from parameter
values, matching the JAX conversion style guide. draw_lottery_MC uses
jax.scipy.stats.beta.cdf, so the lecture no longer touches NumPy's
legacy RNG. Single seed 42 throughout.

Verified: full lecture (JAX cells + numpyro NUTS MCMC) runs end-to-end
on CPU; MC draws match the target mixture density.

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

* [mix_model] Style-guide compliance pass

Bring the lecture into full style-guide compliance:

- figures: remove matplotlib titles (ax.set_title), drop hard-coded
  figsize, use lw=2 on all line charts, lower-case axis labels
- math: \mathbb{E} / \mathbb{P} for expectation/probability, \mathrm{Beta}
  for the distribution name, \log instead of log
- writing: IID (not i.i.d.), Bayes' law (not Bayes' Law / Bayes law)
- doclinks: same-series links use the [](name) auto-title form and drop
  the generic 'this quantecon lecture' text
- code: don't pip install jax at the top (GPU admonition covers it),
  remove the unused pandas import

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

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: John Stachurski <john.stachurski@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[mix_model] FIX: links are full web links across the lecture

4 participants