API: random measures
Access the extension after loading Turing:
using Turing
const RandomMeasures = Base.get_extension(Turing, :TuringDistributionsExt)
RandomMeasures.DirichletProcess(1.0)TuringDistributionsExt.ChineseRestaurantProcess — Type
ChineseRestaurantProcess(rpm, m)A Chinese restaurant process for the random probability measure rpm, where m contains the current cluster counts.
TuringDistributionsExt.DirichletProcess — Type
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
TuringDistributionsExt.PitmanYorProcess — Type
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.
TuringDistributionsExt.SizeBiasedSamplingProcess — Type
SizeBiasedSamplingProcess(rpm, surplus)A size-biased sampling representation of the random probability measure rpm with remaining mass surplus.
TuringDistributionsExt.StickBreakingProcess — Type
StickBreakingProcess(rpm)A stick-breaking representation of the random probability measure rpm.
TuringDistributionsExt.stickbreak — Method
stickbreak(v)Convert K - 1 breaking proportions in v into K simplex weights.