You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mccall_q: the seeded figures contradict the claim that quitting speeds up learning #1145
The "Employed Worker Can't Quit" section of mccall_q says that letting an employed worker quit speeds up Q-learning. Since the lecture's draws were seeded (#959, merged 2026-07-31), its two epoch figures are fixed, and they show the opposite.
What the text says
Line 716: giving the worker the option to quit "turns out to accelerate the learning process by promoting experimentation versus premature exploitation only".
Line 732: without that option "learning is slower because an agent who ends up accepting a wage offer prematurely loses the option to explore new states".
Line 734: "This can lead to inferior outcomes when the number of epochs/episodes is low."
What the figures show
The mean error against value function iteration, read from the legends of the two plot_epochs figures on the live page (built from main, seeded with default_rng(123)):
Epochs
Quitting allowed (line 696)
Quitting not allowed (line 742)
100
2233.04
2147.81
1,000
2150.79
1828.91
10,000
1593.86
1547.65
100,000
1264.33
1152.11
200,000
1157.47
1094.10
Without quitting, the error is lower at every epoch count, including the low ones. The page's other claims hold in these figures:
the error falls as the number of epochs grows, in both cases (lines 703 and 736);
wages that are rarely drawn are learned badly, roughly below 22 and above 55 (line 701).
Why it matters now
Before #959, np.random.random() inside the jitclass wasn't reached by np.random.seed, so the figures changed with every build and might or might not have supported the text. Now every build shows this run, so a reader sees the text contradicted directly below it.
One seeded run is a single draw, so this doesn't settle whether the claim holds on average. Ways forward include:
rewording the claim to what the figures show, or hedging it;
averaging the errors over several seeds before comparing the two cases;
choosing a setting where the effect the text describes shows up reliably.
Which one fits is the lecture authors' call. This issue prescribes no wording.
lecture-dp has a copy of this lecture (QuantEcon/lecture-dp#78 brings #959's seeding to it) with the same text and, after that pull request, the same numbers. It will follow whatever changes here.
Activity
mccall_q: draw from a seeded Generator, as intermediate's copy does (#78
mccall_q: match intermediate's copy, apart from the title's number (#83)