[mix_model]: Fix issues and improve the lecture#642
Conversation
|
📖 Netlify Preview Ready! Preview URL: https://pr-642--sunny-cactus-210e3e.netlify.app (fb4ddb0) 📚 Changed Lecture Pages: mix_model |
|
📖 Netlify Preview Ready! Preview URL: https://pr-642--sunny-cactus-210e3e.netlify.app (7cba5eb) 📚 Changed Lecture Pages: mix_model |
|
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! |
|
📖 Netlify Preview Ready! Preview URL: https://pr-642--sunny-cactus-210e3e.netlify.app (67c3a4b) 📚 Changed Lecture Pages: mix_model |
There was a problem hiding this comment.
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
|
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
left a comment
There was a problem hiding this comment.
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.
|
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. |
|
📖 Netlify Preview Ready! Preview URL: https://pr-642--sunny-cactus-210e3e.netlify.app (77881b7) 📚 Changed Lecture Pages: mix_model |
|
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 :-) |
|
📖 Netlify Preview Ready! Preview URL: https://pr-642--sunny-cactus-210e3e.netlify.app (5b63456) 📚 Changed Lecture Pages: mix_model |
|
📖 Netlify Preview Ready! Preview URL: https://pr-642--sunny-cactus-210e3e.netlify.app (76c9249) 📚 Changed Lecture Pages: mix_model |
|
📖 Netlify Preview Ready! Preview URL: https://pr-642--sunny-cactus-210e3e.netlify.app (aabecbc) 📚 Changed Lecture Pages: mix_model |
|
📖 Netlify Preview Ready! Preview URL: https://pr-642--sunny-cactus-210e3e.netlify.app (cc3bc96) 📚 Changed Lecture Pages: mix_model |
|
📖 Netlify Preview Ready! Preview URL: https://pr-642--sunny-cactus-210e3e.netlify.app (11f108d) 📚 Changed Lecture Pages: mix_model |
|
📖 Netlify Preview Ready! Preview URL: https://pr-642--sunny-cactus-210e3e.netlify.app (92cd96e) 📚 Changed Lecture Pages: mix_model |
|
📖 Netlify Preview Ready! Preview URL: https://pr-642--sunny-cactus-210e3e.netlify.app (4b926c0) 📚 Changed Lecture Pages: mix_model |
|
📖 Netlify Preview Ready! Preview URL: https://pr-642--sunny-cactus-210e3e.netlify.app (d7ed9ce) 📚 Changed Lecture Pages: mix_model |
|
🤖 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 2. The arviz failure was a red herring — do NOT pin arviz or rewrite plotting. A 2026-07-07 rebuild also failed in Recommended first step for this PRUpdate this branch to This PR touches: |
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.
📖 Netlify Preview Ready!Preview URL: https://pr-642--sunny-cactus-210e3e.netlify.app Commit: 📚 Changed LecturesBuild Info
|
|
Many thanks for putting this in @bishmaybarik , it took a long time to get to it but we're merging now! |
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>
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] 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>
This PR fixes the following issues:
The issue was the following:
link text,doclinks.