# Distributions over Partitions

The following distributions are implemented.

EqualitySampler.BetaBinomialPartitionDistributionType
BetaBinomialPartitionDistribution{T <: Integer} <: AbstractPartitionDistribution{T}

Beta binomial distribution over partitions. If $\rho \sim \text{BetaBinomialPartitionDistribution}(k, \alpha, \beta)$ then $\text{count\_parameters}(\rho) \sim \text{BetaBinomial}(k - 1, \alpha, \beta)$.

EqualitySampler.CustomInclusionPartitionDistributionType
CustomInclusionPartitionDistribution(k::T, logpdf::NTuple{N, Float64})

CustomInclusionPartitionDistribution is similar to the BetaBinomialPartitionDistribution in that the model probabilities are completely determined by the size of the partition. Whereas the BetaBinomialPartitionDistribution uses a BetaBinomial distribution to obtain the probabilities, the CustomInclusionPartitionDistribution can be used to specify any vector of probabilities. This distribution is particularly useful to sample uniformly from partitions of a given size. For example:

rand(CustomInclusionPartitionDistribution(4, ntuple(i->log(i==1), Val(4)))) # always all equal (1 parameter)
rand(CustomInclusionPartitionDistribution(4, ntuple(i->log(i==3), Val(4)))) # always 3 parameters
rand(CustomInclusionPartitionDistribution(4, ntuple(i->log(i==4), Val(4)))) # always completely distinct (4 parameters)

The function does not check if sum(exp, logpdf) ≈ 1.0, that is the callers responsibility.

EqualitySampler.RandomProcessPartitionDistributionType
RandomProcessPartitionDistribution{RPM <: Turing.RandomMeasures.AbstractRandomProbabilityMeasure, T <: Integer} <: AbstractPartitionDistribution{T}

Distribution over partitions defined by a Random Probabiltiy Measure (RPM) as defined in Turing.RandomMeasures.

Aside from the interface for multivariate distributions, the following methods are also defined.

EqualitySampler.pdf_modelFunction
pdf_model(d::AbstractPartitionDistribution, x::Integer)
pdf_model(d::AbstractPartitionDistribution, x::AbstractVector{<:Integer})

Synonym for pdf(d::AbstractPartitionDistribution, x), computes the probability of a partition.

EqualitySampler.logpdf_modelFunction
logpdf_model(d::AbstractPartitionDistribution, x::Integer)
logpdf_model(d::AbstractPartitionDistribution, x::AbstractVector{<:Integer})

Synonym for logpdf(d::AbstractPartitionDistribution, x), computes the log probability of a partition.

EqualitySampler.pdf_model_distinctFunction
pdf_model_distinct(d::AbstractPartitionDistribution, x)

Computes the probability of a partition without considering duplicated partitions (i.e., assuming all partitions are unique).

EqualitySampler.logpdf_model_distinctFunction
logpdf_model_distinct(d::AbstractPartitionDistribution, x)

Computes the log probability of a partition without considering duplicated partitions (i.e., assuming all partitions are unique).

EqualitySampler.pdf_inclFunction
pdf_incl(d::AbstractPartitionDistribution, no_parameters::Integers)

Probability of all partitions with a particular number of parameters.

EqualitySampler.logpdf_inclFunction
logpdf_incl(d::AbstractPartitionDistribution, no_parameters::Integers)

Log probability of all partitions with a particular number of parameters.