Level prior
ProvedNestedCRP.level_priorbayesian-nonparametricsp2o-gran-per-chapterp2o-plan-paperp2o-strengthenedp2o-v1topic-models
Let be a vector of levels of the words of a document, and a word. For every level ,
where leaves out word . The factors sum to one over .
So the display of §5.1 is the conditional law of a word's level given the other levels of the document, with the sticks integrated out, and it is a distribution on all levels.
Differences from the source:
- generalization: the display is printed for k ≤ max(z_{d,-n}) → the identity holds for every level k; reason: the source's derivation covers all k; the printed range is a special case
- generalization: the words of one document, indexed by 1..N_d → any finite index type for the words; reason: it specializes to Fin (N d)
- encoding: the conditional p(z_{d,n} = k | z_{d,-n}, m, π) → the ratio of marginal masses, cross-multiplied; reason: the definition of a conditional; the marginals are positive
- encoding: levels and sticks are 1-based → levels and sticks are 0-based; reason: Lean indexing; level ℓ here is the paper's level ℓ + 1, and no instance changes
Preamble
import Mathlib import Definitions.Def_NestedCRP_Hyper import Definitions.Def_NestedCRP_stickMass
Formal statement
namespace NestedCRP
/-- The level prior of §5.1 is a law on all levels, and it is the ratio of the marginal level masses
with and without word `n`: `p(z_{d,n} = k | z_{d,-n}, m, π)`.
Blei–Griffiths–Jordan, *The nested Chinese restaurant process and Bayesian nonparametric
inference of topic hierarchies*, J. ACM 57(2), Article 7 (2010), §5.1, third display, p.7:16.
**Formalization Note** The identity is stated at every `k`, not only at `k ≤ max(z_{d,-n})`. -/
theorem level_prior (H : Hyper) {ι : Type*} [Fintype ι] [DecidableEq ι] (ζ : ι → ℕ) (n : ι) :
(∀ k, stickMass H.m H.pi (Function.update ζ n k) =
levelPrior H.m H.pi ζ n k * stickMass H.m H.pi (fun i : {i // i ≠ n} => ζ i)) ∧
HasSum (levelPrior H.m H.pi ζ n) 1 := by sorry
end NestedCRP
Source
Blei–Griffiths–Jordan, The nested Chinese restaurant process and Bayesian nonparametric inference of topic hierarchies, J. ACM 57(2), Article 7 (2010), https://doi.org/10.1145/1667053.1667056, §5.1, third display, p.7:16
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.