[hoist_failure] Clean up the code and correct minor errors - #656
Conversation
|
📖 Netlify Preview Ready! Preview URL: https://pr-656--sunny-cactus-210e3e.netlify.app (a9df52c) 📚 Changed Lecture Pages: hoist_failure |
|
📖 Netlify Preview Ready! Preview URL: https://pr-656--sunny-cactus-210e3e.netlify.app (174da1f) 📚 Changed Lecture Pages: hoist_failure |
|
🤖 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-656--sunny-cactus-210e3e.netlify.app/ currently returns 404. Why previews are down (repo-wide findings)1. This branch is stale — 166 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: |
|
Hi @HumphreyYang, I'm working through the NumPy random API migration in QuantEcon/meta#299, and This PR already rewrites the sampling cell, so rather than open a separate PR that changes the same lines, I thought I would ask here first. While you are in there, would you be happy to use the Generator API for those draws? rng = np.random.default_rng(1234)
s1 = rng.lognormal(μ, σ, n_samples)
s2 = rng.lognormal(μ, σ, n_samples)
s3 = rng.lognormal(μ, σ, n_samples)That keeps the seed you added, and it saves us both from a conflict on the same lines. If you would rather keep this PR as it is, I am happy to do the migration in a separate PR once this one is merged. |
Brings the branch up to date after 218 commits. Main has not touched hoist_failure.md since this branch opened, so the merge is clean. On top of that: - use np.random.default_rng for the lognormal draws instead of np.random.seed plus the legacy np.random.lognormal, as requested by @Chihiro2000GitHub for the meta#299 migration and required by the style guide's NumPy random section. The seed added by this branch is preserved. - add mystnb captions and names to all seven figures, which the figures style guide requires - make the install cell `{code-cell} ipython3` with `:tags:` syntax, matching the other 22 cells in the lecture Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Thanks @Chihiro2000GitHub, and sorry for the slow reply — @HumphreyYang hasn't been able to get back to this one, so I've picked it up. Yes, let's do it here rather than in a separate PR. I've made exactly the change you suggested on this branch: rng = np.random.default_rng(1234)
s1 = rng.lognormal(μ, σ, n_samples)
s2 = rng.lognormal(μ, σ, n_samples)
s3 = rng.lognormal(μ, σ, n_samples)It replaces the Asking first was the right call: this branch rewrites that cell substantially, so a parallel PR would have conflicted on exactly those lines. While updating the branch I also merged current |
|
Opened #1027 for the two new exercises — exercise 2 can't be answered as posed (the comparison it asks for holds by linearity of expectation regardless of the rare event approximation), and exercise 1's conclusion of |
📖 Netlify Preview Ready!Preview URL: https://pr-656--sunny-cactus-210e3e.netlify.app Commit: 📚 Changed LecturesBuild Info
|
|
Thank you @jstac for picking this up! I really appreciate you making the change I suggested -- that's very helpful. I've noted this in QuantEcon/meta#299. Thanks again! |
This PR cleans up the code and correct minor errors and typos across the lecture.
It also improves the printing and smooth some of the sentences.