Bayesian inference with Stan: A tutorial on adding custom distributions.
When evaluating cognitive models based on fits to observed data (or, really, any model that has free parameters), parameter estimation is critically important. Traditional techniques like hill climbing by minimizing or maximizing a fit statistic often result in point estimates. Bayesian approaches instead estimate parameters as posterior probability distributions, and thus naturally account for the uncertainty associated with parameter estimation; Bayesian approaches also offer powerful and principled methods for model comparison. Although software applications such as WinBUGS (Lunn, Thomas, Best, & Spiegelhalter, Statistics and Computing, 10, 325-337, 2000) and JAGS (Plummer, 2003) provide "turnkey"-style packages for Bayesian inference, they can be inefficient when dealing with models whose parameters are correlated, which is often the case for cognitive models, and they can impose significant technical barriers to adding custom distributions, which is often necessary when implementing cognitive models within a Bayesian framework. A recently developed software package called Stan (Stan Development Team, 2015) can solve both problems, as well as provide a turnkey solution to Bayesian inference. We present a tutorial on how to use Stan and how to add custom distributions to it, with an example using the linear ballistic accumulator model (Brown & Heathcote, Cognitive Psychology, 57, 153-178. doi: 10.1016/j.cogpsych.2007.12.002 , 2008).
Vanderbilt University, 111 21st Ave S., 301 Wilson Hall, Nashville, TN, 37240, USA. jeff.annis@vanderbilt.edu.
Jeffrey
J
Annis
Vanderbilt University, 111 21st Ave S., 301 Wilson Hall, Nashville, TN, 37240, USA.
Brent J
BJ
Miller
Vanderbilt University, 111 21st Ave S., 301 Wilson Hall, Nashville, TN, 37240, USA.
Thomas J
TJ
Palmeri
D001499:Bayes Theorem; D003071:Cognition; D006801:Humans; D008960:Models, Psychological; D012984:Software
Bayesian inference; Linear ballistic accumulator; Probabilistic programming; Stan