The Pitman–Yor partition #
The two-parameter family of random partitions of [Pit06] §3.2, generated by the
(α, θ) seating plan of the Chinese restaurant process: the first customer sits at a table of
their own, and when n customers sit at k tables, n_i of them at table i, the next
customer joins table i with probability (n_i - α) / (n + θ) and opens a new table with
probability (θ + k α) / (n + θ). The seating is a sequence of table labels, each customer
labelled by the first customer at their table, drawn from this prediction rule (crpRule, with
seqLaw); pitmanYor α θ n is the law of the partition of Fin n it generates.
Theorem 3.2 of [Pit06] computes the law: a partition whose blocks have sizes
n_1, …, n_k has probability
p(n_1, …, n_k) = (θ + α)_{k-1↑α} ∏ᵢ (1 - α)_{nᵢ-1↑1} / (θ + 1)_{n-1↑1},
where (x)_{m↑s} = x (x + s) ⋯ (x + (m - 1) s). This is pitmanYorEPPF, the exchangeable
partition probability function: the probability depends on the partition only through its
block sizes, so the law is invariant under relabelling, exchangeable in the sense of
[Pit06] §2.1 (smulInvariantMeasure_pitmanYor).
Main definitions #
ProbabilityTheory.pitmanYorEPPF α θ s: the probability of a partition whose multiset of block sizes iss.ProbabilityTheory.crpRule α θ n: the seating plan on table labels, as a prediction rule.ProbabilityTheory.pitmanYor α θ n: the law of the partition ofncustomers by table.
Main results #
ProbabilityTheory.isProbabilityMeasure_pitmanYor: for0 ≤ α ≤ 1and-α < θthe seating plan defines a probability measure.ProbabilityTheory.seqLaw_crpRule_singleton: a sequence of table labels has the probability of the partition it generates if each label is the first customer at its table, and0otherwise.ProbabilityTheory.pitmanYor_real_singleton: the law of the partition is the EPPF ([Pit06] Theorem 3.2).ProbabilityTheory.smulInvariantMeasure_pitmanYor: the partition is exchangeable.ProbabilityTheory.pitmanYorEPPF_cons_one,ProbabilityTheory.pitmanYorEPPF_cons_succ_erase: the EPPF's two seating recursions, the second being [Pit06] (3.22).ProbabilityTheory.pitmanYorEPPF_zero_left: atα = 0the EPPF is the Ewens sampling formula.
Implementation notes #
Tables are labelled by their first customer, so a new table opened by customer n is labelled
n and the valid label sequences are those equal to the labelling of their partition by least
elements (Finpartition.minLabel). Each partition has exactly one such labelling, which gives
the law of the partition from that of the labels. The seating plan starts from one customer at
one table ([Pit06] p. 60): the rule for the first customer is the point mass at label 0,
as the general formula would read θ / θ. The products in the EPPF are written over Ico 1 m,
(θ + α)_{k-1↑α} = ∏_{1 ≤ i < k} (θ + i α) and so on, avoiding truncated subtraction. The
parameters are unbundled: the measure is defined for all real α, θ, and the constraints of
[Pit06] (3.5), second case, are hypotheses of the theorems that need them. The first case
of (3.5), α < 0 with θ = m (-α), is not treated.
TODO #
- The partitions
Π_nare consistent asngrows and form an exchangeable random partition ofℕ([Pit06] Theorem 3.2); this needs the label sequence as a trajectory measure (ProbabilityTheory.Kernel.traj).
References #
Labelling by least elements #
The label of i in a partition of Fin n is the least element of its block.
Equations
- P.minLabel i = ↑((P.part i).min' ⋯)
Instances For
A partition of Fin n is generated by its labelling by least elements.
In a sequence of least-element labels, each label is the index where it first occurs.
Appending an earlier label, or the next index, to a sequence of least-element labels gives a sequence of least-element labels.
A sequence of least-element labels stays one when its last entry is removed, and its last entry is an earlier label or the next index.
Appending an existing value enlarges its block by one.
The exchangeable partition probability function of the Pitman–Yor partition
([Pit06] (3.6)): the probability that the seating of n customers is a given set
partition whose multiset of block sizes is s, where n = s.sum.
Equations
- ProbabilityTheory.pitmanYorEPPF α θ s = (∏ i ∈ Finset.Ico 1 s.card, (θ + ↑i * α)) * (Multiset.map (fun (m : ℕ) => ∏ j ∈ Finset.Ico 1 m, (↑j - α)) s).prod / ∏ i ∈ Finset.Ico 1 s.sum, (θ + ↑i)
Instances For
Opening a new table multiplies the EPPF by the probability of doing so, (θ + k α) / (n + θ)
when n customers sit at k tables ([Pit06] p. 61).
Joining a table of m customers multiplies the EPPF by the probability of doing so,
(m - α) / (n + θ): the recursion (3.22) of [Pit06].
At α = 0 the EPPF is the Ewens sampling formula θ ^ k / (θ)_{n↑1} ∏ᵢ (nᵢ - 1)!
([Pit06] (2.19)), the partition of a sample from a Dirichlet process with parameter θ
([Pit06] p. 61).
The Chinese restaurant #
The (α, θ) seating plan on table labels, each customer labelled by the first customer at
their table. The first customer opens table 0. When customers 0, …, n sit at k tables,
label c used n_c times, customer n + 1 opens a new table, labelled n + 1, with
probability (θ + k α) / (n + 1 + θ), and joins the table labelled c with probability
(n_c - α) / (n + 1 + θ).
Equations
- One or more equations did not get rendered due to their size.
- ProbabilityTheory.crpRule α θ 0 = ProbabilityTheory.Kernel.const (Fin 0 → ℕ) (MeasureTheory.Measure.dirac 0)
Instances For
The Pitman–Yor partition: the law of the partition of n customers by table under the
(α, θ) seating plan.
Equations
- ProbabilityTheory.pitmanYor α θ n = MeasureTheory.Measure.map Finpartition.ofFun (ProbabilityTheory.seqLaw (ProbabilityTheory.crpRule α θ) n)
Instances For
The seating plan on labels. A sequence of table labels has the probability
pitmanYorEPPF of the partition it generates if each label is the first customer at its table,
and probability 0 otherwise.
Pitman's Theorem 3.2: the Pitman–Yor partition gives each partition of Fin n the
probability pitmanYorEPPF of its block sizes ([Pit06] (3.6)).
Pitman's Theorem 3.2, real form.
The Pitman–Yor partition is exchangeable: relabelling the customers by a permutation does not change its law ([Pit06] Theorem 3.2).