#!/usr/bin/env python # coding: utf-8 # # Bayesian Cognitive Modeling in PyMC3 # PyMC3 port of Lee and Wagenmakers' [Bayesian Cognitive Modeling - A Practical Course](http://bayesmodels.com) # # All the codes are in jupyter notebook with the model explain in distributions (as in the book). Background information of the models please consult the book. You can also compare the result with the original code associated with the book ([WinBUGS and JAGS](https://webfiles.uci.edu/mdlee/Code.zip); [Stan](https://github.com/stan-dev/example-models/tree/master/Bayesian_Cognitive_Modeling)) # # _All the codes are currently tested under PyMC3 v3.2 with theano 0.10.0.dev_ # ## Part II - PARAMETER ESTIMATION # # ### [Chapter 3: Inferences with binomials](./ParameterEstimation/Binomial.ipynb) # [3.1 Inferring a rate](./ParameterEstimation/Binomial.ipynb#3.1-Inferring-a-rate) # [3.2 Difference between two rates](./ParameterEstimation/Binomial.ipynb#3.2-Difference-between-two-rates) # [3.3 Inferring a common rate](./ParameterEstimation/Binomial.ipynb#3.3-Inferring-a-common-rate) # [3.4 Prior and posterior prediction](./ParameterEstimation/Binomial.ipynb#3.4-Prior-and-posterior-prediction) # [3.5 Posterior prediction](./ParameterEstimation/Binomial.ipynb#3.5-Posterior-Predictive) # [3.6 Joint distributions](./ParameterEstimation/Binomial.ipynb#3.6-Joint-distributions) # # ### [Chapter 4: Inferences with Gaussians](./ParameterEstimation/Gaussian.ipynb) # [4.1 Inferring a mean and standard deviation](./ParameterEstimation/Gaussian.ipynb#4.1-Inferring-a-mean-and-standard-deviation) # [4.2 The seven scientists](./ParameterEstimation/Gaussian.ipynb#4.2-The-seven-scientists) # [4.3 Repeated measurement of IQ](./ParameterEstimation/Gaussian.ipynb#4.3-Repeated-measurement-of-IQ) # # ### [Chapter 5: Some examples of data analysis](./ParameterEstimation/DataAnalysis.ipynb) # [5.1 Pearson correlation](./ParameterEstimation/DataAnalysis.ipynb#5.1-Pearson-correlation) # [5.2 Pearson correlation with uncertainty](./ParameterEstimation/DataAnalysis.ipynb#5.2-Pearson-correlation-with-uncertainty) # [5.3 The kappa coefficient of agreement](./ParameterEstimation/DataAnalysis.ipynb#5.3-The-kappa-coefficient-of-agreement) # [5.4 Change detection in time series data](./ParameterEstimation/DataAnalysis.ipynb#5.4-Change-detection-in-time-series-data) # [5.5 Censored data](./ParameterEstimation/DataAnalysis.ipynb#5.5-Censored-data) # [5.6 Recapturing planes](./ParameterEstimation/DataAnalysis.ipynb#5.6-Recapturing-planes) # # ### [Chapter 6: Latent-mixture models](./ParameterEstimation/Latent-mixtureModels.ipynb) # [6.1 Exam scores](./ParameterEstimation/Latent-mixtureModels.ipynb#6.1-Exam-scores) # [6.2 Exam scores with individual differences](./ParameterEstimation/Latent-mixtureModels.ipynb#6.2-Exam-scores-with-individual-differences) # [6.3 Twenty questions](./ParameterEstimation/Latent-mixtureModels.ipynb#6.3-Twenty-questions) # [6.4 The two-country quiz](./ParameterEstimation/Latent-mixtureModels.ipynb#6.4-The-two-country-quiz) # [6.5 Assessment of malingering](./ParameterEstimation/Latent-mixtureModels.ipynb#6.5-Assessment-of-malingering) # [6.6 Individual differences in malingering](./ParameterEstimation/Latent-mixtureModels.ipynb#6.6-Individual-differences-in-malingering) # [6.7 Alzheimer’s recall test cheating](./ParameterEstimation/Latent-mixtureModels.ipynb#6.7-Alzheimer's-recall-test-cheating) # ## Part III - MODEL SELECTION # # ### [Chapter 8: Comparing Gaussian means](./ModelSelection/ComparingGaussianMeans.ipynb) # [8.1 One-sample comparison](./ModelSelection/ComparingGaussianMeans.ipynb#8.1-One-sample-comparison) # [8.2 Order-restricted one-sample comparison](./ModelSelection/ComparingGaussianMeans.ipynb#8.2-Order-restricted-one-sample-comparison) # [8.3 Two-sample comparison](./ModelSelection/ComparingGaussianMeans.ipynb#8.3-Two-sample-comparison) # # ### [Chapter 9: Comparing binomial rates](./ModelSelection/ComparingBinomialRates.ipynb) # [9.1 Equality of proportions](./ModelSelection/ComparingBinomialRates.ipynb#9.1-Equality-of-proportions) # [9.2 Order-restricted equality of proportions](./ModelSelection/ComparingBinomialRates.ipynb#9.2-Order-restricted-equality-of-proportions) # [9.3 Comparing within-subject proportions](./ModelSelection/ComparingBinomialRates.ipynb#9.3-Comparing-within-subject-proportions) # [9.4 Comparing between-subject proportions](./ModelSelection/ComparingBinomialRates.ipynb#9.4-Comparing-between-subject-proportions) # [9.5 Order-restricted between-subjects comparison](./ModelSelection/ComparingBinomialRates.ipynb#9.5-Order-restricted-between-subject-proportions) # ## Part IV - CASE STUDIES # # ### [Chapter 10: Memory retention](./CaseStudies/MemoryRetention.ipynb) # [10.1 No individual differences](./CaseStudies/MemoryRetention.ipynb#10.1-No-individual-differences) # [10.2 Full individual differences](./CaseStudies/MemoryRetention.ipynb#10.2-Full-individual-differences) # [10.3 Structured individual differences](./CaseStudies/MemoryRetention.ipynb#10.3-Structured-individual-differences) # # ### [Chapter 11: Signal detection theory](./CaseStudies/SignalDetectionTheory.ipynb) # [11.1 Signal detection theory](./CaseStudies/SignalDetectionTheory.ipynb#11.1-Signal-detection-theory) # [11.2 Hierarchical signal detection theory](./CaseStudies/SignalDetectionTheory.ipynb#11.2-Hierarchical-signal-detection-theory) # [11.3 Parameter expansion](./CaseStudies/SignalDetectionTheory.ipynb#11.3-Parameter-expansion) # # ### [Chapter 12: Psychophysical functions](./CaseStudies/PsychophysicalFunctions.ipynb) # [12.1 Psychophysical functions](./CaseStudies/PsychophysicalFunctions.ipynb#12.1-Psychophysical-functions) # [12.2 Psychophysical functions under contamination](./CaseStudies/PsychophysicalFunctions.ipynb#12.2-Psychophysical-functions-under-contamination) # # ### [Chapter 13: Extrasensory perception](./CaseStudies/ExtrasensoryPerception.ipynb) # [13.1 Evidence for optional stopping](./CaseStudies/ExtrasensoryPerception.ipynb#13.1-Evidence-for-optional-stopping) # [13.2 Evidence for differences in ability](./CaseStudies/ExtrasensoryPerception.ipynb#13.2-Evidence-for-differences-in-ability) # [13.3 Evidence for the impact of extraversion](./CaseStudies/ExtrasensoryPerception.ipynb#13.3-Evidence-for-the-impact-of-extraversion) # # ### [Chapter 14: Multinomial processing trees](./CaseStudies/MultinomialProcessingTrees.ipynb) # [14.1 Multinomial processing model of pair-clustering](./CaseStudies/MultinomialProcessingTrees.ipynb#14.1-Multinomial-processing-model-of-pair-clustering) # [14.2 Latent-trait MPT model](./CaseStudies/MultinomialProcessingTrees.ipynb#14.2-Latent-trait-MPT-model) # # ### [Chapter 15: The SIMPLE model of memory](./CaseStudies/TheSIMPLEModelofMemory.ipynb) # [15.1 The SIMPLE model](./CaseStudies/TheSIMPLEModelofMemory.ipynb#15.1-The-SIMPLE-model) # [15.2 A hierarchical extension of SIMPLE](./CaseStudies/TheSIMPLEModelofMemory.ipynb#15.2-A-hierarchical-extension-of-SIMPLE) # # ### [Chapter 16: The BART model of risk taking](./CaseStudies/TheBARTModelofRiskTaking.ipynb) # [16.1 The BART model](./CaseStudies/TheBARTModelofRiskTaking.ipynb#16.1-The-BART-model) # [16.2 A hierarchical extension of the BART model](./CaseStudies/TheBARTModelofRiskTaking.ipynb#16.2-A-hierarchical-extension-of-the-BART-model) # # ### [Chapter 17: The GCM model of categorization](./CaseStudies/TheGCMModelofCategorization.ipynb) # [17.1 The GCM model](./CaseStudies/TheGCMModelofCategorization.ipynb#17.1-The-GCM-model) # [17.2 Individual differences in the GCM](./CaseStudies/TheGCMModelofCategorization.ipynb#17.2-Individual-differences-in-the-GCM) # [17.3 Latent groups in the GCM](./CaseStudies/TheGCMModelofCategorization.ipynb#17.3-Latent-groups-in-the-GCM) # # ### [Chapter 18: Heuristic decision-making](./CaseStudies/HeuristicDecisionMaking.ipynb) # [18.1 Take-the-best](./CaseStudies/HeuristicDecisionMaking.ipynb#18.1-Take-the-best) # [18.2 Stopping](./CaseStudies/HeuristicDecisionMaking.ipynb#18.2-Stopping) # [18.3 Searching](./CaseStudies/HeuristicDecisionMaking.ipynb#18.3-Searching) # [18.4 Searching and stopping](./CaseStudies/HeuristicDecisionMaking.ipynb#18.4-Searching-and-stopping) # # ### [Chapter 19: Number concept development](./CaseStudies/NumberConceptDevelopment.ipynb) # [19.1 Knower-level model for Give-N](./CaseStudies/NumberConceptDevelopment.ipynb#19.1-Knower-level-model-for-Give-N) # [19.2 Knower-level model for Fast-Cards](./CaseStudies/NumberConceptDevelopment.ipynb#19.2-Knower-level-model-for-Fast-Cards) # [19.3 Knower-level model for Give-N and Fast-Cards](./CaseStudies/NumberConceptDevelopment.ipynb#19.3-Knower-level-model-for-Give-N-and-Fast-Cards) # In[1]: # Python Environment and library version get_ipython().run_line_magic('load_ext', 'watermark') get_ipython().run_line_magic('watermark', '-v -m -p pymc3,theano,scipy,numpy,pandas,matplotlib,seaborn')