{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Bayesian Cognitive Modeling in PyMC3\n", "PyMC3 port of Lee and Wagenmakers' [Bayesian Cognitive Modeling - A Practical Course](http://bayesmodels.com)\n", "\n", "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))\n", "\n", "_All the codes are currently tested under PyMC3 v3.2 with theano 0.10.0.dev_" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Part II - PARAMETER ESTIMATION\n", "\n", "### [Chapter 3: Inferences with binomials](./ParameterEstimation/Binomial.ipynb) \n", " [3.1 Inferring a rate](./ParameterEstimation/Binomial.ipynb#3.1-Inferring-a-rate) \n", " [3.2 Difference between two rates](./ParameterEstimation/Binomial.ipynb#3.2-Difference-between-two-rates) \n", " [3.3 Inferring a common rate](./ParameterEstimation/Binomial.ipynb#3.3-Inferring-a-common-rate) \n", " [3.4 Prior and posterior prediction](./ParameterEstimation/Binomial.ipynb#3.4-Prior-and-posterior-prediction) \n", " [3.5 Posterior prediction](./ParameterEstimation/Binomial.ipynb#3.5-Posterior-Predictive) \n", " [3.6 Joint distributions](./ParameterEstimation/Binomial.ipynb#3.6-Joint-distributions) \n", " \n", "### [Chapter 4: Inferences with Gaussians](./ParameterEstimation/Gaussian.ipynb) \n", " [4.1 Inferring a mean and standard deviation](./ParameterEstimation/Gaussian.ipynb#4.1-Inferring-a-mean-and-standard-deviation) \n", " [4.2 The seven scientists](./ParameterEstimation/Gaussian.ipynb#4.2-The-seven-scientists) \n", " [4.3 Repeated measurement of IQ](./ParameterEstimation/Gaussian.ipynb#4.3-Repeated-measurement-of-IQ) \n", " \n", "### [Chapter 5: Some examples of data analysis](./ParameterEstimation/DataAnalysis.ipynb) \n", " [5.1 Pearson correlation](./ParameterEstimation/DataAnalysis.ipynb#5.1-Pearson-correlation) \n", " [5.2 Pearson correlation with uncertainty](./ParameterEstimation/DataAnalysis.ipynb#5.2-Pearson-correlation-with-uncertainty) \n", " [5.3 The kappa coefficient of agreement](./ParameterEstimation/DataAnalysis.ipynb#5.3-The-kappa-coefficient-of-agreement) \n", " [5.4 Change detection in time series data](./ParameterEstimation/DataAnalysis.ipynb#5.4-Change-detection-in-time-series-data) \n", " [5.5 Censored data](./ParameterEstimation/DataAnalysis.ipynb#5.5-Censored-data) \n", " [5.6 Recapturing planes](./ParameterEstimation/DataAnalysis.ipynb#5.6-Recapturing-planes) \n", " \n", "### [Chapter 6: Latent-mixture models](./ParameterEstimation/Latent-mixtureModels.ipynb) \n", " [6.1 Exam scores](./ParameterEstimation/Latent-mixtureModels.ipynb#6.1-Exam-scores) \n", " [6.2 Exam scores with individual differences](./ParameterEstimation/Latent-mixtureModels.ipynb#6.2-Exam-scores-with-individual-differences) \n", " [6.3 Twenty questions](./ParameterEstimation/Latent-mixtureModels.ipynb#6.3-Twenty-questions) \n", " [6.4 The two-country quiz](./ParameterEstimation/Latent-mixtureModels.ipynb#6.4-The-two-country-quiz) \n", " [6.5 Assessment of malingering](./ParameterEstimation/Latent-mixtureModels.ipynb#6.5-Assessment-of-malingering) \n", " [6.6 Individual differences in malingering](./ParameterEstimation/Latent-mixtureModels.ipynb#6.6-Individual-differences-in-malingering) \n", " [6.7 Alzheimerâ€™s recall test cheating](./ParameterEstimation/Latent-mixtureModels.ipynb#6.7-Alzheimer's-recall-test-cheating) " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Part III - MODEL SELECTION\n", "\n", "### [Chapter 8: Comparing Gaussian means](./ModelSelection/ComparingGaussianMeans.ipynb) \n", " [8.1 One-sample comparison](./ModelSelection/ComparingGaussianMeans.ipynb#8.1-One-sample-comparison) \n", " [8.2 Order-restricted one-sample comparison](./ModelSelection/ComparingGaussianMeans.ipynb#8.2-Order-restricted-one-sample-comparison) \n", " [8.3 Two-sample comparison](./ModelSelection/ComparingGaussianMeans.ipynb#8.3-Two-sample-comparison)\n", " \n", "### [Chapter 9: Comparing binomial rates](./ModelSelection/ComparingBinomialRates.ipynb) \n", " [9.1 Equality of proportions](./ModelSelection/ComparingBinomialRates.ipynb#9.1-Equality-of-proportions) \n", " [9.2 Order-restricted equality of proportions](./ModelSelection/ComparingBinomialRates.ipynb#9.2-Order-restricted-equality-of-proportions) \n", " [9.3 Comparing within-subject proportions](./ModelSelection/ComparingBinomialRates.ipynb#9.3-Comparing-within-subject-proportions) \n", " [9.4 Comparing between-subject proportions](./ModelSelection/ComparingBinomialRates.ipynb#9.4-Comparing-between-subject-proportions) \n", " [9.5 Order-restricted between-subjects comparison](./ModelSelection/ComparingBinomialRates.ipynb#9.5-Order-restricted-between-subject-proportions) " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Part IV - CASE STUDIES\n", "\n", "### [Chapter 10: Memory retention](./CaseStudies/MemoryRetention.ipynb) \n", " [10.1 No individual differences](./CaseStudies/MemoryRetention.ipynb#10.1-No-individual-differences) \n", " [10.2 Full individual differences](./CaseStudies/MemoryRetention.ipynb#10.2-Full-individual-differences) \n", " [10.3 Structured individual differences](./CaseStudies/MemoryRetention.ipynb#10.3-Structured-individual-differences) \n", " \n", "### [Chapter 11: Signal detection theory](./CaseStudies/SignalDetectionTheory.ipynb) \n", " [11.1 Signal detection theory](./CaseStudies/SignalDetectionTheory.ipynb#11.1-Signal-detection-theory) \n", " [11.2 Hierarchical signal detection theory](./CaseStudies/SignalDetectionTheory.ipynb#11.2-Hierarchical-signal-detection-theory) \n", " [11.3 Parameter expansion](./CaseStudies/SignalDetectionTheory.ipynb#11.3-Parameter-expansion) \n", " \n", "### [Chapter 12: Psychophysical functions](./CaseStudies/PsychophysicalFunctions.ipynb) \n", " [12.1 Psychophysical functions](./CaseStudies/PsychophysicalFunctions.ipynb#12.1-Psychophysical-functions) \n", " [12.2 Psychophysical functions under contamination](./CaseStudies/PsychophysicalFunctions.ipynb#12.2-Psychophysical-functions-under-contamination) \n", " \n", "### [Chapter 13: Extrasensory perception](./CaseStudies/ExtrasensoryPerception.ipynb) \n", " [13.1 Evidence for optional stopping](./CaseStudies/ExtrasensoryPerception.ipynb#13.1-Evidence-for-optional-stopping) \n", " [13.2 Evidence for differences in ability](./CaseStudies/ExtrasensoryPerception.ipynb#13.2-Evidence-for-differences-in-ability) \n", " [13.3 Evidence for the impact of extraversion](./CaseStudies/ExtrasensoryPerception.ipynb#13.3-Evidence-for-the-impact-of-extraversion) \n", " \n", "### [Chapter 14: Multinomial processing trees](./CaseStudies/MultinomialProcessingTrees.ipynb) \n", " [14.1 Multinomial processing model of pair-clustering](./CaseStudies/MultinomialProcessingTrees.ipynb#14.1-Multinomial-processing-model-of-pair-clustering) \n", " [14.2 Latent-trait MPT model](./CaseStudies/MultinomialProcessingTrees.ipynb#14.2-Latent-trait-MPT-model) \n", " \n", "### [Chapter 15: The SIMPLE model of memory](./CaseStudies/TheSIMPLEModelofMemory.ipynb) \n", " [15.1 The SIMPLE model](./CaseStudies/TheSIMPLEModelofMemory.ipynb#15.1-The-SIMPLE-model) \n", " [15.2 A hierarchical extension of SIMPLE](./CaseStudies/TheSIMPLEModelofMemory.ipynb#15.2-A-hierarchical-extension-of-SIMPLE) \n", " \n", "### [Chapter 16: The BART model of risk taking](./CaseStudies/TheBARTModelofRiskTaking.ipynb) \n", " [16.1 The BART model](./CaseStudies/TheBARTModelofRiskTaking.ipynb#16.1-The-BART-model) \n", " [16.2 A hierarchical extension of the BART model](./CaseStudies/TheBARTModelofRiskTaking.ipynb#16.2-A-hierarchical-extension-of-the-BART-model) \n", "\n", "### [Chapter 17: The GCM model of categorization](./CaseStudies/TheGCMModelofCategorization.ipynb) \n", " [17.1 The GCM model](./CaseStudies/TheGCMModelofCategorization.ipynb#17.1-The-GCM-model) \n", " [17.2 Individual differences in the GCM](./CaseStudies/TheGCMModelofCategorization.ipynb#17.2-Individual-differences-in-the-GCM) \n", " [17.3 Latent groups in the GCM](./CaseStudies/TheGCMModelofCategorization.ipynb#17.3-Latent-groups-in-the-GCM) \n", " \n", "### [Chapter 18: Heuristic decision-making](./CaseStudies/HeuristicDecisionMaking.ipynb) \n", " [18.1 Take-the-best](./CaseStudies/HeuristicDecisionMaking.ipynb#18.1-Take-the-best) \n", " [18.2 Stopping](./CaseStudies/HeuristicDecisionMaking.ipynb#18.2-Stopping) \n", " [18.3 Searching](./CaseStudies/HeuristicDecisionMaking.ipynb#18.3-Searching) \n", " [18.4 Searching and stopping](./CaseStudies/HeuristicDecisionMaking.ipynb#18.4-Searching-and-stopping) \n", " \n", "### [Chapter 19: Number concept development](./CaseStudies/NumberConceptDevelopment.ipynb) \n", " [19.1 Knower-level model for Give-N](./CaseStudies/NumberConceptDevelopment.ipynb#19.1-Knower-level-model-for-Give-N) \n", " [19.2 Knower-level model for Fast-Cards](./CaseStudies/NumberConceptDevelopment.ipynb#19.2-Knower-level-model-for-Fast-Cards) \n", " [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) " ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "CPython 3.5.1\n", "IPython 6.2.1\n", "\n", "pymc3 3.2\n", "theano 0.10.0dev1.dev-d51233517debf3a1231a33058d65e8f969db923d\n", "scipy 0.19.1\n", "numpy 1.12.0\n", "pandas 0.20.2\n", "matplotlib 2.0.2\n", "seaborn 0.7.0\n", "\n", "compiler : GCC 4.2.1 (Apple Inc. build 5666) (dot 3)\n", "system : Darwin\n", "release : 16.7.0\n", "machine : x86_64\n", "processor : i386\n", "CPU cores : 4\n", "interpreter: 64bit\n" ] } ], "source": [ "# Python Environment and library version\n", "%load_ext watermark\n", "%watermark -v -m -p pymc3,theano,scipy,numpy,pandas,matplotlib,seaborn" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.5.1" } }, "nbformat": 4, "nbformat_minor": 2 }