Probability mass functions #
This file is about probability mass functions or discrete probability measures:
a function α → ℝ≥0∞
such that the values have (infinite) sum 1
.
Construction of monadic pure
and bind
is found in ProbabilityMassFunction/Monad.lean
,
other constructions of PMF
s are found in ProbabilityMassFunction/Constructions.lean
.
Given p : PMF α
, PMF.toOuterMeasure
constructs an OuterMeasure
on α
,
by assigning each set the sum of the probabilities of each of its elements.
Under this outer measure, every set is Carathéodory-measurable,
so we can further extend this to a Measure
on α
, see PMF.toMeasure
.
PMF.toMeasure.isProbabilityMeasure
shows this associated measure is a probability measure.
Conversely, given a probability measure μ
on a measurable space α
with all singleton sets
measurable, μ.toPMF
constructs a PMF
on α
, setting the probability mass of a point x
to be the measure of the singleton set {x}
.
Tags #
probability mass function, discrete probability measure
The support of a PMF
is the set where it is nonzero.
Equations
- PMF.support p = Function.support ⇑p
Instances For
Construct an OuterMeasure
from a PMF
, by assigning measure to each set s : Set α
equal
to the sum of p x
for each x ∈ α
.
Equations
- PMF.toOuterMeasure p = MeasureTheory.OuterMeasure.sum fun (x : α) => p x • MeasureTheory.OuterMeasure.dirac x
Instances For
Slightly stronger than OuterMeasure.mono
having an intersection with p.support
.
Since every set is Carathéodory-measurable under PMF.toOuterMeasure
,
we can further extend this OuterMeasure
to a Measure
on α
.
Equations
Instances For
Given that α
is a countable, measurable space with all singleton sets measurable,
we can convert any probability measure into a PMF
, where the mass of a point
is the measure of the singleton set under the original measure.
Equations
- MeasureTheory.Measure.toPMF μ = { val := fun (x : α) => ↑↑μ {x}, property := (_ : HasSum (fun (x : α) => ↑↑μ {x}) 1) }
Instances For
The measure associated to a PMF
by toMeasure
is a probability measure.
Equations
- (_ : MeasureTheory.IsProbabilityMeasure (PMF.toMeasure p)) = (_ : MeasureTheory.IsProbabilityMeasure (PMF.toMeasure p))