Repository navigation
[back_prop, stats_examples, endogenous_lake, multi_hyper] Fix four small errors - #1124
Open
officialasishkumar wants to merge 2 commits into
Open
officialasishkumar wants to merge 2 commits into
officialasishkumar wants to merge 2 commits into
Conversation
…all errors - back_prop: train() split the key each epoch but drew the permutation from a fixed random.key(1), so every epoch saw the data in the same order. Draw it from the fresh subkey instead. - stats_examples: the negative binomial mean and variance used k (the value of X) where the parameter r belongs. - endogenous_lake: the text accepts offers with w >= w_bar, but the code counted w > w_bar, which treats the reservation wage itself as rejected and understates the job finding rate. Use >= in the job finding rate and the employed-value mask, and fix a typo in the printed message. - multi_hyper: count() took its loop length from the global sample array, which Numba freezes at compile time. Use vec1.shape[0]. Fixes QuantEcon#1111
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The targeted lecture corrections have no active review issues.
No open issues 🎉
What changed in this PR
Addresses issue #1111 with four targeted corrections to the quantitative economics lectures.
Changes:
- Uses a fresh random key for each training epoch and derives counting length from the input array.
- Corrects negative binomial mean and variance formulas.
- Includes reservation-wage offers in employment calculations and fixes a printed typo.
| File | Description |
|---|---|
| lectures/stats_examples.md | Uses parameter r in mean and variance formulas. |
| lectures/multi_hyper.md | Derives loop length from vec1, not global sample. |
| lectures/endogenous_lake.md | Includes reservation-wage offers and corrects “parameters.” |
| lectures/back_prop.md | Uses a fresh subkey to shuffle each epoch. |
Review effort: Balanced (adaptive)
Contributor
|
@officialasishkumar thanks for this. All four edits match #1111 and look right; we'll check the rebuilt lectures before merging. Under our Code of AI Use (QEP-5), please:
Thanks for saying plainly that you didn't rebuild the lectures. That's exactly what the Code asks for. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1111
Four small fixes from the review in #1111:
trainsplitkeyeach epoch but drew the permutation from a fixedrandom.key(1), so the data came in the same order every epoch. It now draws from the freshsubkey.rinstead ofk:w_vec > w_bar, understating the job finding rate by>=in the three places listed in the issue, and fixed the "paramters" typo in the printed message.countnow takes its loop length fromvec1.shape[0]instead of the globalsample, which Numba freezes at compile time.I did not rebuild the lectures locally (no JAX/Numba environment on the machine I used); the changes are one-line edits matching the descriptions in the issue.