The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V20. Probability

Mathlib.Probability.Distributions.Gamma

16 declarations. Mathlib docs · Source

Gamma distributions over ℝ

Define the gamma measure over the reals.

Main definitions

  • gammaPDFReal: the function a r x ↦ r ^ a / (Gamma a) * x ^ (a - 1) * exp (-(r * x)) for 0 ≤ x or 0 else, which is the probability density function of a gamma distribution with shape a and rate r (when ha : 0 < a and hr : 0 < r).
  • gammaPDF: ℝ≥0∞-valued pdf, gammaPDF a r = ENNReal.ofReal (gammaPDFReal a r).
  • gammaMeasure: a gamma measure on ℝ, parametrized by its shape a and rate r.

theorem lintegral_Iic_eq_lintegral_Iio_add_Icc E1 #

∀ {y z : ℝ} (f : ℝ → ENNReal),
  z ≤ y → ∫⁻ (x : ℝ) in Set.Iic y, f x = (∫⁻ (x : ℝ) in Set.Iio z, f x) + ∫⁻ (x : ℝ) in Set.Icc z y, f x

A Lebesgue Integral from -∞ to y can be expressed as the sum of one from -∞ to 0 and 0 to x

def ProbabilityTheory.gammaPDFReal E3 #

ℝ → ℝ → ℝ → ℝ

The pdf of the gamma distribution depending on its scale and rate

def ProbabilityTheory.gammaPDF E3 #

ℝ → ℝ → ℝ → ENNReal

The pdf of the gamma distribution, as a function valued in ℝ≥0∞

theorem ProbabilityTheory.gammaPDF_eq E0 #

∀ (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 E1 #

∀ {a r x : ℝ}, x < 0 → ProbabilityTheory.gammaPDF a r x = 0

theorem ProbabilityTheory.gammaPDF_of_nonneg E1 #

∀ {a r x : ℝ},
  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 E1 #

∀ {x a r : ℝ}, 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

theorem ProbabilityTheory.measurable_gammaPDFReal E1 #

∀ (a r : ℝ), Measurable (ProbabilityTheory.gammaPDFReal a r)

The gamma pdf is measurable.

theorem ProbabilityTheory.stronglyMeasurable_gammaPDFReal E1 #

∀ (a r : ℝ), MeasureTheory.StronglyMeasurable (ProbabilityTheory.gammaPDFReal a r)

The gamma pdf is strongly measurable

theorem ProbabilityTheory.gammaPDFReal_pos E1 #

∀ {x a r : ℝ}, 0 < a → 0 < r → 0 < x → 0 < ProbabilityTheory.gammaPDFReal a r x

The gamma pdf is positive for all positive reals

theorem ProbabilityTheory.gammaPDFReal_nonneg E1 #

∀ {a r : ℝ}, 0 < a → 0 < r → ∀ (x : ℝ), 0 ≤ ProbabilityTheory.gammaPDFReal a r x

The gamma pdf is nonnegative

theorem ProbabilityTheory.lintegral_gammaPDF_eq_one E0 #

∀ {a r : ℝ}, 0 < a → 0 < r → ∫⁻ (x : ℝ), ProbabilityTheory.gammaPDF a r x = 1

The pdf of the gamma distribution integrates to 1

def ProbabilityTheory.gammaMeasure E3 #

ℝ → ℝ → MeasureTheory.Measure ℝ

Measure defined by the gamma distribution

theorem ProbabilityTheory.isProbabilityMeasure_gammaMeasure E1 #

∀ {a r : ℝ}, 0 < a → 0 < r → MeasureTheory.IsProbabilityMeasure (ProbabilityTheory.gammaMeasure a r)

theorem ProbabilityTheory.cdf_gammaMeasure_eq_integral E1 #

∀ {a r : ℝ},
  0 < a →
    0 < r →
      ∀ (x : ℝ),
        ↑(ProbabilityTheory.cdf (ProbabilityTheory.gammaMeasure a r)) x =
          ∫ (x : ℝ) in Set.Iic x, ProbabilityTheory.gammaPDFReal a r x

theorem ProbabilityTheory.cdf_gammaMeasure_eq_lintegral E1 #

∀ {a r : ℝ},
  0 < a →
    0 < r →
      ∀ (x : ℝ),
        ↑(ProbabilityTheory.cdf (ProbabilityTheory.gammaMeasure a r)) x =
          (∫⁻ (x : ℝ) in Set.Iic x, ProbabilityTheory.gammaPDF a r x).toReal