Geometric distributions #
We define the geometric distributions over natural numbers. For 0 < p ≤ 1, geometricMeasure p
is the measure which to {n} associates (1 - p) ^ n * n.
As the parameter p needs to lie between 0 and 1, we define geometricMeasure p with
p : unitInterval.
Imagine a certain experience which has success probability p. If you repeat this experience
infintely many times and independently, the number of failures before the first success
follows a geometric distribution with parameter p.
Main definition #
geometricMeasure p: a geometric measure on a semiringR, parametrized by its success probabilityp.
Implementation note #
To avoid having to carry around a hypothesis p ≠ 0, we define
geometricMeasure 0 := Measure.dirac 0. That way IsProbabilityMeasure (geometricMeasure p)
can be automatically inferred.
Tags #
geometric distribution
The geometric measure with success probability p as a measure over ℕ.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The positivty tactic does not work for this goal. Use this lemma to rewrite
(ENNReal.ofReal ((1 - p) ^ n * p)).toReal = (1 - p) ^ n * p.
If a function is integrable with respect to geometricMeasure p, then its integral
against this measure is given by its sum weighted by (1 - p) ^ n * p.
See integral_geometricMeasure for a version where the codomain is finite-dimensional
and does not require the integrability hypothesis.
The integral of a function taking values in a finite-dimensional space
against geometricMeasure p is given by its sum weighted by (1 - p) ^ n * p. This version
does not require integrability, as the integral exists if and only if the sum exists, and otherwise
they are both defined to be zero.
See integral_geometricMeasure' with a general codomain which assumes integrability.
The pmf of the geometric distribution depending on its success probability.
Equations
- ProbabilityTheory.geometricPMFReal p n = (1 - p) ^ n * p
Instances For
Geometric distribution with success probability p.
Equations
- ProbabilityTheory.geometricPMF hp_pos hp_le_one = ⟨fun (n : ℕ) => ENNReal.ofReal (ProbabilityTheory.geometricPMFReal p n), ⋯⟩