Software for Bayesian analysis of learning
Anne C Smith, annesmith@ucdavis.edu
This page outlines how to estimate learning curves using Winbugs from Matlab. The script files generate Figures 1 and 2 in Smith, Wirth, Suzuki and Brown (Bayesian Analysis of Interleaved Learning and Bias in Behavioral Experiments, J. Neurophys., submitted, 2006).
Before the code can be run:
- Install Winbugs from http://www.mrc-bsu.cam.ac.uk/bugs/
- Download "matbugs.m" from http://www.cs.ubc.ca/~murphyk/Software/MATBUGS/matbugs.html
- For the single learning example, download and unzip the directory “Single”.
- For the TMaze example, download and unzip the directory “TMaze”.
- Copy "matbugs.m" to directories Single and/or TMaze.
The "Single" and "TMaze" directories contain Matlab files and a .txt file. The model is specified in the .txt file.
From Matlab,
- Single Learning Example
Type “RunSingleExample” in the “Single” directory from Matlab. Adjustments to the input and output as well as number, burn-in and length of MC chains can be made in "RunSingleExample.m". Adjustments to the model specification are made in the .txt file “Model.txt”
- T Maze example
Type “RunTMazeExample” in the "TMaze" directory from Matlab.
Comments
- In the examples shown the MCMC chains mix and converge. In general I have found this to be the case for these models. However, it is very important to check convergence. Details of convergence diagnostics can be found in the WinBUGs documentation.
- Some convergence problems and trap errors can occur if the prior on the random walk variance is too diffuse.
- To force the script to stay in WinBUGS, change the ‘view’ parameter in the "matbugs.m" function call from "0" to "1".
Supported by NIMH (MH-71847).