{ "cells": [ { "cell_type": "markdown", "id": "0", "metadata": {}, "source": [ "# Lesson 9: Choice + Reaction Time Models — DDM and Race-Diffusion\n", "\n", "So far we have modelled **only the choice** that participants make on each trial.\n", "But behaviour also has a *temporal* signature: how long the participant deliberated.\n", "Reaction times (RT) carry information that choice-only models discard. Two trials\n", "with the same choice can differ wildly in confidence, evidence quality, or\n", "deliberation effort — and those differences shape RT.\n", "\n", "This lesson introduces bauer's two **joint choice + RT** model families:\n", "\n", "1. **Drift-Diffusion Model (DDM)** — a single accumulator integrates a *signed*\n", " evidence signal (option 2 minus option 1) until it hits one of two boundaries.\n", "2. **Race-Diffusion Model (RDM)** — two parallel accumulators, one per option,\n", " each integrating its own evidence stream until one wins.\n", "\n", "Both reuse the **same Bayesian-observer cognitive front-end** as the static\n", "psychometric models from lessons 1–4 (priors, asymmetric encoding noise, the\n", "shrinkage weights $\\beta_k$). What changes is only the **decision rule**: instead\n", "of a one-shot cumulative-normal comparison, we now have a stochastic accumulation\n", "process whose first-passage time *is* the participant's RT.\n", "\n", "## Why care about RT?\n", "\n", "A choice-only model fits $P(\\text{choose 2})$ and ignores the RT distribution.\n", "That throws away three pieces of information:\n", "\n", "1. **The size effect.** On magnitude tasks, RT systematically *decreases* with\n", " stimulus magnitude even at fixed difficulty (fixed $\\log(n_2/n_1)$). Bigger\n", " numbers $\\Rightarrow$ bigger drift rates $\\Rightarrow$ faster races. Choice-only\n", " models are silent on this — they have no notion of how long a decision took.\n", "2. **Identifiability.** Choice probabilities are invariant to many transformations\n", " of the underlying parameters (e.g. scaling all noise SDs by a constant\n", " leaves $P$ unchanged if the SNR is preserved). RT distributions break those\n", " degeneracies because the *absolute* speed of accumulation matters, not just\n", " the relative SNR.\n", "3. **Falsification.** A model that fits choice probabilities but predicts the\n", " wrong RT distributions is wrong in a falsifiable way. Joint choice+RT models\n", " are simply a stricter test of the underlying cognitive theory.\n", "\n", "In this lesson we use the Barreto-Garcia et al. (2022) magnitude task to fit\n", "both DDM and RDM variants, compare their posteriors, and see how the\n", "**race-model \"advantage\" decomposition** of drift is essential for capturing\n", "choice — using the wrong decomposition produces a flat psychometric." ] }, { "cell_type": "code", "execution_count": null, "id": "1", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Subjects: 8\n", "Trials: 1568 (~196 per subject)\n", "Columns: ['n1', 'n2', 'choice', 'rt', 'accuracy', 'correct', 'isi']\n", "\n", "Dropped 67 / 1635 trials with rt < 0.20s (4.1%); min rt now 0.202s.\n" ] }, { "data": { "text/html": [ "
| \n", " | \n", " | \n", " | \n", " | n1 | \n", "n2 | \n", "choice | \n", "rt | \n", "accuracy | \n", "correct | \n", "isi | \n", "
|---|---|---|---|---|---|---|---|---|---|---|
| subject | \n", "format | \n", "run | \n", "trial_nr | \n", "\n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " |
| 1 | \n", "non-symbolic | \n", "1 | \n", "1 | \n", "7 | \n", "10 | \n", "True | \n", "0.775 | \n", "1 | \n", "-1 | \n", "8.033 | \n", "
| 2 | \n", "5 | \n", "14 | \n", "False | \n", "0.892 | \n", "0 | \n", "-1 | \n", "8.532 | \n", "|||
| 3 | \n", "7 | \n", "14 | \n", "True | \n", "0.611 | \n", "1 | \n", "-1 | \n", "6.533 | \n", "|||
| 4 | \n", "7 | \n", "10 | \n", "True | \n", "0.660 | \n", "1 | \n", "-1 | \n", "7.033 | \n", "|||
| 5 | \n", "5 | \n", "10 | \n", "True | \n", "0.830 | \n", "1 | \n", "-1 | \n", "9.033 | \n", "