@brainpilot/skills 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/dist/index.d.ts +6 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +28 -0
  4. package/dist/index.js.map +1 -0
  5. package/package.json +35 -0
  6. package/skills/01_Meta-Skills/contribute-skill/SKILL.md +277 -0
  7. package/skills/01_Meta-Skills/contribute-skills-via-pr/SKILL.md +163 -0
  8. package/skills/01_Meta-Skills/paper-to-skill/SKILL.md +435 -0
  9. package/skills/01_Meta-Skills/paper-to-skill/references/extraction-guide.md +286 -0
  10. package/skills/01_Meta-Skills/paper-to-skill/references/skill-template.md +250 -0
  11. package/skills/01_Meta-Skills/repo-to-skill/SKILL.md +289 -0
  12. package/skills/01_Meta-Skills/share-case/SKILL.md +253 -0
  13. package/skills/01_Meta-Skills/share-usage/README.md +63 -0
  14. package/skills/01_Meta-Skills/share-usage/SKILL.md +395 -0
  15. package/skills/01_Meta-Skills/verify-skill/SKILL.md +331 -0
  16. package/skills/02_Cross-Domain_Foundation/cogsci-power-analysis/SKILL.md +194 -0
  17. package/skills/02_Cross-Domain_Foundation/cogsci-power-analysis/references/effect-sizes.md +352 -0
  18. package/skills/02_Cross-Domain_Foundation/cogsci-power-analysis/references/sample-size-guide.md +407 -0
  19. package/skills/02_Cross-Domain_Foundation/cogsci-statistics/SKILL.md +361 -0
  20. package/skills/02_Cross-Domain_Foundation/cogsci-statistics/references/common-analyses.md +517 -0
  21. package/skills/02_Cross-Domain_Foundation/cogsci-visualization/SKILL.md +292 -0
  22. package/skills/02_Cross-Domain_Foundation/cogsci-visualization/references/plot-recipes.md +709 -0
  23. package/skills/02_Cross-Domain_Foundation/research-literacy/SKILL.md +286 -0
  24. package/skills/02_Cross-Domain_Foundation/research-literacy/references/common-assumptions.md +320 -0
  25. package/skills/02_Cross-Domain_Foundation/research-literacy/references/planning-template.md +143 -0
  26. package/skills/03_Cognitive_Psychology/alternative-uses-task-designer/SKILL.md +197 -0
  27. package/skills/03_Cognitive_Psychology/alternative-uses-task-designer/references/instruction-templates.md +60 -0
  28. package/skills/03_Cognitive_Psychology/cognitive-paradigm-design/SKILL.md +246 -0
  29. package/skills/03_Cognitive_Psychology/cognitive-paradigm-design/references/classic-paradigms.md +435 -0
  30. package/skills/03_Cognitive_Psychology/cognitive-paradigm-design/references/design-principles.md +256 -0
  31. package/skills/03_Cognitive_Psychology/creativity-self-efficacy-mediation/SKILL.md +270 -0
  32. package/skills/03_Cognitive_Psychology/creativity-self-efficacy-mediation/references/lavaan-templates.md +172 -0
  33. package/skills/03_Cognitive_Psychology/divergent-thinking-scoring/SKILL.md +238 -0
  34. package/skills/03_Cognitive_Psychology/divergent-thinking-scoring/references/scoring-rubric.md +143 -0
  35. package/skills/03_Cognitive_Psychology/drift-diffusion-model/SKILL.md +203 -0
  36. package/skills/03_Cognitive_Psychology/drift-diffusion-model/references/fitting-guide.md +571 -0
  37. package/skills/03_Cognitive_Psychology/drift-diffusion-model/references/model-variants.md +427 -0
  38. package/skills/03_Cognitive_Psychology/evidence-accumulation-selector/SKILL.md +310 -0
  39. package/skills/03_Cognitive_Psychology/evidence-accumulation-selector/references/ez-diffusion-formulas.md +137 -0
  40. package/skills/03_Cognitive_Psychology/signal-detection-analysis/SKILL.md +300 -0
  41. package/skills/03_Cognitive_Psychology/signal-detection-analysis/references/application-guide.md +278 -0
  42. package/skills/03_Cognitive_Psychology/signal-detection-analysis/references/sdt-formulas.md +318 -0
  43. package/skills/03_Cognitive_Psychology/visual-search-array-generator/SKILL.md +283 -0
  44. package/skills/03_Cognitive_Psychology/visual-search-array-generator/references/array-generation-parameters.yaml +111 -0
  45. package/skills/04_Psycholinguistics/reading-time-analysis/SKILL.md +301 -0
  46. package/skills/04_Psycholinguistics/reading-time-analysis/references/measure-computation-guide.md +195 -0
  47. package/skills/04_Psycholinguistics/self-paced-reading-designer/SKILL.md +257 -0
  48. package/skills/04_Psycholinguistics/self-paced-reading-designer/references/analysis-guide.md +356 -0
  49. package/skills/04_Psycholinguistics/self-paced-reading-designer/references/region-segmentation.md +266 -0
  50. package/skills/04_Psycholinguistics/sentence-stimulus-norming/SKILL.md +346 -0
  51. package/skills/04_Psycholinguistics/sentence-stimulus-norming/references/lexical-databases-guide.md +184 -0
  52. package/skills/05_EEG_ERP/eeg-paradigm-designer/SKILL.md +226 -0
  53. package/skills/05_EEG_ERP/eeg-paradigm-designer/references/component-paradigm-map.md +276 -0
  54. package/skills/05_EEG_ERP/eeg-paradigm-designer/references/timing-parameters.md +244 -0
  55. package/skills/05_EEG_ERP/eeg-preprocessing-pipeline-guide/SKILL.md +367 -0
  56. package/skills/05_EEG_ERP/eeg-preprocessing-pipeline-guide/references/parameter-lookup-tables.md +138 -0
  57. package/skills/05_EEG_ERP/erp-analysis/SKILL.md +185 -0
  58. package/skills/05_EEG_ERP/erp-analysis/references/erp-components.md +447 -0
  59. package/skills/05_EEG_ERP/erp-analysis/references/preprocessing-pipeline.md +277 -0
  60. package/skills/05_EEG_ERP/erp-analysis/references/statistical-approaches.md +351 -0
  61. package/skills/05_EEG_ERP/mne-python-guide/SKILL.md +174 -0
  62. package/skills/05_EEG_ERP/mne-python-guide/references/decoding.md +178 -0
  63. package/skills/05_EEG_ERP/mne-python-guide/references/io_formats.md +160 -0
  64. package/skills/05_EEG_ERP/mne-python-guide/references/preprocessing.md +259 -0
  65. package/skills/05_EEG_ERP/mne-python-guide/references/simulation.md +173 -0
  66. package/skills/05_EEG_ERP/mne-python-guide/references/source_localization.md +234 -0
  67. package/skills/05_EEG_ERP/mne-python-guide/references/statistics.md +196 -0
  68. package/skills/05_EEG_ERP/mne-python-guide/references/time_frequency.md +165 -0
  69. package/skills/05_EEG_ERP/mne-python-guide/references/visualization.md +175 -0
  70. package/skills/06_fMRI_Neuroimaging/brain-connectivity-modeler/SKILL.md +317 -0
  71. package/skills/06_fMRI_Neuroimaging/brain-connectivity-modeler/references/method-implementation-guide.md +116 -0
  72. package/skills/06_fMRI_Neuroimaging/fmri-glm-analysis-guide/SKILL.md +296 -0
  73. package/skills/06_fMRI_Neuroimaging/fmri-glm-analysis-guide/references/design-matrix-guide.md +214 -0
  74. package/skills/06_fMRI_Neuroimaging/fmri-glm-analysis-guide/references/statistical-inference.md +288 -0
  75. package/skills/06_fMRI_Neuroimaging/fmri-preprocessing-pipeline-guide/SKILL.md +274 -0
  76. package/skills/06_fMRI_Neuroimaging/fmri-preprocessing-pipeline-guide/references/quality-control.md +336 -0
  77. package/skills/06_fMRI_Neuroimaging/fmri-preprocessing-pipeline-guide/references/step-by-step-pipeline.md +380 -0
  78. package/skills/06_fMRI_Neuroimaging/fmri-task-design-guide/SKILL.md +264 -0
  79. package/skills/06_fMRI_Neuroimaging/fmri-task-design-guide/references/design-optimization-examples.md +114 -0
  80. package/skills/06_fMRI_Neuroimaging/neural-decoding-analysis/SKILL.md +273 -0
  81. package/skills/06_fMRI_Neuroimaging/neural-decoding-analysis/references/decoding-methods.md +170 -0
  82. package/skills/06_fMRI_Neuroimaging/neural-decoding-analysis/references/rsa-guide.md +266 -0
  83. package/skills/06_fMRI_Neuroimaging/pycortex-guide/SKILL.md +123 -0
  84. package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/database-subjects.md +179 -0
  85. package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/dataset-types.md +208 -0
  86. package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/freesurfer-fmriprep.md +162 -0
  87. package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/mapping-transforms.md +181 -0
  88. package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/mni-utils.md +207 -0
  89. package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/surface-analysis.md +219 -0
  90. package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/visualization.md +251 -0
  91. package/skills/07_Computational_Modeling/act-r-model-builder/SKILL.md +297 -0
  92. package/skills/07_Computational_Modeling/act-r-model-builder/references/model-patterns.md +197 -0
  93. package/skills/07_Computational_Modeling/act-r-model-builder/references/parameter-table.yaml +204 -0
  94. package/skills/07_Computational_Modeling/bayesian-cognitive-model-builder/SKILL.md +294 -0
  95. package/skills/07_Computational_Modeling/bayesian-cognitive-model-builder/references/diagnostics-checklist.md +351 -0
  96. package/skills/07_Computational_Modeling/bayesian-cognitive-model-builder/references/prior-selection-guide.md +241 -0
  97. package/skills/07_Computational_Modeling/parameter-recovery-checker/SKILL.md +269 -0
  98. package/skills/07_Computational_Modeling/parameter-recovery-checker/references/recovery-diagnostics.md +207 -0
  99. package/skills/08_Computational_Neuroscience/brain-connectivity-modeler/SKILL.md +317 -0
  100. package/skills/08_Computational_Neuroscience/brain-connectivity-modeler/references/method-implementation-guide.md +116 -0
  101. package/skills/08_Computational_Neuroscience/neural-decoding-analysis/SKILL.md +273 -0
  102. package/skills/08_Computational_Neuroscience/neural-decoding-analysis/references/decoding-methods.md +170 -0
  103. package/skills/08_Computational_Neuroscience/neural-decoding-analysis/references/rsa-guide.md +266 -0
  104. package/skills/08_Computational_Neuroscience/neural-population-analysis-guide/SKILL.md +305 -0
  105. package/skills/08_Computational_Neuroscience/neural-population-analysis-guide/references/data-requirements.md +60 -0
  106. package/skills/08_Computational_Neuroscience/neural-population-analysis-guide/references/method-comparison.md +151 -0
  107. package/skills/08_Computational_Neuroscience/spiking-network-model-builder/SKILL.md +376 -0
  108. package/skills/08_Computational_Neuroscience/spiking-network-model-builder/references/hh-parameters.md +117 -0
  109. package/skills/08_Computational_Neuroscience/spiking-network-model-builder/references/network-regimes.md +130 -0
  110. package/skills/09_Cellular_Molecular_Neuroscience/calcium-imaging-analysis-guide/SKILL.md +258 -0
  111. package/skills/09_Cellular_Molecular_Neuroscience/calcium-imaging-analysis-guide/references/indicator-parameters.md +242 -0
  112. package/skills/09_Cellular_Molecular_Neuroscience/calcium-imaging-analysis-guide/references/pipeline-details.md +211 -0
  113. package/skills/09_Cellular_Molecular_Neuroscience/optogenetics-protocol-designer/SKILL.md +261 -0
  114. package/skills/09_Cellular_Molecular_Neuroscience/optogenetics-protocol-designer/references/opsin-catalog.md +124 -0
  115. package/skills/09_Cellular_Molecular_Neuroscience/optogenetics-protocol-designer/references/stimulation-parameters.md +304 -0
  116. package/skills/10_Clinical_Neuropsychology/lesion-symptom-mapping-guide/SKILL.md +367 -0
  117. package/skills/10_Clinical_Neuropsychology/lesion-symptom-mapping-guide/references/disconnection-guide.md +152 -0
  118. package/skills/10_Clinical_Neuropsychology/lesion-symptom-mapping-guide/references/vlsm-pipeline.md +182 -0
  119. package/skills/10_Clinical_Neuropsychology/neuropsych-battery-selector/SKILL.md +250 -0
  120. package/skills/10_Clinical_Neuropsychology/neuropsych-battery-selector/references/deficit-profiles.md +302 -0
  121. package/skills/10_Clinical_Neuropsychology/neuropsych-battery-selector/references/test-catalog.md +304 -0
  122. package/skills/11_Developmental_Cognition/infant-looking-time-designer/SKILL.md +345 -0
  123. package/skills/11_Developmental_Cognition/infant-looking-time-designer/references/age-parameters.yaml +186 -0
  124. package/skills/12_Social_Cognition/tom-task-selector/SKILL.md +379 -0
  125. package/skills/12_Social_Cognition/tom-task-selector/references/task-database.md +317 -0
  126. package/skills/13_Visualization/nature-figure/README.md +442 -0
  127. package/skills/13_Visualization/nature-figure/SKILL.md +60 -0
  128. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-01-bar-charts.png +0 -0
  129. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-02-line-trends.png +0 -0
  130. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-03-heatmaps.png +0 -0
  131. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-04-scatter-bubble.png +0 -0
  132. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-05-radar-polar.png +0 -0
  133. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-06-distributions.png +0 -0
  134. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-07-forest-interval.png +0 -0
  135. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-08-area-stacked.png +0 -0
  136. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-09-image-plates.png +0 -0
  137. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-10-network-matrix.png +0 -0
  138. package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/Dispersion_motivation.png +0 -0
  139. package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/Dispersion_observation.png +0 -0
  140. package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/Dispersion_observation_distillation.png +0 -0
  141. package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_contrastive.png +0 -0
  142. package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_results_CEDAR.png +0 -0
  143. package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_results_IEDB.png +0 -0
  144. package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_schematic.png +0 -0
  145. package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/RNAGenScape_schematic.png +0 -0
  146. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/figures/ablation.png +0 -0
  147. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/figures/comparison.png +0 -0
  148. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/plot_ablation.py +86 -0
  149. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/plot_comparison.py +109 -0
  150. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/diffusion_swiss_roll.py +97 -0
  151. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/diffusion_swiss_roll.png +0 -0
  152. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_GeneRegulatory.pdf +0 -0
  153. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_GeneRegulatory.png +0 -0
  154. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_Trajectory.pdf +0 -0
  155. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_Trajectory.png +0 -0
  156. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/figX_comparison_Ablation.pdf +0 -0
  157. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/figX_comparison_Ablation.png +0 -0
  158. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/plot_comparison_Ablation.py +64 -0
  159. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/plot_comparison_GeneRegulatory.py +74 -0
  160. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/plot_comparison_Trajectory.py +74 -0
  161. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/figures/idea.png +0 -0
  162. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/figures/illustration.png +0 -0
  163. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/plot_idea.py +76 -0
  164. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/plot_illustration.py +404 -0
  165. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_FPGM/figures/freq_prior.png +0 -0
  166. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_FPGM/plot_freq_prior.py +146 -0
  167. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_ablation_Cancer.png +0 -0
  168. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_ablation_IEDB.png +0 -0
  169. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_comparison_Cancer.png +0 -0
  170. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_comparison_IEDB.png +0 -0
  171. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/plot_bars.py +216 -0
  172. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/raw_data.py +125 -0
  173. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/manifold.png +0 -0
  174. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/manifold_holes.png +0 -0
  175. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/results_comparison_optimization.png +0 -0
  176. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/results_comparison_speed.png +0 -0
  177. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/results_sweep.png +0 -0
  178. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_comparison.py +228 -0
  179. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_hole_manifold.py +82 -0
  180. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_manifold.py +61 -0
  181. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_sweep.py +77 -0
  182. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/figures/comparison_posttraining.png +0 -0
  183. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/figures/comparison_radar.png +0 -0
  184. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/plot_comparison_radar.py +173 -0
  185. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/plot_posttraining.py +82 -0
  186. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/brute_force.png +0 -0
  187. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/correctness_by_category.png +0 -0
  188. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/correctness_by_subcategory.png +0 -0
  189. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/rewriting.png +0 -0
  190. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/selfcorrection_math.png +0 -0
  191. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_brute_force.py +248 -0
  192. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_correctness_by_category.py +132 -0
  193. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_correctness_by_subcategory.py +131 -0
  194. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_rewriting.py +105 -0
  195. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_selfcorrection_math.py +99 -0
  196. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/figures/composition_heatmap.png +0 -0
  197. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/figures/trend_by_month.png +0 -0
  198. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/plot_composition.py +81 -0
  199. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/plot_trend.py +125 -0
  200. package/skills/13_Visualization/nature-figure/assets/gallery/fig1-material-mechanism-rich.png +0 -0
  201. package/skills/13_Visualization/nature-figure/assets/gallery/fig2-spatial-imaging-rich.png +0 -0
  202. package/skills/13_Visualization/nature-figure/assets/gallery/fig3-in-vivo-efficacy-rich.png +0 -0
  203. package/skills/13_Visualization/nature-figure/assets/gallery/fig4-single-cell-systems-rich.png +0 -0
  204. package/skills/13_Visualization/nature-figure/assets/gallery/fig5-validation-perturbation-rich.png +0 -0
  205. package/skills/13_Visualization/nature-figure/evals/evals.json +37 -0
  206. package/skills/13_Visualization/nature-figure/manifest.yaml +57 -0
  207. package/skills/13_Visualization/nature-figure/references/api.md +428 -0
  208. package/skills/13_Visualization/nature-figure/references/backend-selection.md +100 -0
  209. package/skills/13_Visualization/nature-figure/references/chart-types.md +281 -0
  210. package/skills/13_Visualization/nature-figure/references/common-patterns.md +350 -0
  211. package/skills/13_Visualization/nature-figure/references/demos.md +65 -0
  212. package/skills/13_Visualization/nature-figure/references/design-theory.md +436 -0
  213. package/skills/13_Visualization/nature-figure/references/figure-contract.md +93 -0
  214. package/skills/13_Visualization/nature-figure/references/nature-2026-observations.md +112 -0
  215. package/skills/13_Visualization/nature-figure/references/qa-contract.md +119 -0
  216. package/skills/13_Visualization/nature-figure/references/r-template-index.md +66 -0
  217. package/skills/13_Visualization/nature-figure/references/r-workflow.md +161 -0
  218. package/skills/13_Visualization/nature-figure/references/tutorials.md +251 -0
  219. package/skills/13_Visualization/nature-figure/static/core/contract.md +29 -0
  220. package/skills/13_Visualization/nature-figure/static/core/stance.md +37 -0
  221. package/skills/13_Visualization/nature-figure/static/fragments/backend/python.md +37 -0
  222. package/skills/13_Visualization/nature-figure/static/fragments/backend/r.md +44 -0
  223. package/skills/14_Writing/markdown-report-writing/SKILL.md +306 -0
  224. package/skills/14_Writing/markdown-report-writing/references/compatibility-matrix.md +72 -0
  225. package/skills/14_Writing/markdown-report-writing/references/templates.md +299 -0
  226. package/skills/15_Others/neuroimaging-power-guide/SKILL.md +324 -0
  227. package/skills/15_Others/neuroimaging-power-guide/references/effect-size-lookup-tables.md +102 -0
  228. package/skills/15_Others/neuroimaging-sample-size-calculator/SKILL.md +330 -0
  229. package/skills/15_Others/neuroimaging-sample-size-calculator/references/worked-examples.md +220 -0
@@ -0,0 +1,571 @@
1
+ # DDM Parameter Fitting Guide
2
+
3
+ A complete workflow for fitting drift-diffusion models to behavioral data, from data preparation through model comparison and diagnostics. All numerical recommendations cite their sources.
4
+
5
+ ---
6
+
7
+ ## Table of Contents
8
+
9
+ 1. [Data Preparation](#1-data-preparation)
10
+ 2. [Model Selection](#2-model-selection)
11
+ 3. [Fitting Methods](#3-fitting-methods)
12
+ 4. [Fitting Tools](#4-fitting-tools)
13
+ 5. [Model Comparison](#5-model-comparison)
14
+ 6. [Parameter Recovery](#6-parameter-recovery)
15
+ 7. [Posterior Predictive Checks](#7-posterior-predictive-checks)
16
+ 8. [Common Pitfalls and Solutions](#8-common-pitfalls-and-solutions)
17
+
18
+ ---
19
+
20
+ ## 1. Data Preparation
21
+
22
+ ### 1.1 Minimum Trial Requirements
23
+
24
+ | Model Variant | Minimum Trials per Condition | Recommended Trials | Source |
25
+ |---------------|------------------------------|--------------------|--------|
26
+ | EZ-diffusion | **20** | **40+** | Wagenmakers et al., 2007, simulation results |
27
+ | Classic DDM (4 parameters) | **40** | **100+** | Ratcliff & Childers, 2015, Table 2 |
28
+ | Full DDM (7 parameters) | **200** | **500+** | Ratcliff & Childers, 2015, Table 4 |
29
+ | HDDM (hierarchical) | **40** per participant | **100+** per participant | Wiecki et al., 2013 |
30
+
31
+ **Critical**: These are per-condition minimums. If you have 3 experimental conditions and want to fit separate drift rates per condition, you need the listed trial count in EACH condition.
32
+
33
+ ### 1.2 Required Data Format
34
+
35
+ Each trial must include:
36
+ - **Response**: Which alternative was chosen (coded as upper/lower boundary or 0/1)
37
+ - **RT**: Reaction time in seconds
38
+ - **Accuracy**: Correct (1) or error (0)
39
+ - **Condition**: Experimental condition label
40
+
41
+ Optional but recommended:
42
+ - **Participant ID**: For hierarchical models
43
+ - **Trial number**: For detecting practice/fatigue effects
44
+
45
+ ### 1.3 RT Distribution Characteristics to Check
46
+
47
+ Before fitting, verify your data has the expected RT distribution properties:
48
+
49
+ 1. **Right-skewed distribution**: RT distributions should be positively skewed. If not, data may contain task noncompliance (Luce, 1986).
50
+ 2. **Leading edge > 0**: The minimum RT should be plausible for the task (typically > **150 ms** for simple tasks; Ratcliff, 1993). Minimum RT estimates non-decision time.
51
+ 3. **Error RT relationship**: Check whether error RTs are faster or slower than correct RTs — this constrains which model variant is appropriate (see model-variants.md, Section 2).
52
+
53
+ ### 1.4 RT Outlier Treatment
54
+
55
+ RT outliers contaminate parameter estimates and must be handled before fitting.
56
+
57
+ #### Absolute Cutoffs
58
+
59
+ | Cutoff | Value | Rationale | Source |
60
+ |--------|-------|-----------|--------|
61
+ | Lower bound | **200 ms** | Below this, responses cannot reflect the decision process (too fast for stimulus encoding) | Ratcliff, 1993; Ratcliff & Tuerlinckx, 2002 |
62
+ | Upper bound (standard) | **3000 ms** | Likely reflects attention lapses or distraction for typical speeded tasks | Ratcliff & Tuerlinckx, 2002 |
63
+ | Upper bound (extended) | **5000 ms** | For more complex tasks (e.g., lexical decision with low-frequency words) | Ratcliff et al., 2004 |
64
+
65
+ #### Relative Cutoffs (Alternative Approach)
66
+
67
+ - Remove RTs > **3 SDs** above the participant's mean (per condition) — common in the literature but less principled than absolute cutoffs (Ratcliff, 1993)
68
+ - Note: SD-based cutoffs are problematic because the SD is inflated by the very outliers you are trying to remove
69
+
70
+ #### Recommended Approach
71
+
72
+ 1. Apply absolute lower cutoff of **200 ms** (Ratcliff & Tuerlinckx, 2002)
73
+ 2. Apply absolute upper cutoff of **3000 ms** for standard speeded tasks, **5000 ms** for tasks with known slow responses (Ratcliff & Tuerlinckx, 2002; Ratcliff et al., 2004)
74
+ 3. Report the proportion of trials removed — should typically be < **5%** of all trials (if higher, investigate task design or participant compliance; Ratcliff & Tuerlinckx, 2002)
75
+ 4. Alternative to hard cutoffs: use a **contaminant process** model that explicitly estimates the proportion of contaminant trials (Ratcliff & Tuerlinckx, 2002, Section 3.4; Hurvich & Tsai, 1989)
76
+
77
+ ### 1.5 Speed-Accuracy Tradeoff Assessment
78
+
79
+ Before fitting, check for speed-accuracy tradeoff confounds:
80
+
81
+ - If participants were not given explicit speed-accuracy instructions, check whether there is a natural tradeoff (faster participants making more errors)
82
+ - If speed-accuracy emphasis was manipulated, this should be modeled by allowing boundary separation (a) to vary across speed/accuracy conditions (Ratcliff & McKoon, 2008)
83
+ - Red flag: if a condition has very high accuracy (> **97%**) with very fast RTs, the condition may be too easy for DDM — the model fits poorly when accuracy is near ceiling (Ratcliff & McKoon, 2008)
84
+
85
+ ### 1.6 Accuracy Rates
86
+
87
+ - DDM is most informative when accuracy is in the range of **70-95%** (Ratcliff & McKoon, 2008)
88
+ - At ceiling accuracy (> **97%**), there are too few errors to constrain the model — consider using EZ-diffusion which does not require error RT information (Wagenmakers et al., 2007)
89
+ - At floor accuracy (< **55%**), participants may not be performing the task — data quality is suspect
90
+
91
+ ---
92
+
93
+ ## 2. Model Selection
94
+
95
+ ### 2.1 Which Parameters Should Vary Across Conditions?
96
+
97
+ The core modeling decision: which DDM parameters are allowed to differ between experimental conditions, and which are fixed across conditions?
98
+
99
+ #### Common Constraint Patterns
100
+
101
+ | Manipulation Type | Typically Varies | Typically Fixed | Source |
102
+ |-------------------|-----------------|-----------------|--------|
103
+ | Stimulus difficulty (e.g., coherence, contrast) | v (drift rate) | a, t0, z | Ratcliff & McKoon, 2008 |
104
+ | Speed-accuracy emphasis | a (boundary separation) | v, t0, z | Ratcliff & McKoon, 2008 |
105
+ | Stimulus degradation (e.g., masking, blur) | t0 (non-decision time), possibly v | a, z | Ratcliff & McKoon, 2008 |
106
+ | Prior probability / cue validity | z (starting point) | v, a, t0 | Ratcliff & McKoon, 2008; Voss et al., 2004 |
107
+ | Response modality | t0 (non-decision time) | v, a, z | Ratcliff & McKoon, 2008 |
108
+
109
+ #### Strategy: Start Simple, Add Complexity
110
+
111
+ 1. Start with the simplest model: only v varies across conditions (all other parameters fixed)
112
+ 2. Add condition-dependent parameters one at a time based on theoretical motivation
113
+ 3. Compare models using BIC/AIC/DIC (see Section 5)
114
+ 4. Prefer the model that achieves adequate fit with fewer free parameters
115
+
116
+ ### 2.2 How Many Free Parameters Can Your Data Support?
117
+
118
+ Rule of thumb: you need at least **10 trials per free parameter** per condition as a bare minimum, and **30+ trials per parameter** is preferred (Voss et al., 2013).
119
+
120
+ Example: Fitting a 4-parameter DDM with 2 conditions where v varies (5 total free parameters: v1, v2, a, t0, z) requires at minimum **50 trials per condition** (10 per parameter), and ideally **150+**.
121
+
122
+ ---
123
+
124
+ ## 3. Fitting Methods
125
+
126
+ ### 3.1 Maximum Likelihood Estimation (MLE)
127
+
128
+ **How it works**: Find parameter values that maximize the probability of observing the data. The likelihood is computed from the first-passage time distribution of the diffusion process (Navarro & Fuss, 2009).
129
+
130
+ | Aspect | Details |
131
+ |--------|---------|
132
+ | **Software** | fast-dm (Voss & Voss, 2007), PyDDM (Shinn et al., 2020) |
133
+ | **Strengths** | Statistically efficient with large samples; well-understood asymptotic properties |
134
+ | **Weaknesses** | Requires large trial counts for stable estimates; sensitive to outliers; likelihood can be numerically unstable for extreme parameters |
135
+ | **Min trials** | **100+** per condition for reliable estimates (Ratcliff & Tuerlinckx, 2002) |
136
+ | **Model comparison** | AIC, BIC |
137
+
138
+ ### 3.2 Chi-Square Fitting
139
+
140
+ **How it works**: Bin RTs into quantiles (e.g., .1, .3, .5, .7, .9 quantiles for correct and error RTs), compute predicted proportions from the model, minimize chi-square discrepancy between observed and predicted bin proportions (Ratcliff & Tuerlinckx, 2002).
141
+
142
+ | Aspect | Details |
143
+ |--------|---------|
144
+ | **Software** | fast-dm (Voss & Voss, 2007), custom implementations |
145
+ | **Strengths** | More robust than MLE with moderate trial counts; less sensitive to extreme individual RTs; well-established in the DDM literature |
146
+ | **Weaknesses** | Requires choice of quantile bins; less statistically efficient than MLE; discards some distributional information through binning |
147
+ | **Min trials** | **40+** per condition (Ratcliff & Tuerlinckx, 2002) |
148
+ | **Model comparison** | Chi-square goodness of fit; AIC/BIC with pseudo-likelihood |
149
+
150
+ **Recommended quantiles**: **.1, .3, .5, .7, .9** for both correct and error RT distributions (Ratcliff & McKoon, 2008). This gives 5 bins x 2 response types = 10 data points per condition to fit.
151
+
152
+ ### 3.3 Quantile Maximum Probability (QMP)
153
+
154
+ **How it works**: Hybrid of quantile-based and likelihood approaches. Compute quantile bins as in chi-square fitting, but maximize the multinomial likelihood of the bin counts (Heathcote et al., 2002).
155
+
156
+ | Aspect | Details |
157
+ |--------|---------|
158
+ | **Software** | DMAT (Vandekerckhove & Tuerlinckx, 2008) |
159
+ | **Strengths** | More robust to outliers than MLE; more efficient than chi-square; handles unequal trial counts well |
160
+ | **Weaknesses** | Less widely used; fewer software implementations |
161
+ | **Min trials** | **40+** per condition (Heathcote et al., 2002) |
162
+ | **Model comparison** | AIC, BIC |
163
+
164
+ ### 3.4 Bayesian Estimation (MCMC)
165
+
166
+ **How it works**: Place prior distributions on parameters, use Markov Chain Monte Carlo (MCMC) to sample from the posterior distribution (Wiecki et al., 2013; Vandekerckhove et al., 2011).
167
+
168
+ | Aspect | Details |
169
+ |--------|---------|
170
+ | **Software** | HDDM (Wiecki et al., 2013), JAGS/Stan custom implementations |
171
+ | **Strengths** | Full posterior distributions; hierarchical modeling; handles small samples via regularization; principled model comparison (Bayes factors, DIC, WAIC) |
172
+ | **Weaknesses** | Computationally expensive; requires convergence diagnostics; prior sensitivity; MCMC can be slow for complex models |
173
+ | **Min trials** | **40+** per condition per person (with hierarchical model; Wiecki et al., 2013) |
174
+ | **Model comparison** | DIC (Spiegelhalter et al., 2002), WAIC (Watanabe, 2010), Bayes factors |
175
+
176
+ ### 3.5 Fitting Method Comparison
177
+
178
+ | Method | Best For | Min Trials | Outlier Robustness | Uncertainty Quantification |
179
+ |--------|----------|------------|--------------------|-----------------------------|
180
+ | MLE | Large datasets, individual-level fitting | **100+** | Low | Asymptotic SEs only |
181
+ | Chi-square | Moderate datasets, classic DDM applications | **40+** | Moderate | Limited |
182
+ | QMP | Moderate datasets, robustness desired | **40+** | High | Limited |
183
+ | Bayesian | Group studies, small-moderate samples, hierarchical models | **40+** (hierarchical) | Moderate (depends on priors) | Full posteriors |
184
+
185
+ **Recommendation**: For most cognitive science applications with **40-200 trials per condition** and a group of participants, hierarchical Bayesian estimation (HDDM) is the recommended approach due to its regularization benefits and natural uncertainty quantification (Wiecki et al., 2013; Vandekerckhove et al., 2011).
186
+
187
+ ---
188
+
189
+ ## 4. Fitting Tools
190
+
191
+ ### 4.1 fast-dm (Voss & Voss, 2007)
192
+
193
+ | Feature | Details |
194
+ |---------|---------|
195
+ | **Language** | C (standalone executable) |
196
+ | **Methods** | MLE, chi-square, Kolmogorov-Smirnov |
197
+ | **Models** | Classic DDM, full DDM (with trial-to-trial variability) |
198
+ | **Strengths** | Very fast; well-validated; supports multiple fitting methods; mature and widely cited |
199
+ | **Limitations** | Command-line only; no hierarchical modeling; limited flexibility for custom models |
200
+ | **URL** | https://www.psychologie.uni-heidelberg.de/ae/meth/fast-dm/ |
201
+ | **Reference** | Voss, A., & Voss, J. (2007). Fast-dm: A free program for efficient diffusion model analysis. *Behavior Research Methods*, 39(4), 767–775. |
202
+
203
+ **Input format**: Text file with one trial per line: RT (in seconds), response (0 or 1), condition.
204
+
205
+ ### 4.2 HDDM (Wiecki et al., 2013)
206
+
207
+ | Feature | Details |
208
+ |---------|---------|
209
+ | **Language** | Python |
210
+ | **Methods** | Bayesian estimation via MCMC (DE-MCMC or No-U-Turn Sampler) |
211
+ | **Models** | Classic DDM, full DDM, stimulus-coding, accuracy-coding, regression models |
212
+ | **Strengths** | Hierarchical modeling; full posterior distributions; regression on parameters (link neural/physiological data to DDM parameters); well-documented |
213
+ | **Limitations** | Slow for large datasets; requires MCMC convergence diagnostics; Python 3 compatibility varies by version |
214
+ | **URL** | https://github.com/hddm-devs/hddm |
215
+ | **Reference** | 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. |
216
+
217
+ **Key usage notes**:
218
+ - Run at least **3 chains** with **5000+ samples** each, discarding the first **1000 as burn-in** (Wiecki et al., 2013, recommended practice)
219
+ - Check R-hat < **1.1** for all parameters (Gelman & Rubin, 1992)
220
+ - Use `hddm.utils.post_pred_gen()` for posterior predictive checks
221
+
222
+ ### 4.3 EZ-Diffusion (Wagenmakers et al., 2007)
223
+
224
+ | Feature | Details |
225
+ |---------|---------|
226
+ | **Language** | Closed-form equations (implementable in any language: R, Python, Excel, MATLAB) |
227
+ | **Methods** | Direct computation from summary statistics |
228
+ | **Models** | Simplified DDM (v, a, t0 only; z = a/2 assumed) |
229
+ | **Strengths** | No fitting needed; instant computation; excellent for exploratory analysis and large-scale individual differences |
230
+ | **Limitations** | Cannot estimate starting point bias or variability parameters; does not use error RT information |
231
+ | **Reference** | 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. |
232
+
233
+ **Equations** (with s = 0.1; Wagenmakers et al., 2007, Equations 1-3):
234
+
235
+ ```
236
+ # Given: Pc (proportion correct), VRT (variance of correct RTs), MRT (mean correct RT)
237
+
238
+ # Step 1: Compute drift rate
239
+ L = logit(Pc) # L = ln(Pc / (1 - Pc))
240
+ sign_v = sign(Pc - 0.5)
241
+ x = L * (L * Pc^2 - L * Pc + Pc - 0.5) / VRT
242
+ v = sign_v * s * x^(1/4) # s = 0.1
243
+
244
+ # Step 2: Compute boundary separation
245
+ a = s^2 * L / v
246
+
247
+ # Step 3: Compute non-decision time
248
+ y = -v * a / s^2
249
+ MDT = (a / (2*v)) * (1 - exp(y)) / (1 + exp(y))
250
+ t0 = MRT - MDT
251
+ ```
252
+
253
+ ### 4.4 PyDDM (Shinn et al., 2020)
254
+
255
+ | Feature | Details |
256
+ |---------|---------|
257
+ | **Language** | Python |
258
+ | **Methods** | MLE via numerical solution of Fokker-Planck equation |
259
+ | **Models** | Highly flexible: custom drift, noise, bound, overlay functions |
260
+ | **Strengths** | Maximum flexibility; supports collapsing bounds, leaky integration, custom noise; good documentation and tutorials |
261
+ | **Limitations** | Slower than fast-dm for standard models; requires more programming expertise; no built-in hierarchical modeling |
262
+ | **URL** | https://pyddm.readthedocs.io/ |
263
+ | **Reference** | Shinn, M., Lam, N. H., & Murray, J. D. (2020). A flexible framework for simulating and fitting generalized drift-diffusion models. *eLife*, 9, e56938. |
264
+
265
+ ### 4.5 Additional Tools
266
+
267
+ | Tool | Language | Key Feature | Reference |
268
+ |------|----------|-------------|-----------|
269
+ | **DMAT** | MATLAB | Multi-model fitting, QMP method | Vandekerckhove & Tuerlinckx, 2008 |
270
+ | **rtdists** (R) | R | RT distribution functions for DDM and LBA | Singmann et al., 2016 |
271
+ | **DMC** (Dynamic Models of Choice) | R | LBA and DDM fitting with comprehensive diagnostics | Heathcote et al., 2019 |
272
+ | **Stan** | Stan/R/Python | Custom Bayesian models; maximum flexibility | Carpenter et al., 2017 |
273
+
274
+ ### 4.6 Tool Selection Guide
275
+
276
+ ```
277
+ What is your primary need?
278
+ ├── Quick analysis, few trials → EZ-diffusion (any language)
279
+ ├── Standard DDM, fast fitting → fast-dm
280
+ ├── Hierarchical / Bayesian → HDDM
281
+ ├── Custom model (collapsing bounds, etc.) → PyDDM
282
+ ├── LBA or multi-accumulator → DMC (R) or rtdists (R)
283
+ └── Full Bayesian flexibility → Stan
284
+ ```
285
+
286
+ ---
287
+
288
+ ## 5. Model Comparison
289
+
290
+ ### 5.1 Information Criteria
291
+
292
+ | Criterion | Formula | Best For | Interpretation | Source |
293
+ |-----------|---------|----------|----------------|--------|
294
+ | AIC | -2 ln(L) + 2k | Prediction; large samples | Lower is better; penalizes complexity linearly | Akaike, 1974 |
295
+ | BIC | -2 ln(L) + k ln(n) | Model selection; penalizes complexity more than AIC | Lower is better; stronger complexity penalty with large n | Schwarz, 1978 |
296
+ | DIC | Bayesian analogue of AIC | Bayesian models | Lower is better; uses effective number of parameters | Spiegelhalter et al., 2002 |
297
+ | WAIC | Bayesian; fully uses posterior | Bayesian models; preferred over DIC | Lower is better; more stable than DIC | Watanabe, 2010 |
298
+
299
+ where L = likelihood, k = number of free parameters, n = number of observations.
300
+
301
+ **Recommendation**: Use BIC for frequentist DDM fits (penalizes overfitting more than AIC; Schwarz, 1978). Use WAIC for Bayesian HDDM fits (more stable than DIC; Watanabe, 2010).
302
+
303
+ ### 5.2 Delta Rules of Thumb
304
+
305
+ | Delta | Interpretation | Source |
306
+ |-------|----------------|--------|
307
+ | delta BIC < 2 | Negligible difference | Raftery, 1995 |
308
+ | delta BIC 2-6 | Positive evidence for better model | Raftery, 1995 |
309
+ | delta BIC 6-10 | Strong evidence | Raftery, 1995 |
310
+ | delta BIC > 10 | Very strong evidence | Raftery, 1995 |
311
+
312
+ **Note**: These guidelines were developed by Raftery (1995) for BIC specifically. Similar scales exist for AIC (Burnham & Anderson, 2002), but direct comparison requires the same criterion.
313
+
314
+ ### 5.3 Model Comparison Strategy
315
+
316
+ 1. **Define candidate models**: List all theoretically motivated models (e.g., v varies vs. v and a vary across conditions)
317
+ 2. **Fit all models** to the same data with the same method
318
+ 3. **Compute information criterion** (BIC or WAIC) for each model
319
+ 4. **Compute summed/group BIC**: Sum individual BIC values across participants (Stephan et al., 2009)
320
+ 5. **Check fit quality**: The winning model should also provide adequate absolute fit (see Section 7)
321
+ 6. **Sensitivity analysis**: Check whether the winning model is consistent across fitting methods (e.g., MLE and Bayesian give similar conclusions)
322
+
323
+ ### 5.4 Nested Model Testing
324
+
325
+ For nested models (e.g., classic DDM nested within full DDM), you can also use:
326
+
327
+ - **Likelihood ratio test**: chi-square = -2 × (ln L_simple - ln L_complex), df = difference in parameters. Valid for MLE with large samples (Ratcliff & Tuerlinckx, 2002).
328
+ - **Bayes factor**: Ratio of marginal likelihoods. Interpretation: BF > **3** is "moderate evidence," BF > **10** is "strong evidence" (Kass & Raftery, 1995).
329
+
330
+ ---
331
+
332
+ ## 6. Parameter Recovery
333
+
334
+ ### 6.1 Why Parameter Recovery Is Essential
335
+
336
+ Parameter recovery verifies that your fitting pipeline (data structure, fitting method, software settings) can accurately estimate parameters from simulated data with known ground truth. Without this validation, your empirical results may be uninterpretable (Heathcote et al., 2015; White et al., 2018).
337
+
338
+ ### 6.2 Parameter Recovery Procedure
339
+
340
+ 1. **Choose plausible generating parameters**: Use values from the literature or from a preliminary fit to your data
341
+ - v: **0.5, 1.0, 2.0, 3.0** (spanning easy to hard conditions; Ratcliff & McKoon, 2008)
342
+ - a: **0.8, 1.2, 1.6, 2.0** (spanning liberal to conservative criteria)
343
+ - t0: **0.2, 0.3, 0.4, 0.5** (spanning fast to slow encoding)
344
+ - z: **a/2** (unbiased) or **0.4a, 0.6a** (biased)
345
+
346
+ 2. **Simulate datasets**: For each parameter combination, simulate **100+ datasets** with the same trial count and condition structure as your empirical data (White et al., 2018)
347
+
348
+ 3. **Fit the model** to each simulated dataset using the exact same pipeline as for real data
349
+
350
+ 4. **Evaluate recovery**:
351
+ - **Correlation**: r between true and recovered parameters should be > **0.8** (White et al., 2018, benchmark)
352
+ - **Bias**: Mean (recovered - true) should be near 0
353
+ - **Coverage**: 95% CIs should contain the true value approximately **95%** of the time
354
+ - **Scatter plots**: Plot true vs. recovered for each parameter
355
+
356
+ ### 6.3 What to Do If Recovery Fails
357
+
358
+ | Symptom | Likely Cause | Solution |
359
+ |---------|-------------|----------|
360
+ | Recovered parameters are biased | Too few trials | Increase trial count or simplify the model |
361
+ | Wide recovery variability | Too few trials or too many free parameters | Reduce free parameters; use HDDM for regularization |
362
+ | sv, sz, st0 poorly recovered | These parameters require the most data | Fix variability parameters you do not need; use > **200 trials per condition** (Ratcliff & Childers, 2015) |
363
+ | Correlations between recovered parameters | Trade-offs between parameters (e.g., a and t0) | Reparameterize or fix one parameter; check identifiability |
364
+ | t0 recovered as negative | Model misspecification or outlier contamination | Check RT cutoffs; verify lower RT bound > estimated t0 |
365
+
366
+ ### 6.4 Selective Influence Validation
367
+
368
+ A stronger form of recovery: simulate data where only ONE parameter changes across conditions. Verify that the fitting pipeline correctly identifies which parameter changed (Ratcliff & McKoon, 2008; White et al., 2018).
369
+
370
+ Example: Simulate two conditions that differ only in drift rate (v1 = 1.0, v2 = 2.0, all other parameters shared). After fitting, verify that only v differs significantly across conditions.
371
+
372
+ ---
373
+
374
+ ## 7. Posterior Predictive Checks
375
+
376
+ ### 7.1 Purpose
377
+
378
+ Even if a model wins by BIC/WAIC, it might fit the data poorly in absolute terms. Posterior predictive checks compare the model's predictions to the observed data to verify adequate fit (Gelman et al., 2013; Ratcliff & McKoon, 2008).
379
+
380
+ ### 7.2 RT Quantile Comparison
381
+
382
+ The standard visualization in the DDM literature (Ratcliff & McKoon, 2008, Figure 2):
383
+
384
+ 1. **Compute observed RT quantiles**: Calculate the .1, .3, .5, .7, .9 quantiles of correct and error RT distributions for each condition
385
+ 2. **Simulate from the model**: Using fitted parameters, generate many simulated datasets (e.g., **500 simulations**; Wiecki et al., 2013)
386
+ 3. **Compute predicted quantiles**: From the simulated data
387
+ 4. **Plot**: Observed quantiles (points) vs. predicted quantiles (lines or confidence bands)
388
+ 5. **Evaluate**: Predicted quantiles should fall close to observed. Systematic deviations indicate model misfit.
389
+
390
+ ### 7.3 What to Look For
391
+
392
+ | Pattern | Interpretation | Action |
393
+ |---------|----------------|--------|
394
+ | Good fit across all quantiles and conditions | Model is adequate | Proceed with interpretation |
395
+ | Poor fit to slow RT tail (.9 quantile) | Contaminant slow responses or model cannot capture slow decisions | Add contaminant process; check for attention lapses; consider collapsing bounds |
396
+ | Poor fit to fast RT leading edge (.1 quantile) | Non-decision time misspecified | Allow t0 variability (st0) |
397
+ | Poor fit to error RTs specifically | Model cannot capture error RT pattern | Add trial-to-trial variability in drift rate (sv) or starting point (sz) |
398
+ | Predicted accuracy does not match observed | Drift rate or boundary misestimated | Check for speed-accuracy tradeoff confounds; reconsider constraint pattern |
399
+
400
+ ### 7.4 Quantitative Fit Statistics
401
+
402
+ - **Chi-square goodness of fit**: Compare observed vs. predicted quantile bin counts. Non-significant chi-square indicates adequate fit (Ratcliff & McKoon, 2008).
403
+ - **Posterior predictive p-values**: For Bayesian models, compute the proportion of posterior predictions that fall within the observed data range. Values near **0.5** indicate good fit; values near 0 or 1 indicate misfit (Gelman et al., 2013).
404
+
405
+ ---
406
+
407
+ ## 8. Common Pitfalls and Solutions
408
+
409
+ ### 8.1 Data-Related Pitfalls
410
+
411
+ #### Pitfall 1: Not Removing Fast Guesses
412
+
413
+ **Problem**: RTs < **200 ms** likely reflect anticipatory responses or button-press errors, not the decision process (Ratcliff, 1993).
414
+
415
+ **Solution**: Remove RTs below **200 ms** before fitting. If removing a large proportion (> **5%**), investigate task design or participant compliance (Ratcliff & Tuerlinckx, 2002).
416
+
417
+ #### Pitfall 2: Including Attention Lapses
418
+
419
+ **Problem**: Very slow RTs (> **3000-5000 ms**) likely reflect attention lapses, not the diffusion process. These distort the slow tail of the RT distribution and inflate non-decision time or drift rate variability estimates (Ratcliff & Tuerlinckx, 2002).
420
+
421
+ **Solution**: Apply an upper RT cutoff of **3000 ms** for standard tasks or **5000 ms** for complex tasks (Ratcliff & Tuerlinckx, 2002; Ratcliff et al., 2004). Alternatively, include a contaminant process in the model (see Pitfall 7).
422
+
423
+ #### Pitfall 3: Ceiling or Floor Accuracy
424
+
425
+ **Problem**: When accuracy is near ceiling (> **97%**) or floor (< **55%**), there are too few errors (or correct responses) to constrain the model. The DDM jointly models correct and error RT distributions; without sufficient data in both, parameter estimates are unreliable (Ratcliff & McKoon, 2008).
426
+
427
+ **Solution**: For ceiling accuracy, use EZ-diffusion (which only requires correct RT statistics; Wagenmakers et al., 2007). For floor accuracy, investigate whether participants are performing the task at all.
428
+
429
+ ### 8.2 Model Specification Pitfalls
430
+
431
+ #### Pitfall 4: Fitting Too Many Parameters
432
+
433
+ **Problem**: With 7 free parameters (full DDM), moderate trial counts produce unstable estimates. Trial-to-trial variability parameters (sv, sz, st0) are particularly difficult to estimate and can trade off with each other (Boehm et al., 2018).
434
+
435
+ **Solution**: Follow the guideline: approximately **10 trials per free parameter** as a minimum, **30+ preferred** (Voss et al., 2013). With < **200 trials per condition**, consider fixing variability parameters. Priority order for fixing: sz first, then st0, keep sv if possible (Ratcliff & Childers, 2015; Boehm et al., 2018).
436
+
437
+ #### Pitfall 5: Wrong Parameter Constraints Across Conditions
438
+
439
+ **Problem**: Allowing too many parameters to vary across conditions overfits; constraining too many masks real effects.
440
+
441
+ **Solution**: Let theory guide which parameters vary. Use the table in Section 2.1. Start simple, add complexity based on model comparison. Critical: speed-accuracy instructions should affect a, NOT v (Ratcliff & McKoon, 2008). Stimulus difficulty should affect v, NOT a.
442
+
443
+ #### Pitfall 6: Ignoring Response Coding
444
+
445
+ **Problem**: DDMs require coding responses as "upper boundary" vs. "lower boundary." Incorrect coding (e.g., coding by response key rather than by stimulus-response mapping) produces nonsensical drift rate estimates.
446
+
447
+ **Solution**: Two coding schemes:
448
+ - **Stimulus coding**: Upper boundary = response to stimulus A, lower boundary = response to stimulus B. Drift rate sign indicates which stimulus was presented. Standard for perceptual discrimination tasks (Ratcliff & McKoon, 2008).
449
+ - **Accuracy coding**: Upper boundary = correct response, lower boundary = error. Drift rate is always positive. Standard in HDDM (Wiecki et al., 2013).
450
+
451
+ Choose one scheme and be consistent. HDDM default is accuracy coding.
452
+
453
+ ### 8.3 Fitting and Evaluation Pitfalls
454
+
455
+ #### Pitfall 7: Not Modeling Contaminant Processes
456
+
457
+ **Problem**: Even after RT cutoffs, some trials may reflect processes other than the decision (e.g., accidental key presses, motor errors). These contaminate parameter estimates (Ratcliff & Tuerlinckx, 2002).
458
+
459
+ **Solution**: Include a contaminant process in the model. The standard approach adds a uniform distribution over the RT range with probability p_contaminant (typically **1-5%** of trials; Ratcliff & Tuerlinckx, 2002, Section 3.4). Available in fast-dm and HDDM.
460
+
461
+ #### Pitfall 8: Not Running Multiple Starting Points (MLE)
462
+
463
+ **Problem**: The DDM likelihood surface can have local optima. A single optimization run may converge to a local minimum rather than the global MLE (Voss et al., 2013).
464
+
465
+ **Solution**: Run the optimizer from **5-10 different starting points** and select the result with the highest likelihood (Voss et al., 2013). fast-dm does this automatically.
466
+
467
+ #### Pitfall 9: Ignoring MCMC Convergence (Bayesian)
468
+
469
+ **Problem**: MCMC chains that have not converged produce unreliable posterior estimates. Common with complex models or poor priors.
470
+
471
+ **Solution**:
472
+ - Run at least **3 independent chains** (Wiecki et al., 2013)
473
+ - Check R-hat < **1.1** for ALL parameters (Gelman & Rubin, 1992)
474
+ - Verify effective sample size > **200** (Wiecki et al., 2013)
475
+ - Visually inspect trace plots for mixing
476
+ - Increase burn-in or total samples if convergence is poor
477
+
478
+ #### Pitfall 10: Skipping Parameter Recovery
479
+
480
+ **Problem**: Without parameter recovery validation, you cannot know whether your pipeline produces reliable estimates for your specific data structure (Heathcote et al., 2015; White et al., 2018).
481
+
482
+ **Solution**: Always run parameter recovery before interpreting empirical results. Simulate data with known parameters using YOUR exact pipeline (same trial counts, same conditions, same fitting method, same software). This is a mandatory validation step, not optional (White et al., 2018).
483
+
484
+ ---
485
+
486
+ ## Complete Fitting Workflow Checklist
487
+
488
+ ```
489
+ [ ] 1. DATA PREPARATION
490
+ [ ] Format data: RT (seconds), response, accuracy, condition, participant
491
+ [ ] Apply RT cutoffs: remove < 200 ms and > 3000-5000 ms
492
+ [ ] Report proportion of trials removed (should be < 5%)
493
+ [ ] Check RT distributions: right-skewed? Plausible leading edge?
494
+ [ ] Check accuracy: 70-95% range for DDM applicability?
495
+ [ ] Check error RT pattern: faster or slower than correct RTs?
496
+
497
+ [ ] 2. MODEL SELECTION
498
+ [ ] Define candidate models (which parameters vary across conditions?)
499
+ [ ] Verify trial count supports the number of free parameters
500
+ [ ] Choose model variant (EZ, classic, full, hierarchical)
501
+
502
+ [ ] 3. PARAMETER RECOVERY
503
+ [ ] Select generating parameters (use literature or preliminary fits)
504
+ [ ] Simulate 100+ datasets with your empirical data structure
505
+ [ ] Fit all simulated datasets with your exact pipeline
506
+ [ ] Verify: r > 0.8, minimal bias, adequate coverage
507
+
508
+ [ ] 4. FIT EMPIRICAL DATA
509
+ [ ] Fit all candidate models
510
+ [ ] For MLE: use 5-10 starting points
511
+ [ ] For Bayesian: run 3+ chains, 5000+ samples, 1000+ burn-in
512
+
513
+ [ ] 5. CONVERGENCE CHECK
514
+ [ ] MLE: verify optimizer converged (check gradient, Hessian)
515
+ [ ] Bayesian: R-hat < 1.1, effective n > 200, good trace plots
516
+
517
+ [ ] 6. MODEL COMPARISON
518
+ [ ] Compute BIC (frequentist) or WAIC/DIC (Bayesian)
519
+ [ ] Select winning model
520
+ [ ] Verify winning model also has adequate absolute fit
521
+
522
+ [ ] 7. POSTERIOR PREDICTIVE CHECK
523
+ [ ] Simulate from fitted model (500+ datasets)
524
+ [ ] Compare predicted vs. observed RT quantiles (.1, .3, .5, .7, .9)
525
+ [ ] Check correct and error RT distributions separately
526
+ [ ] Check predicted vs. observed accuracy
527
+
528
+ [ ] 8. REPORT RESULTS
529
+ [ ] Report all parameter estimates with uncertainty (SEs or CIs)
530
+ [ ] Report model comparison statistics (BIC/WAIC)
531
+ [ ] Include posterior predictive check figures
532
+ [ ] Report RT cutoffs, trial counts, and proportion removed
533
+ [ ] Report parameter recovery results
534
+ ```
535
+
536
+ ---
537
+
538
+ ## References
539
+
540
+ - Akaike, H. (1974). A new look at the statistical model identification. *IEEE Transactions on Automatic Control*, 19(6), 716–723.
541
+ - Boehm, U., Annis, J., Frank, M. J., Hawkins, G. E., Heathcote, A., Kellen, D., ... & Wagenmakers, E.-J. (2018). Estimating across-trial variability parameters of the diffusion decision model: Expert advice and recommendations. *Journal of Mathematical Psychology*, 87, 46–75.
542
+ - Burnham, K. P., & Anderson, D. R. (2002). *Model selection and multimodel inference: A practical information-theoretic approach* (2nd ed.). Springer.
543
+ - Carpenter, B., Gelman, A., Hoffman, M. D., Lee, D., Goodrich, B., Betancourt, M., ... & Riddell, A. (2017). Stan: A probabilistic programming language. *Journal of Statistical Software*, 76(1), 1–32.
544
+ - Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., & Rubin, D. B. (2013). *Bayesian data analysis* (3rd ed.). CRC Press.
545
+ - Gelman, A., & Rubin, D. B. (1992). Inference from iterative simulation using multiple sequences. *Statistical Science*, 7(4), 457–472.
546
+ - Heathcote, A., Brown, S., & Mewhort, D. J. K. (2002). Quantile maximum probability as a method for response time distributions. *Psychonomic Bulletin & Review*, 9(2), 394–401.
547
+ - Heathcote, A., Brown, S. D., & Wagenmakers, E.-J. (2015). An introduction to good practices in cognitive modeling. In B. U. Forstmann & E.-J. Wagenmakers (Eds.), *An introduction to model-based cognitive neuroscience*. Springer.
548
+ - Heathcote, A., Lin, Y., Reynolds, A., Strickland, L., Gretton, M., & Matzke, D. (2019). Dynamic models of choice. *Behavior Research Methods*, 51(2), 961–985.
549
+ - Kass, R. E., & Raftery, A. E. (1995). Bayes factors. *Journal of the American Statistical Association*, 90(430), 773–795.
550
+ - Luce, R. D. (1986). *Response times: Their role in inferring elementary mental organization*. Oxford University Press.
551
+ - Matzke, D., & Wagenmakers, E.-J. (2009). Psychological interpretation of the ex-Gaussian and shifted Wald parameters: A diffusion model analysis. *Psychonomic Bulletin & Review*, 16(5), 798–817.
552
+ - Navarro, D. J., & Fuss, I. G. (2009). Fast and accurate calculations for first-passage times in Wiener diffusion models. *Journal of Mathematical Psychology*, 53(4), 222–230.
553
+ - Raftery, A. E. (1995). Bayesian model selection in social research. *Sociological Methodology*, 25, 111–163.
554
+ - Ratcliff, R. (1993). Methods for dealing with reaction time outliers. *Psychological Bulletin*, 114(3), 510–532.
555
+ - Ratcliff, R., & Childers, R. (2015). Individual differences and fitting methods for the two-choice diffusion model of decision making. *Decision*, 2(4), 237–279.
556
+ - Ratcliff, R., Gomez, P., & McKoon, G. (2004). A diffusion model account of the lexical decision task. *Psychological Review*, 111(1), 159–182.
557
+ - Ratcliff, R., & McKoon, G. (2008). The diffusion decision model: Theory and data for two-choice decision tasks. *Neural Computation*, 20(4), 873–922.
558
+ - Ratcliff, R., & Tuerlinckx, F. (2002). Estimating parameters of the diffusion model: Approaches to dealing with contaminant reaction times and parameter variability. *Psychonomic Bulletin & Review*, 9(3), 438–481.
559
+ - Schwarz, G. (1978). Estimating the dimension of a model. *The Annals of Statistics*, 6(2), 461–464.
560
+ - Shinn, M., Lam, N. H., & Murray, J. D. (2020). A flexible framework for simulating and fitting generalized drift-diffusion models. *eLife*, 9, e56938.
561
+ - Singmann, H., Brown, S., Gretton, M., & Heathcote, A. (2016). rtdists: Response time distributions. R package.
562
+ - Spiegelhalter, D. J., Best, N. G., Carlin, B. P., & van der Linde, A. (2002). Bayesian measures of model complexity and fit. *Journal of the Royal Statistical Society: Series B*, 64(4), 583–639.
563
+ - Stephan, K. E., Penny, W. D., Daunizeau, J., Moran, R. J., & Friston, K. J. (2009). Bayesian model selection for group studies. *NeuroImage*, 46(4), 1004–1017.
564
+ - Vandekerckhove, J., & Tuerlinckx, F. (2008). Fitting and testing the diffusion model using DMAT. *Behavior Research Methods*, 40(2), 571–582.
565
+ - Vandekerckhove, J., Tuerlinckx, F., & Lee, M. D. (2011). Hierarchical diffusion models for two-choice response times. *Psychological Methods*, 16(1), 44–62.
566
+ - Voss, A., Nagler, M., & Lerche, V. (2013). Diffusion models in experimental psychology: A practical introduction. *Experimental Psychology*, 60(6), 385–402.
567
+ - Voss, A., & Voss, J. (2007). Fast-dm: A free program for efficient diffusion model analysis. *Behavior Research Methods*, 39(4), 767–775.
568
+ - 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.
569
+ - Watanabe, S. (2010). Asymptotic equivalence of Bayes cross validation and widely applicable information criterion in singular learning theory. *Journal of Machine Learning Research*, 11, 3571–3594.
570
+ - White, C. N., Servant, M., & Logan, G. D. (2018). Testing the validity of conflict drift-diffusion models for use in estimating cognitive processes: A parameter-recovery study. *Psychonomic Bulletin & Review*, 25(1), 286–301.
571
+ - 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.