Stick Breaking Process and Dirichlet Process Priors

The stick-breaking process illustrated here provides a prior distribution known as the Dirichlet Process Prior (DPP). The lavender rectangle below represents an unbroken stick. Press the “b” key to break the stick at a random point. Pressing “b” again breaks the stick randomly again, but only in the rightmost section. This process could technically continue forever, as there will always be some interval representing the rightmost section, but once you have no detectable remainder, press the “t” key to throw darts at the stick. This represents one draw from the DPP. The expected number of occupied segments is shown below as “E” and the observed number of occupied segments is shown as “O”.

As a phylogenetic example, the darts might represent sites and the segments substitution rate categories. The expected number of categories is determined by the parameter alpha (the value of which you can change; see the key at the bottom of the page): higher alpha means more categories.




This applet makes use of the excellent d3js javascript library. Please see the GitHub site for details about licensing of other libraries that may have been used in the source code for this applet.


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.