[harrison_kreps] Update lecture - #763
Conversation
|
📖 Netlify Preview Ready! Preview URL: https://pr-763--sunny-cactus-210e3e.netlify.app (f4ecd4b) 📚 Changed Lecture Pages: harrison_kreps |
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
📖 Netlify Preview Ready!Preview URL: https://pr-763--sunny-cactus-210e3e.netlify.app Commit: 📚 Changed LecturesBuild Info
|
|
Thanks @xuanguang-li , much appreciated. I've reviewed the PR. Actually I don't think switching to JAX is justified in this lecture. In the computations of the stationary distribution at the start, we will be using NumPy internally, since that's all qe.MarkovChain can work with. In the later computation, with the for loop, JAX is probably slower, since the array computations are very low dimensional and the main task is iterative. I think it might be best to close this PR. @HumphreyYang or @mmcky, what do you think? If we do close this, let's tick it off or remove it from the meta issue, so we know not to try again. |
|
Many thanks @jstac, I agree! @xuanguang-li also has some other valuable edits in this PR so I can revert the JAX edits and keep others. |
|
Thanks, @jstac and @HumphreyYang, for your comment. I agree with your points. JAX usage is minimal in this lecture. Since the equilibrium computation isn't computationally heavy, I kept the |
|
Thanks @xuanguang-li and @HumphreyYang @HumphreyYang , it would be great if you could revert the jax edits. There are lots of edge cases and in this lecture I think we are making the right decision. |
|
🤖 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-763--sunny-cactus-210e3e.netlify.app/ is currently live — but it's a lucky survivor. It was built 2026-06-05, before the breakages below, and simply hasn't been rebuilt since. Any rebuild will fail until the branch is updated (see below). Why previews are down (repo-wide findings)1. This branch is stale — 39 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: |
Per the review discussion on #763, JAX is not justified in this lecture: the stationary distributions go through qe.MarkovChain, which is NumPy internally, and the remaining work is a low-dimensional iterative loop where JAX would be slower. Resolves lectures/harrison_kreps.md against main, which also restores the jupytext metadata, `{code-cell} ipython3` directives and `:tags:` syntax that the branch still reverted, then reapplies the prose improvements: - section and subsection headings to sentence case, per the style guide - typos: "themsevles" -> "themselves", "agaub" -> "agent" - bold -> italic where the text is emphasis rather than a definition - add the missing "## Exercises" heading before the exercise block Also fixes a typo in the marginal-investor condition, which had P_a(s,1) and P_b(s,1) on the first term where equation hakr2 directly above it has P_a(s,0) and P_b(s,0). The branch had instead changed the matching (correct) terms in the min equation to agree with the typo. Co-Authored-By: xuanguang-li <xuanguang-li@users.noreply.github.com> Co-Authored-By: HumphreyYang <humphreyyang30@gmail.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Following up on the decision from May — @jstac concluded that JAX isn't justified here (the stationary distributions go through Where things stood. Humphrey's commits on 2026-06-05 had already removed the JAX changes — the branch head contained no What I did. Merged current
The PR is now +19/−17 in one file. One thing worth a second look, @jstac. The branch changed the to with Thanks @xuanguang-li — the heading, typo and emphasis fixes are all worth having, and the equation inconsistency was a good catch even though the fix went the other way. |
✅ Translation sync completed (zh-cn)Target repo: QuantEcon/lecture-python.zh-cn
|
This pull request updates the Harrison-Kreps model lecture to use JAX and improves code consistency and formatting throughout the document.
Replaced
numpy(np) andscipy.linalg(la) imports and usages withjax.numpy(jnp) equivalents throughout code cells, but keptforandwhileloops for simplicity.Formatting and terminology improvements: standardized section and subsection titles, and improved consistency in emphasis (e.g., italicizing instead of bolding, fixing typos in comments and variable names).