API: random measures

Access the extension after loading Turing:

using Turing

const RandomMeasures = Base.get_extension(Turing, :TuringDistributionsExt)
RandomMeasures.DirichletProcess(1.0)
TuringDistributionsExt.DirichletProcessType
DirichletProcess(α)

A Dirichlet process with concentration parameter α.

Its size-biased and stick-breaking representations draw proportions according to

\[V_k \sim \operatorname{Beta}(1, \alpha).\]

In the Chinese restaurant representation, an occupied cluster k has weight m[k], while a new cluster has weight α.

References

Yee Whye Teh, "Dirichlet Process," 2010. https://www.stats.ox.ac.uk/~teh/research/npbayes/Teh2010a.pdf

source
TuringDistributionsExt.PitmanYorProcessType
PitmanYorProcess(d, θ, t)

A Pitman-Yor process with discount d, concentration θ, and t occupied clusters.

Its size-biased and stick-breaking representations draw proportions according to

\[V_k \sim \operatorname{Beta}(1 - d, \theta + t d).\]

In the Chinese restaurant representation, an occupied cluster k has weight m[k] - d, while a new cluster has weight θ + d * t.

References

Jim Pitman and Marc Yor, "The two-parameter Poisson-Dirichlet distribution derived from a stable subordinator," 1997.

source