Documentation

Linglib.Core.Probability.Distributions.Dirichlet

The Dirichlet distribution #

This file defines the Dirichlet distribution with positive parameters θ, a probability measure on the standard simplex Convexity.StdSimplex ℝ ι of probability vectors on the finite type ι, and computes its moments. The moment ∫ ∏ i, p i ^ x i is the probability that the Pólya urn with weights θ draws a given sequence with counts x, so the draws of the urn are a Dirichlet mixture of independent draws.

Main definitions #

Main statements #

Implementation notes #

The standard simplex carries the Borel σ-algebra of its topology, which for finite ι is induced by the embedding of the weights into ι → ℝ. The distribution is built on Fin n → ℝ by stick-breaking: the first coordinate is beta-distributed with parameters θ 0 and the sum of the other parameters, and the other coordinates are 1 - p 0 times an independent Dirichlet vector with the other parameters. It lives on the probability vectors, and is pulled back to the simplex along an enumeration Fintype.equivFin ι, on which the moments do not depend.

References #

theorem Convexity.StdSimplex.exists_weights_eq_iff {R : Type u_1} {X : Type u_2} [PartialOrder R] [Semiring R] [Fintype X] {f : X → R} :
(∃ (t : StdSimplex R X), ⇑t.weights = f) ↔ (∀ (i : X), 0 ≤ f i) ∧ ∑ i : X, f i = 1

The Borel σ-algebra on the standard simplex #

@[instance_reducible]
noncomputable instance Convexity.StdSimplex.instMeasurableSpaceReal_linglib {M : Type u_1} :
MeasurableSpace (StdSimplex ℝ M)
Equations
instance Convexity.StdSimplex.instBorelSpaceReal_linglib {M : Type u_1} :
BorelSpace (StdSimplex ℝ M)
theorem Convexity.StdSimplex.measurableEmbedding_weights (M : Type u_1) [Finite M] :
MeasurableEmbedding fun (t : StdSimplex ℝ M) => ⇑t.weights
theorem Convexity.StdSimplex.measurable_weights_apply {M : Type u_1} (m : M) :
Measurable fun (t : StdSimplex ℝ M) => t.weights m

Stick-breaking on Fin n #

theorem ProbabilityTheory.measurable_fin_cons_one_sub_smul {n : ℕ} :
Measurable fun (vq : ℝ × (Fin n → ℝ)) => Fin.cons vq.1 ((1 - vq.1) • vq.2)
noncomputable def ProbabilityTheory.dirichletFin (n : ℕ) :
(Fin n → ℝ) → MeasureTheory.Measure (Fin n → ℝ)

The Dirichlet distribution on Fin n → ℝ with parameters θ, by stick-breaking.

Equations
Instances For
    theorem ProbabilityTheory.sFinite_dirichletFin (n : ℕ) (θ : Fin n → ℝ) :
    MeasureTheory.SFinite (dirichletFin n θ)
    instance ProbabilityTheory.instSFiniteForallFinRealDirichletFin {n : ℕ} {θ : Fin n → ℝ} :
    MeasureTheory.SFinite (dirichletFin n θ)
    theorem ProbabilityTheory.lintegral_prod_pow_dirichletFin {n : ℕ} {θ : Fin n → ℝ} :
    (∀ (i : Fin n), 0 < θ i) → ∀ (x : Fin n → ℕ), ∫⁻ (p : Fin n → ℝ), ∏ i : Fin n, ENNReal.ofReal (p i) ^ x i ∂dirichletFin n θ = ENNReal.ofReal (polyaUrnProb θ x)
    theorem ProbabilityTheory.ae_exists_weights_eq_dirichletFin {n : ℕ} (θ : Fin n → ℝ) :
    n ≠ 0 → ∀ᵐ (p : Fin n → ℝ) ∂dirichletFin n θ, ∃ (t : Convexity.StdSimplex ℝ (Fin n)), ⇑t.weights = p

    The Dirichlet distribution on a finite type #

    noncomputable def ProbabilityTheory.dirichlet {ι : Type u_1} [Fintype ι] (θ : ι → ℝ) :
    MeasureTheory.Measure (Convexity.StdSimplex ℝ ι)

    The Dirichlet distribution with parameters θ on the probability vectors over ι.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      theorem ProbabilityTheory.map_weights_dirichlet {ι : Type u_1} [Fintype ι] [Nonempty ι] (θ : ι → ℝ) :
      MeasureTheory.Measure.map (fun (t : Convexity.StdSimplex ℝ ι) => ⇑t.weights) (dirichlet θ) = MeasureTheory.Measure.map (fun (q : Fin (Fintype.card ι) → ℝ) => q ∘ ⇑(Fintype.equivFin ι)) (dirichletFin (Fintype.card ι) (θ ∘ ⇑(Fintype.equivFin ι).symm))

      The weights of a Dirichlet-distributed point have the stick-breaking law.

      theorem ProbabilityTheory.lintegral_prod_pow_dirichlet {ι : Type u_1} [Fintype ι] [Nonempty ι] {θ : ι → ℝ} (hθ : ∀ (i : ι), 0 < θ i) (x : ι → ℕ) :
      ∫⁻ (t : Convexity.StdSimplex ℝ ι), ∏ i : ι, ENNReal.ofReal (t.weights i) ^ x i ∂dirichlet θ = ENNReal.ofReal (polyaUrnProb θ x)

      The moments of the Dirichlet distribution are the probabilities of the Pólya urn with the same weights.

      theorem ProbabilityTheory.isProbabilityMeasure_dirichlet {ι : Type u_1} [Fintype ι] [Nonempty ι] {θ : ι → ℝ} (hθ : ∀ (i : ι), 0 < θ i) :
      MeasureTheory.IsProbabilityMeasure (dirichlet θ)
      theorem ProbabilityTheory.polyaUrn_singleton_eq_lintegral_dirichlet {α : Type u_2} [DecidableEq α] [Fintype α] [Nonempty α] [MeasurableSpace α] [MeasurableSingletonClass α] {θ : α → ℝ} (hθ : ∀ (i : α), 0 < θ i) {n : ℕ} (s : Fin n → α) :
      (polyaUrn θ n) {s} = ∫⁻ (t : Convexity.StdSimplex ℝ α), ∏ i : Fin n, ENNReal.ofReal (t.weights (s i)) ∂dirichlet θ

      The probability that the Pólya urn draws a sequence is the probability of drawing it independently from a Dirichlet-distributed probability vector, the mixture form of [Pit06] Exercise 2.2.2.