API: Turing.RandomMeasures

Turing.RandomMeasures.DirichletProcessType
DirichletProcess(α)

The Dirichlet Process with concentration parameter α. Samples from the Dirichlet process can be constructed via the following representations.

Size-Biased Sampling Process

\[j_k \sim Beta(1, \alpha) * surplus\]

Stick-Breaking Process

\[v_k \sim Beta(1, \alpha)\]

Chinese Restaurant Process

\[p(z_n = k | z_{1:n-1}) \propto \begin{cases} \frac{m_k}{n-1+\alpha}, \text{if} m_k > 0\\ \frac{\alpha}{n-1+\alpha} \end{cases}\]

For more details see: https://www.stats.ox.ac.uk/~teh/research/npbayes/Teh2010a.pdf

source
Turing.RandomMeasures.PitmanYorProcessType
PitmanYorProcess(d, θ, t)

The Pitman-Yor Process with discount d, concentration θ and t already drawn atoms. Samples from the Pitman-Yor Process can be constructed via the following representations.

Size-Biased Sampling Process

\[j_k \sim Beta(1-d, \theta + t*d) * surplus\]

Stick-Breaking Process

\[v_k \sim Beta(1-d, \theta + t*d)\]

Chinese Restaurant Process

\[p(z_n = k | z_{1:n-1}) \propto \begin{cases} \frac{m_k - d}{n+\theta}, \text{if} m_k > 0\\ \frac{\theta + d*t}{n+\theta} \end{cases}\]

For more details see: https://en.wikipedia.org/wiki/Pitman–Yor_process

source
Turing.RandomMeasures._logpdf_tableFunction
_logpdf_table(d::AbstractRandomProbabilityMeasure, m::AbstractVector{Int})

Parameters:

  • d: Random probability measure, e.g. DirichletProcess
  • m: Cluster counts
source
Turing.RandomMeasures.stickbreakMethod

Stick-breaking function.

This function accepts a vector (`v`) of length $K - 1$ where each element
is assumed to be in the unit interval, and returns a simplex of length
$K$.  If the supplied vector `v` is a vector of independent draws from
a Beta distribution (i.e., vⱼ | a ~ Beta(1, a), for j=1,...,K), then
returned simplex is generated via a stick-breaking process where
the first element of the stick is w₁ = v₁, the last element w_K =
∏ⱼ (1 - vⱼ), and the other elements are wₖ = vₖ ∏ⱼ₌₁ᵏ⁻¹(1 - vⱼ).
As $K$ goes to infinity, w is a draw from the Chinese Restaurant process
with mass parameter a.

Arguments

  • v: A vector of length $K - 1$, where $K > 1$.

Return

  • A simplex (w) of dimension $K$. Where ∑ₖ wₖ = 1, and each wₖ ≥ 0.
source