Stick Breaking Process and Dirichlet Process Priors

Before the stick has been broken the first time, the remainder has length 1 (i.e. all of the stick). Each subsequent break affects the remainder only. Larger values of alpha lead to more, smaller sticks.


This process provides a prior distribution known as the Dirichlet Process Prior (DPP). Imagine that the darts are sites and the colors of the rectangles represent different relative substitution rates. The stick breaking process illustrated in this applet shows what typical draws from a Dirichlet Process Prior look like for different values of alpha and different numbers of sites (darts). Used in a Bayesian MCMC analysis, a DPP would allow you to learn something about how many rate categories are present and which sites fall into which category. Normally, a hierarchical model would be used in which alpha is a hyperparameter and its hyperprior would be vague but nevertheless discourage alpha from getting too large.


This applet makes use of d3js and simjs. Please see the GitHub site for details about licensing.


Creative Commons Attribution 4.0 International. License (CC BY 4.0). To view a copy of this license, visit or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.