Median of a distribution
DefinitionMedian of a measure on the real line#✓fully proved
Let \(\nu\) be a measure on \(\mathbb{R}\), typically a probability measure. A real number \(m\) is a median of \(\nu\) when \(\nu((-\infty, m]) \ge 1/2\) and \(\nu([m, \infty)) \ge 1/2\), where a set of infinite measure counts as having measure \(0\).
TheoremAbsolute deviations are integrable exactly when the mean exists#✓fully proved
Let \(\nu\) be a finite measure on \(\mathbb{R}\) and let \(c \in \mathbb{R}\). Then \(\theta \mapsto |\theta - c|\) is \(\nu\)-integrable if and only if \(\theta \mapsto \theta\) is \(\nu\)-integrable.
theorem integrable_abs_sub_iff (ν : Measure ℝ) [IsFiniteMeasure ν] (c : ℝ) :
Integrable (fun θ => |θ - c|) ν ↔ Integrable (fun θ : ℝ => θ) ν
TheoremA median minimizes the expected absolute loss#✓fully proved
Let \(\nu\) be a probability measure on \(\mathbb{R}\) and let \(m\) be a median of \(\nu\). Then for every \(y \in \mathbb{R}\),
When \(\nu\) has no first moment, neither integrand is integrable and both integrals are \(0\) by the convention for non-integrable functions.
theorem integral_abs_sub_le_of_isMedian (ν : Measure ℝ) [IsProbabilityMeasure ν] {m : ℝ}
(hm : IsMedian ν m) (y : ℝ) : ∫ θ, |θ - m| ∂ν ≤ ∫ θ, |θ - y| ∂ν
def IsMedian (ν : Measure ℝ) (m : ℝ) : Prop :=
1 / 2 ≤ ν.real (Iic m) ∧ 1 / 2 ≤ ν.real (Ici m)
MathlibExt/Probability/Median.lean:34
Uses 2 · Used by 1
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.