Logo van Drift Diffusion Model

Drift Diffusion Model

OrganisatiePopulair
NeuroAIHub
drift-diffusion-model

Expert guidance on selecting, fitting, and evaluating drift-diffusion models for two-choice response time data in cognitive science

Add to TypingMind

Overzicht

UitgeverNeuroAIHub
RepositoryBrainPilot
Skillnaamdrift-diffusion-model
Sterren
1.1K
Forks
74
Meegeleverde bestanden
2
LicentieAGPL-3.0
Links
  • Instructies in Markdown

    Het model laadt het bestand SKILL.md alleen als dat nodig is. Dat kost dus alleen tokens als een verzoek daadwerkelijk bij de skill past.

  • Werkt met elk LLM

    AI-skills bestaan uit instructies in gewone Markdown, niet uit aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Meegeleverde bestanden: 2

    Scripts, sjablonen en referentiemateriaal die het model tijdens het werken kan lezen. De bestanden kunnen alleen worden gelezen en worden nooit uitgevoerd.

  • Open source

    Gepubliceerd door NeuroAIHub op GitHub. Bekijk de bronbestanden voordat je de skill installeert.

Installatie

Installeer de AI-skill Drift Diffusion Model in TypingMind om deze met elk LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map. De app leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/NeuroAIHub/BrainPilot/tree/main/packages/skills/skills/03_Cognitive_Psychology/drift-diffusion-model
  4. Schakel de skill in voor elke chat waarin je de skill wilt kunnen gebruiken.
Plug-ins → Skills → Skill toevoegen → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/NeuroAIHub/BrainPilot.git /tmp/BrainPilot
mkdir -p .claude/skills
cp -r /tmp/BrainPilot/packages/skills/skills/03_Cognitive_Psychology/drift-diffusion-model .claude/skills/drift-diffusion-model
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Drift Diffusion Model in voor een chat naar keuze in TypingMind en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek bij de skill past, laadt het model zelf de volledige instructies. Je hoeft de skill nooit handmatig aan te roepen. Pas als het model de skill daadwerkelijk gebruikt, kost dat tokens.

Het model laadt Drift Diffusion Model automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Drift Diffusion Model niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

Drift-Diffusion Model

Purpose

This skill encodes expert knowledge for applying drift-diffusion models (DDMs) to two-choice reaction time data. DDMs decompose observed accuracy and RT distributions into latent cognitive processes — evidence accumulation rate, response caution, and non-decision time. This skill guides researchers through model variant selection, parameter fitting, and result evaluation, encoding domain-specific judgment that requires specialized training in computational cognitive modeling.

When to Use This Skill

  • Designing a study where two-alternative forced choice (2AFC) RT data will be collected and you want to decompose behavior into latent cognitive components
  • Choosing between DDM variants (classic DDM, full DDM, EZ-diffusion, HDDM, LBA) for a given dataset and research question
  • Setting up model fitting: selecting fitting method, preparing data, configuring software tools
  • Evaluating model fit quality: checking parameter recovery, running posterior predictive checks, comparing nested models
  • Interpreting DDM parameters in terms of cognitive processes (e.g., drift rate as evidence quality, boundary separation as response caution)
  • Troubleshooting fitting problems: convergence failures, implausible parameter estimates, poor fits to RT quantiles

When NOT to Use This Skill

  • Tasks with more than two response options require multi-accumulator models (see Racing Diffusion Model or LBA in references/model-variants.md)
  • Go/No-Go tasks violate the two-boundary assumption; use single-boundary models or SSP models instead (Ratcliff et al., 2018)
  • Tasks where speed-accuracy tradeoff is not a meaningful dimension (e.g., pure accuracy tasks with unlimited time)
  • If you only need a coarse summary of RT effects and do not need process-level decomposition, standard ANOVA on mean RT may suffice

Research Planning Protocol

Before executing the domain-specific steps below, you MUST:

  1. State the research question — What cognitive process decomposition question is this DDM addressing?
  2. Justify the method choice — Why DDM (not simple RT analysis, Bayesian models, etc.)? What alternatives were considered?
  3. Declare expected outcomes — Which parameter(s) do you expect to differ across conditions, and in what direction?
  4. Note assumptions and limitations — What does the DDM assume (e.g., 2AFC, stationary drift)? Where could it mislead?
  5. Present the plan to the user and WAIT for confirmation before proceeding.

For detailed methodology guidance, see the research-literacy skill.

⚠️ Verification Notice

This skill was generated by AI from academic literature. All parameters, thresholds, and citations require independent verification before use in research. If you find errors, please open an issue.

Core Concepts

What the DDM Models

The DDM assumes that on each trial, noisy evidence accumulates over time from a starting point toward one of two decision boundaries. The key insight: observed RT = decision time + non-decision time, and accuracy depends on which boundary is reached first (Ratcliff, 1978).

The Four Core Parameters

ParameterSymbolCognitive InterpretationTypical RangeSource
Drift ratevQuality/strength of evidence accumulation0.1 – 5.0 (commonly 0.5–3.0)Ratcliff & McKoon, 2008; Voss et al., 2004, Table 2
Boundary separationaResponse caution (speed-accuracy tradeoff)0.5 – 2.5 (commonly 0.8–2.0)Ratcliff & McKoon, 2008; Voss et al., 2004, Table 2
Non-decision timet0 (or Ter)Encoding + motor execution time0.1 – 0.6 s (commonly 0.2–0.5 s)Ratcliff & McKoon, 2008; Matzke & Wagenmakers, 2009, Table 1
Starting pointzResponse bias (relative to boundaries)a/2 (unbiased) ± 20%Ratcliff & McKoon, 2008; Voss et al., 2013

Trial-to-Trial Variability Parameters (Full DDM)

ParameterSymbolInterpretationTypical RangeSource
Drift rate variabilitysvCross-trial variation in evidence quality0 – 2.0Ratcliff & McKoon, 2008
Starting point variabilityszCross-trial variation in bias0 – 0.3 × aRatcliff & McKoon, 2008
Non-decision time variabilityst0Cross-trial variation in encoding/motor time0 – 0.3 sRatcliff & McKoon, 2008

Decision Logic: Choosing a Model Variant

Step 1: Assess Your Research Question

Is the goal to decompose RT data into cognitive components?
├── YES → Continue to Step 2
└── NO → DDM may not be needed; consider simpler analyses

Step 2: Assess Data Characteristics

How many trials per condition do you have?
├── < 20 trials → Insufficient for any DDM variant (Ratcliff & Childers, 2015)
├── 20-40 trials → Use EZ-diffusion only (Wagenmakers et al., 2007)
├── 40-100 trials → Classic 4-parameter DDM or EZ-diffusion
├── 100-200 trials → Full DDM possible but fix some variability parameters
└── > 200 trials → Full DDM with all 7 parameters estimable

(Trial count thresholds: Ratcliff & Childers, 2015, simulation study)

Step 3: Choose Variant

Are you comparing groups or conditions at the population level?
├── YES, with moderate sample size (N > 15 participants)
│ └── Consider HDDM for hierarchical/Bayesian estimation (Wiecki et al., 2013)
├── YES, with large trial counts per person
│ └── Classic or Full DDM per participant, then group-level tests on parameters
└── Exploratory / individual differences focus
 └── HDDM or hierarchical Bayesian approach
How many response alternatives?
├── 2 → Standard DDM variants
├── > 2 → LBA or Racing Diffusion Model (see references/model-variants.md)
└── Go/No-Go → Single-boundary model (not covered here)

See references/model-variants.md for detailed comparison of all variants.

Step 4: Select Fitting Method

What variant did you choose?
├── EZ-diffusion → Closed-form solution, no fitting needed (Wagenmakers et al., 2007)
├── Classic/Full DDM → Use fast-dm (Voss & Voss, 2007) or PyDDM (Shinn et al., 2020)
│ ├── MLE: Best for large trial counts (>100 per condition)
│ ├── Chi-square: Robust for moderate trial counts (Ratcliff & Tuerlinckx, 2002)
│ └── Quantile-based (QMP): Most robust to outliers (Heathcote et al., 2002)
└── HDDM → Use HDDM Python package, Bayesian estimation (Wiecki et al., 2013)

See references/fitting-guide.md for the complete fitting workflow.

Fitting Workflow Summary

  1. Data Preparation: Clean RTs, apply cutoffs (remove < 200 ms and > 3000-5000 ms; Ratcliff, 1993; Ratcliff & Tuerlinckx, 2002), code accuracy
  2. Model Specification: Choose parameters to estimate vs. fix; decide which parameters vary across conditions
  3. Parameter Estimation: Run fitting with chosen method and tool
  4. Convergence Check: Verify optimizer converged; run multiple starting points
  5. Model Comparison: Use BIC (for MLE-fitted models) or DIC/WAIC (for Bayesian; Spiegelhalter et al., 2002) to compare nested models
  6. Posterior Predictive Check: Simulate data from fitted parameters; compare predicted vs. observed RT quantiles (Ratcliff & McKoon, 2008, Fig. 2)
  7. Parameter Recovery: Simulate data with known parameters; verify your pipeline can recover them (Heathcote et al., 2015)

See references/fitting-guide.md for detailed guidance on each step.

Interpreting Parameters

Drift Rate (v)

  • Higher v = faster, more accurate decisions
  • Sensitive to: stimulus difficulty, attention, perceptual quality
  • Manipulations that typically affect v: stimulus contrast, coherence (motion dots), word frequency (Ratcliff et al., 2004)
  • If v is near 0 for a condition, participants are essentially guessing

Boundary Separation (a)

  • Higher a = more cautious (slower but more accurate)
  • Sensitive to: speed-accuracy instructions, emphasis conditions
  • Manipulations that typically affect a: speed vs. accuracy instruction (Ratcliff & McKoon, 2008), reward structure
  • If a changes across stimulus conditions (rather than instruction conditions), reconsider the model specification

Non-Decision Time (t0)

  • Reflects encoding + response execution time
  • Sensitive to: stimulus degradation, response modality (key press vs. voice)
  • Manipulations that typically affect t0: stimulus masking, response complexity (Ratcliff & McKoon, 2008)
  • If t0 > 0.5 s, check for unusually slow motor responses or task-specific encoding demands

Starting Point (z)

  • Reflects a priori bias toward one response
  • Sensitive to: prior probability, payoff asymmetry
  • When z = a/2, no bias; z > a/2 = bias toward upper boundary
  • Manipulations that typically affect z: unequal base rates, cue validity (Ratcliff & McKoon, 2008; Voss et al., 2004)

Common Pitfalls

  1. Fitting too many free parameters with too few trials: The full 7-parameter DDM requires >200 trials per condition for stable estimates (Ratcliff & Childers, 2015). With fewer trials, fix variability parameters or use EZ-diffusion.

  2. Ignoring RT outliers: Extremely fast (< 200 ms) or slow (> 3000–5000 ms) RTs likely reflect non-decision processes (guesses, lapses). Include these and they distort parameter estimates (Ratcliff, 1993; Ratcliff & Tuerlinckx, 2002). Apply cutoffs BEFORE fitting.

  3. Not checking parameter recovery: Always simulate data with known parameters using your exact pipeline and verify you can recover them. Poor recovery means your results are uninterpretable (Heathcote et al., 2015; White et al., 2018).

  4. Confusing drift rate and boundary effects: Speed-accuracy tradeoff instructions should primarily affect boundary separation (a), not drift rate (v). If both change, the model may be misspecified or the manipulation has multiple effects (Ratcliff & McKoon, 2008).

  5. Using mean RT instead of full RT distributions: DDMs leverage the shape of the entire RT distribution. Analyzing only mean RT discards the information DDMs are designed to capture (Ratcliff, 1978; Wagenmakers et al., 2007).

  6. Neglecting error RT distributions: Correct and error RT distributions are jointly constrained by the DDM. Fitting only correct RTs loses critical information about the generative process (Ratcliff & McKoon, 2008).

  7. Treating HDDM posterior modes as point estimates: Bayesian models yield posterior distributions. Report and interpret the full posterior, including credible intervals, rather than treating the mode as a frequentist point estimate (Wiecki et al., 2013).

Key References

  • Ratcliff, R. (1978). A theory of memory retrieval. Psychological Review, 85(2), 59–108.
  • Ratcliff, R., & McKoon, G. (2008). The diffusion decision model: Theory and data for two-choice decision tasks. Neural Computation, 20(4), 873–922.
  • Wagenmakers, E.-J., van der Maas, H. L. J., & Grasman, R. P. P. P. (2007). An EZ-diffusion model for response time and accuracy. Psychonomic Bulletin & Review, 14(1), 3–22.
  • Voss, A., Nagler, M., & Lerche, V. (2013). Diffusion models in experimental psychology: A practical introduction. Experimental Psychology, 60(6), 385–402.
  • Wiecki, T. V., Sofer, I., & Frank, M. J. (2013). HDDM: Hierarchical Bayesian estimation of the drift-diffusion model in Python. Frontiers in Neuroinformatics, 7, 14.
  • See references/model-variants.md for DDM family details.
  • See references/fitting-guide.md for the complete fitting workflow.

Meegeleverde bestanden

Zolang de skill geladen is, leest het model deze bestanden als dat nodig is. Het model kan ze alleen lezen; ze worden nooit uitgevoerd.

Veelgestelde vragen

Wat doet de AI-skill Drift Diffusion Model?

Expert guidance on selecting, fitting, and evaluating drift-diffusion models for two-choice response time data in cognitive science

Waarom Drift Diffusion Model gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Drift Diffusion Model bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model. Ook als je midden in een chat van model wisselt, blijft de skill werken. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek af te sluiten. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Drift Diffusion Model in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/NeuroAIHub/BrainPilot/tree/main/packages/skills/skills/03_Cognitive_Psychology/drift-diffusion-model. TypingMind leest het bestand SKILL.md, bundelt de bijbehorende bestanden en installeert het geheel als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Drift Diffusion Model gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Drift Diffusion Model gebruiken?

Zoveel als je wilt. Je kunt Drift Diffusion Model gebruiken met elk model dat skills ondersteunt, zoals GPT, Claude, Gemini, Grok, DeepSeek, Mistral of Llama. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Drift Diffusion Model gratis?

Ja. Deze skill is door NeuroAIHub op GitHub gepubliceerd onder de licentie AGPL-3.0. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. De skill volgt het open Agent Skills-formaat: het bestand SKILL.md bevat de naam en beschrijving van de skill. Daarnaast kan de skill scripts, sjablonen of referentiebestanden bevatten die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇