back_prop, stats_examples, endogenous_lake, multi_hyper: four small fixes

Offen
#1,111 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
72/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
data, documentation

Rechercherichtung

Read the four named lecture files at the cited sections: lectures/back_prop.md, lectures/stats_examples.md, lectures/endogenous_lake.md, and lectures/multi_hyper.md. Check the described training shuffle, Pascal formulas, job-finding comparison and message, and count loop length against the issue. Done when each listed correction is reflected and the install cell remains runnable.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Four small things found while these lectures were reviewed on their way into the shared lecture pool (QuantEcon/lectures#44). None is urgent. Line numbers are at 4d82fff.

  • lectures/back_prop.md, train (line 501): each epoch splits key, but line 504 draws the permutation from a fixed random.key(1), so the data come in the same order every epoch and the key argument has no effect. key, subkey = random.split(key) followed by random.permutation(subkey, indices) shuffles as intended.
  • lectures/stats_examples.md, the Pascal (negative binomial) section (lines 121–122): the mean and variance are written with $k$, the value of $X$, where the parameter $r$ belongs: they should read $\mathbb{E}(X) = r(1-p)/p$ and $\mathbb{V}(X) = r(1-p)/p^2$.
  • lectures/endogenous_lake.md, the job-finding rate (lines 338, 464 and 496): the text accepts an offer when $w \geq \bar w$ (lines 84 and 319), but the code counts w_vec > w_bar. Since w_bar is the first grid wage at which accepting is optimal (jnp.searchsorted(V - U, 0)), the strict inequality treats the reservation wage itself as rejected and understates $\lambda$ by $\gamma , p(\bar w)$; >= matches the text. The message printed at line 339 also reads "paramters".
  • lectures/multi_hyper.md, count (line 391): it takes its loop length from the global sample (size = sample.shape[0], line 392) rather than from its own arguments. It gives the right answer here, since it is only called with columns of sample, but Numba freezes global arrays when it compiles, so size = vec1.shape[0] is the safer form.

The same review asked for skip-execution on back_prop's install cell, but that cell is meant to run: the lecture uses kaleido and plotly afterwards.

When these land here, the pool picks them up through its nightly refresh.

Vorherrschende Sprache
TeX
Sterne
129
Forks
59
Ø Merge
2 T. 5 Std.
Gemergte PRs (30 T.)
12

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus QuantEcon/lecture-python.myst

Alle Issues in QuantEcon/lecture-python.myst

Ähnliche Issues

Weitere Issues zu Data Engineering

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.