Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
! other improve Cheating model Jan 5, 2015
CaseStudies minor change Feb 6, 2016
GettingStarted rename .stan file Feb 22, 2016
ModelSelection change R package Dec 13, 2016
ParameterEstimation fixed name of model file in R script Oct 28, 2016 update Dec 7, 2014

Bayesian Cognitive Modeling

Models from the book Bayesian Cognitive Modeling: A Practical Course (2014) by Michael Lee and Eric-Jan Wagenmakers.

Original JAGS and WinBUGS models are available here:
On the same address you can also find the first two parts of the book and answers to the excercises.

Stan translation of the models was done by Martin Smira ( Special thanks to Bob Carpenter and the whole Stan community.


  1. All models are prepared for running from R using rstan. Model codes are included in R scripts as a string. This will change in future - models and data will be separated in standalone files that could be used in PyStan or CmdStan. We’re looking for a volunteer to pull the models out of the R code and generate data for them in a standalone file that could be used in PyStan or CmdStan.

  2. We've created a google spredsheet [here] with a list of all models and with some notes concering model implementation. We weren't able to implement 3 models (out of 57 models) into Stan.

  3. In the models from the first chapters, you will find notes concerning Stan related differences in model implementation. It is also advised to read chapter "Stan for Users of BUGS" in the Stan manual.

  4. There is a chance that you'll find a mistake in the models, please let me know if you do. Also contact me if you have suggestions to improve the code, but keep in mind that we want to keep readability of the code high. However, please ignore the style inconsistency in the R plotting code.