Gamma distributions over ℝ #
Define the gamma measure over the reals.
Main definitions #
gammaPDFReal
: the functiona r x ↦ r ^ a / (Gamma a) * x ^ (a-1) * exp (-(r * x))
for0 ≤ x
or0
else, which is the probability density function of a gamma distribution with shapea
and rater
(whenha : 0 < a
andhr : 0 < r
).gammaPDF
:ℝ≥0∞
-valued pdf,gammaPDF a r = ENNReal.ofReal (gammaPDFReal a r)
.gammaMeasure
: a gamma measure onℝ
, parametrized by its shapea
and rater
.gammaCDFReal
: the CDF given by the definition of CDF inProbabilityTheory.CDF
applied to the gamma measure.
The pdf of the gamma distribution, as a function valued in ℝ≥0∞
Equations
Instances For
theorem
ProbabilityTheory.gammaPDF_eq
(a : ℝ)
(r : ℝ)
(x : ℝ)
:
ProbabilityTheory.gammaPDF a r x = ENNReal.ofReal (if 0 ≤ x then r ^ a / Real.Gamma a * x ^ (a - 1) * Real.exp (-(r * x)) else 0)
theorem
ProbabilityTheory.gammaPDF_of_neg
{a : ℝ}
{r : ℝ}
{x : ℝ}
(hx : x < 0)
:
ProbabilityTheory.gammaPDF a r x = 0
theorem
ProbabilityTheory.gammaPDF_of_nonneg
{a : ℝ}
{r : ℝ}
{x : ℝ}
(hx : 0 ≤ x)
:
ProbabilityTheory.gammaPDF a r x = ENNReal.ofReal (r ^ a / Real.Gamma a * x ^ (a - 1) * Real.exp (-(r * x)))
theorem
ProbabilityTheory.lintegral_gammaPDF_of_nonpos
{x : ℝ}
{a : ℝ}
{r : ℝ}
(hx : x ≤ 0)
:
∫⁻ (y : ℝ) in Set.Iio x, ProbabilityTheory.gammaPDF a r y = 0
The Lebesgue integral of the gamma pdf over nonpositive reals equals 0
The gamma pdf is measurable.
The gamma pdf is strongly measurable
theorem
ProbabilityTheory.gammaPDFReal_pos
{x : ℝ}
{a : ℝ}
{r : ℝ}
(ha : 0 < a)
(hr : 0 < r)
(hx : 0 < x)
:
0 < ProbabilityTheory.gammaPDFReal a r x
The gamma pdf is positive for all positive reals
theorem
ProbabilityTheory.gammaPDFReal_nonneg
{a : ℝ}
{r : ℝ}
(ha : 0 < a)
(hr : 0 < r)
(x : ℝ)
:
0 ≤ ProbabilityTheory.gammaPDFReal a r x
The gamma pdf is nonnegative
@[simp]
theorem
ProbabilityTheory.lintegral_gammaPDF_eq_one
{a : ℝ}
{r : ℝ}
(ha : 0 < a)
(hr : 0 < r)
:
∫⁻ (x : ℝ), ProbabilityTheory.gammaPDF a r x = 1
The pdf of the gamma distribution integrates to 1
Measure defined by the gamma distribution
Equations
- ProbabilityTheory.gammaMeasure a r = MeasureTheory.volume.withDensity (ProbabilityTheory.gammaPDF a r)
Instances For
CDF of the gamma distribution
Equations
Instances For
theorem
ProbabilityTheory.gammaCDFReal_eq_integral
{a : ℝ}
{r : ℝ}
(ha : 0 < a)
(hr : 0 < r)
(x : ℝ)
:
↑(ProbabilityTheory.gammaCDFReal a r) x = ∫ (x : ℝ) in Set.Iic x, ProbabilityTheory.gammaPDFReal a r x
theorem
ProbabilityTheory.gammaCDFReal_eq_lintegral
{a : ℝ}
{r : ℝ}
(ha : 0 < a)
(hr : 0 < r)
(x : ℝ)
:
↑(ProbabilityTheory.gammaCDFReal a r) x = (∫⁻ (x : ℝ) in Set.Iic x, ProbabilityTheory.gammaPDF a r x).toReal