Skip to content

mccall_q: the seeded figures contradict the claim that quitting speeds up learning #1145

Open

Description

@mmcky

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.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WT8bMYDDNE7ziutLwZmeMX

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions