This erratum reports corrections to errors in Gershman and Niv (2012), which described simulations of a computational model of classical conditioning. The major error in the manuscript was an incorrect implementation of importance weighting in the particle filter. In Eq. 5 of the Supplemental Materials, the approximate posterior should be a weighted sum of delta functions defined at the particles:

$$ P\left({\boldsymbol{c}}_{1:t}=\boldsymbol{c}\right|{\boldsymbol{F}}_{1:t}\Big)\approx {\sum}_l{w}^{(l)}\delta \left[{\boldsymbol{c}}_{1:t}^{(l)},\boldsymbol{c}\right] $$

where the particles are sampled from the Chinese restaurant process prior at each time step, and the importance weight is given by:

$$ {w}^{(l)}\propto P\left({\boldsymbol{F}}_{1:t}|{\boldsymbol{c}}_{1:t}^{(l)}\right) $$

and then normalized by the sum of all weights (so that the weights add up to 1). We have fixed this error, so that the model is consistent with the implementation described in Gershman, Blei, and Niv (2010). The code implementing the corrected model is available at:

http://gershmanlab.webfactional.com/pubs/latent_cause_model.zip

There were three other errors in the code that related to how the model was applied to particular experimental phenomena. In the first two cases, the simulation did not match the experimental procedure (corrected figures appear below). One was in the simulation of conditioning with imperfect predictors (Fig. 1). Fixing this error qualitatively changed the results, so that our original conclusions no longer hold. The other was in the simulation of extinction of conditioned inhibition (Fig. 2). As in the original simulation, the highest response was produced in the X+ condition, but unlike in the original simulation the control condition produced higher responding than the X- condition. We also note that the text on p. 262 was confusing in relation to Fig. 2, as it mentions AX+/X-, whereas the caption refers to AX-/A+ (which is what we simulated).

Fig. 1
figure 1

(corrected) Conditioning with an imperfect predictor. Simulation of the Wilson, Boumphrey, and Pearce (1992) partially reinforced serial-conditioning paradigm. In the first training phase (Trials 1–10 in our simulation), two groups of rats are presented with a light cue followed by a tone cue, which in turn is intermittently paired with an unconditioned stimulus (US; in our simulation, every other trial includes a US). (A and B) Both groups assign the first (reinforced) trial to Cause 1 and the second (nonreinforced) trial to both Cause 1 and Cause 2. Henceforth, both groups assign reinforced trials predominantly to Cause 1 (which is thus associated with high probability of a US) and nonreinforced trials to both Cause 1 and Cause 2 (the second cause being associated with a low probability of a US). For illustration purposes, we have labeled the causes “CS+” and “CS–” according to their association with reinforcement. In the second phase (Trials 10–50 in our simulation), Group C continues to be trained on this task, while Group E is switched to a schedule in which the tone is omitted on all nonreinforced trials. In our simulations, this results in a third cause being inferred (not shown here) for Group C, with the new light – no-US trials being assigned to all three causes with some probability. Finally, in a test phase (Trials 50–60), the light is paired directly with the US for both groups. (C) Simulated responding corresponding to the final phase shows greater responding in group E, in agreement with the experimental results. This results from the greater diversity of the trials assigned to Cause 1 in the second phase in Group E (this cause accounts for trials with light, tone, and US; light, tone, and no US; and light and no US), which means that the light-only test trials are assigned to this cause with higher probability, thus bringing about higher expectations for the occurrence of a US

Fig. 2
figure 2

(corrected) Extinction of conditioned inhibition. Simulation of conditioned responding during presentation of the compound BX (i.e., a summation test) following conditioned inhibition training (AX–, A+, B+) and one of three post-training manipulations – extinction of the conditioned inhibitor (X–), reinforcement of the conditioned inhibitor (X+), and no presentation of the conditioned inhibitor (Control)

The third error pertains to Fig. 9 (simulation of the Hall Pearce effect). The text describes a reward magnitude manipulation. However, the model cannot simulate scalar changes in reward magnitude because rewards are modeled as binary. The original implementation used a non-binary reward value, but this is conceptually incorrect.