Specific Constructions of Probability Mass Functions #
This file gives a number of different PMF constructions for common probability distributions.
map and seq allow pushing a PMF α along a function f : α → β (or distribution of
functions f : PMF (α → β)) to get a PMF β.
ofFinset and ofFintype simplify the construction of a PMF α from a function f : α → ℝ≥0∞,
by allowing the "sum equals 1" constraint to be in terms of Finset.sum instead of tsum.
normalize constructs a PMF α by normalizing a function f : α → ℝ≥0∞ by its sum,
and filter uses this to filter the support of a PMF and re-normalize the new distribution.
@[simp]
@[simp]
theorem
PMF.toOuterMeasure_map_apply
{α : Type u_1}
{β : Type u_2}
(f : α → β)
(p : PMF α)
(s : Set β)
:
@[simp]
theorem
PMF.toMeasure_map_apply
{α : Type u_1}
{β : Type u_2}
(f : α → β)
(p : PMF α)
(s : Set β)
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
(hf : Measurable f)
(hs : MeasurableSet s)
:
@[simp]
theorem
PMF.toMeasure_map
{α : Type u_1}
{β : Type u_2}
(f : α → β)
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
(p : PMF α)
(hf : Measurable f)
:
Given a finite type α and a function f : α → ℝ≥0∞ with sum 1, we get a PMF.
Equations
- PMF.ofFintype f h = PMF.ofFinset f Finset.univ h ⋯
Instances For
@[simp]
@[simp]
theorem
PMF.toMeasure_ofFintype_apply
{α : Type u_1}
[Fintype α]
{f : α → ENNReal}
(h : ∑ a : α, f a = 1)
(s : Set α)
[MeasurableSpace α]
(hs : MeasurableSet s)
:
@[deprecated ProbabilityTheory.bernoulliMeasure (since := "2026-04-07")]
A PMF which assigns probability p to true and 1 - p to false.
Equations
- PMF.bernoulli p h = PMF.ofFintype (fun (b : Bool) => bif b then ↑p else 1 - ↑p) ⋯