Documentation

Mathlib.Probability.Moments.Covariance

Covariance #

We define the covariance of two real-valued random variables.

Main definitions #

Main statements #

Notation #

noncomputable def ProbabilityTheory.covariance {Ω : Type u_1} { : MeasurableSpace Ω} (X Y : Ω) (μ : MeasureTheory.Measure Ω) :

The covariance of two real-valued random variables defined as the integral of (X - 𝔼[X])(Y - 𝔼[Y]).

Equations
Instances For

    The covariance of two real-valued random variables defined as the integral of (X - 𝔼[X])(Y - 𝔼[Y]).

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      The covariance of the real-valued random variables X and Y according to the volume measure.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        theorem ProbabilityTheory.covariance_eq_sub {Ω : Type u_1} { : MeasurableSpace Ω} {X Y : Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] (hX : MeasureTheory.MemLp X 2 μ) (hY : MeasureTheory.MemLp Y 2 μ) :
        covariance X Y μ = (x : Ω), (X * Y) x μ - ( (x : Ω), X x μ) * (x : Ω), Y x μ
        @[simp]
        theorem ProbabilityTheory.covariance_zero_left {Ω : Type u_1} { : MeasurableSpace Ω} {Y : Ω} {μ : MeasureTheory.Measure Ω} :
        covariance 0 Y μ = 0
        @[simp]
        theorem ProbabilityTheory.covariance_zero_right {Ω : Type u_1} { : MeasurableSpace Ω} {X : Ω} {μ : MeasureTheory.Measure Ω} :
        covariance X 0 μ = 0
        @[simp]
        theorem ProbabilityTheory.covariance_zero_measure {Ω : Type u_1} { : MeasurableSpace Ω} {X Y : Ω} :
        covariance X Y 0 = 0
        theorem ProbabilityTheory.covariance_comm {Ω : Type u_1} { : MeasurableSpace Ω} (X Y : Ω) {μ : MeasureTheory.Measure Ω} :
        covariance X Y μ = covariance Y X μ
        @[simp]
        theorem ProbabilityTheory.covariance_const_left {Ω : Type u_1} { : MeasurableSpace Ω} {Y : Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] (c : ) :
        covariance (fun (x : Ω) => c) Y μ = 0
        @[simp]
        theorem ProbabilityTheory.covariance_const_right {Ω : Type u_1} { : MeasurableSpace Ω} {X : Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] (c : ) :
        covariance X (fun (x : Ω) => c) μ = 0
        @[simp]
        theorem ProbabilityTheory.covariance_add_const_left {Ω : Type u_1} { : MeasurableSpace Ω} {X Y : Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] (hX : MeasureTheory.Integrable X μ) (c : ) :
        covariance (fun (ω : Ω) => X ω + c) Y μ = covariance X Y μ
        @[simp]
        theorem ProbabilityTheory.covariance_const_add_left {Ω : Type u_1} { : MeasurableSpace Ω} {X Y : Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] (hX : MeasureTheory.Integrable X μ) (c : ) :
        covariance (fun (ω : Ω) => c + X ω) Y μ = covariance X Y μ
        @[simp]
        theorem ProbabilityTheory.covariance_add_const_right {Ω : Type u_1} { : MeasurableSpace Ω} {X Y : Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] (hY : MeasureTheory.Integrable Y μ) (c : ) :
        covariance X (fun (ω : Ω) => Y ω + c) μ = covariance X Y μ
        @[simp]
        theorem ProbabilityTheory.covariance_const_add_right {Ω : Type u_1} { : MeasurableSpace Ω} {X Y : Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] (hY : MeasureTheory.Integrable Y μ) (c : ) :
        covariance X (fun (ω : Ω) => c + Y ω) μ = covariance X Y μ
        theorem ProbabilityTheory.covariance_add_left {Ω : Type u_1} { : MeasurableSpace Ω} {X Y Z : Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsFiniteMeasure μ] (hX : MeasureTheory.MemLp X 2 μ) (hY : MeasureTheory.MemLp Y 2 μ) (hZ : MeasureTheory.MemLp Z 2 μ) :
        covariance (X + Y) Z μ = covariance X Z μ + covariance Y Z μ
        theorem ProbabilityTheory.covariance_add_right {Ω : Type u_1} { : MeasurableSpace Ω} {X Y Z : Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsFiniteMeasure μ] (hX : MeasureTheory.MemLp X 2 μ) (hY : MeasureTheory.MemLp Y 2 μ) (hZ : MeasureTheory.MemLp Z 2 μ) :
        covariance X (Y + Z) μ = covariance X Y μ + covariance X Z μ
        theorem ProbabilityTheory.covariance_smul_left {Ω : Type u_1} { : MeasurableSpace Ω} {X Y : Ω} {μ : MeasureTheory.Measure Ω} (c : ) :
        covariance (c X) Y μ = c * covariance X Y μ
        theorem ProbabilityTheory.covariance_smul_right {Ω : Type u_1} { : MeasurableSpace Ω} {X Y : Ω} {μ : MeasureTheory.Measure Ω} (c : ) :
        covariance X (c Y) μ = c * covariance X Y μ
        theorem ProbabilityTheory.covariance_mul_left {Ω : Type u_1} { : MeasurableSpace Ω} {X Y : Ω} {μ : MeasureTheory.Measure Ω} (c : ) :
        covariance (fun (ω : Ω) => c * X ω) Y μ = c * covariance X Y μ
        theorem ProbabilityTheory.covariance_mul_right {Ω : Type u_1} { : MeasurableSpace Ω} {X Y : Ω} {μ : MeasureTheory.Measure Ω} (c : ) :
        covariance X (fun (ω : Ω) => c * Y ω) μ = c * covariance X Y μ
        @[simp]
        theorem ProbabilityTheory.covariance_neg_left {Ω : Type u_1} { : MeasurableSpace Ω} {X Y : Ω} {μ : MeasureTheory.Measure Ω} :
        covariance (-X) Y μ = -covariance X Y μ
        @[simp]
        theorem ProbabilityTheory.covariance_fun_neg_left {Ω : Type u_1} { : MeasurableSpace Ω} {X Y : Ω} {μ : MeasureTheory.Measure Ω} :
        covariance (fun (ω : Ω) => -X ω) Y μ = -covariance X Y μ
        @[simp]
        theorem ProbabilityTheory.covariance_neg_right {Ω : Type u_1} { : MeasurableSpace Ω} {X Y : Ω} {μ : MeasureTheory.Measure Ω} :
        covariance X (-Y) μ = -covariance X Y μ
        @[simp]
        theorem ProbabilityTheory.covariance_fun_neg_right {Ω : Type u_1} { : MeasurableSpace Ω} {X Y : Ω} {μ : MeasureTheory.Measure Ω} :
        covariance X (fun (ω : Ω) => -Y ω) μ = -covariance X Y μ
        theorem ProbabilityTheory.covariance_sub_left {Ω : Type u_1} { : MeasurableSpace Ω} {X Y Z : Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsFiniteMeasure μ] (hX : MeasureTheory.MemLp X 2 μ) (hY : MeasureTheory.MemLp Y 2 μ) (hZ : MeasureTheory.MemLp Z 2 μ) :
        covariance (X - Y) Z μ = covariance X Z μ - covariance Y Z μ
        theorem ProbabilityTheory.covariance_sub_right {Ω : Type u_1} { : MeasurableSpace Ω} {X Y Z : Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsFiniteMeasure μ] (hX : MeasureTheory.MemLp X 2 μ) (hY : MeasureTheory.MemLp Y 2 μ) (hZ : MeasureTheory.MemLp Z 2 μ) :
        covariance X (Y - Z) μ = covariance X Y μ - covariance X Z μ
        @[simp]
        theorem ProbabilityTheory.covariance_sub_const_left {Ω : Type u_1} { : MeasurableSpace Ω} {X Y : Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] (hX : MeasureTheory.Integrable X μ) (c : ) :
        covariance (fun (ω : Ω) => X ω - c) Y μ = covariance X Y μ
        @[simp]
        theorem ProbabilityTheory.covariance_const_sub_left {Ω : Type u_1} { : MeasurableSpace Ω} {X Y : Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] (hX : MeasureTheory.Integrable X μ) (c : ) :
        covariance (fun (ω : Ω) => c - X ω) Y μ = -covariance X Y μ
        @[simp]
        theorem ProbabilityTheory.covariance_sub_const_right {Ω : Type u_1} { : MeasurableSpace Ω} {X Y : Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] (hY : MeasureTheory.Integrable Y μ) (c : ) :
        covariance X (fun (ω : Ω) => Y ω - c) μ = covariance X Y μ
        @[simp]
        theorem ProbabilityTheory.covariance_const_sub_right {Ω : Type u_1} { : MeasurableSpace Ω} {X Y : Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] (hY : MeasureTheory.Integrable Y μ) (c : ) :
        covariance X (fun (ω : Ω) => c - Y ω) μ = -covariance X Y μ
        theorem ProbabilityTheory.covariance_sum_left' {Ω : Type u_1} { : MeasurableSpace Ω} {Y : Ω} {μ : MeasureTheory.Measure Ω} {ι : Type u_2} {X : ιΩ} {s : Finset ι} [MeasureTheory.IsFiniteMeasure μ] (hX : is, MeasureTheory.MemLp (X i) 2 μ) (hY : MeasureTheory.MemLp Y 2 μ) :
        covariance (∑ is, X i) Y μ = is, covariance (X i) Y μ
        theorem ProbabilityTheory.covariance_sum_left {Ω : Type u_1} { : MeasurableSpace Ω} {Y : Ω} {μ : MeasureTheory.Measure Ω} {ι : Type u_2} {X : ιΩ} [MeasureTheory.IsFiniteMeasure μ] [Fintype ι] (hX : ∀ (i : ι), MeasureTheory.MemLp (X i) 2 μ) (hY : MeasureTheory.MemLp Y 2 μ) :
        covariance (∑ i : ι, X i) Y μ = i : ι, covariance (X i) Y μ
        theorem ProbabilityTheory.covariance_fun_sum_left' {Ω : Type u_1} { : MeasurableSpace Ω} {Y : Ω} {μ : MeasureTheory.Measure Ω} {ι : Type u_2} {X : ιΩ} {s : Finset ι} [MeasureTheory.IsFiniteMeasure μ] (hX : is, MeasureTheory.MemLp (X i) 2 μ) (hY : MeasureTheory.MemLp Y 2 μ) :
        covariance (fun (ω : Ω) => is, X i ω) Y μ = is, covariance (X i) Y μ
        theorem ProbabilityTheory.covariance_fun_sum_left {Ω : Type u_1} { : MeasurableSpace Ω} {Y : Ω} {μ : MeasureTheory.Measure Ω} {ι : Type u_2} {X : ιΩ} [MeasureTheory.IsFiniteMeasure μ] [Fintype ι] (hX : ∀ (i : ι), MeasureTheory.MemLp (X i) 2 μ) (hY : MeasureTheory.MemLp Y 2 μ) :
        covariance (fun (ω : Ω) => i : ι, X i ω) Y μ = i : ι, covariance (X i) Y μ
        theorem ProbabilityTheory.covariance_sum_right' {Ω : Type u_1} { : MeasurableSpace Ω} {Y : Ω} {μ : MeasureTheory.Measure Ω} {ι : Type u_2} {X : ιΩ} {s : Finset ι} [MeasureTheory.IsFiniteMeasure μ] (hX : is, MeasureTheory.MemLp (X i) 2 μ) (hY : MeasureTheory.MemLp Y 2 μ) :
        covariance Y (∑ is, X i) μ = is, covariance Y (X i) μ
        theorem ProbabilityTheory.covariance_sum_right {Ω : Type u_1} { : MeasurableSpace Ω} {Y : Ω} {μ : MeasureTheory.Measure Ω} {ι : Type u_2} {X : ιΩ} [MeasureTheory.IsFiniteMeasure μ] [Fintype ι] (hX : ∀ (i : ι), MeasureTheory.MemLp (X i) 2 μ) (hY : MeasureTheory.MemLp Y 2 μ) :
        covariance Y (∑ i : ι, X i) μ = i : ι, covariance Y (X i) μ
        theorem ProbabilityTheory.covariance_fun_sum_right' {Ω : Type u_1} { : MeasurableSpace Ω} {Y : Ω} {μ : MeasureTheory.Measure Ω} {ι : Type u_2} {X : ιΩ} {s : Finset ι} [MeasureTheory.IsFiniteMeasure μ] (hX : is, MeasureTheory.MemLp (X i) 2 μ) (hY : MeasureTheory.MemLp Y 2 μ) :
        covariance Y (fun (ω : Ω) => is, X i ω) μ = is, covariance Y (X i) μ
        theorem ProbabilityTheory.covariance_fun_sum_right {Ω : Type u_1} { : MeasurableSpace Ω} {Y : Ω} {μ : MeasureTheory.Measure Ω} {ι : Type u_2} {X : ιΩ} [MeasureTheory.IsFiniteMeasure μ] [Fintype ι] (hX : ∀ (i : ι), MeasureTheory.MemLp (X i) 2 μ) (hY : MeasureTheory.MemLp Y 2 μ) :
        covariance Y (fun (ω : Ω) => i : ι, X i ω) μ = i : ι, covariance Y (X i) μ
        theorem ProbabilityTheory.covariance_sum_sum' {Ω : Type u_1} { : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} {ι : Type u_2} {X : ιΩ} {s : Finset ι} [MeasureTheory.IsFiniteMeasure μ] {ι' : Type u_3} {Y : ι'Ω} {t : Finset ι'} (hX : is, MeasureTheory.MemLp (X i) 2 μ) (hY : it, MeasureTheory.MemLp (Y i) 2 μ) :
        covariance (∑ is, X i) (∑ jt, Y j) μ = is, jt, covariance (X i) (Y j) μ
        theorem ProbabilityTheory.covariance_sum_sum {Ω : Type u_1} { : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} {ι : Type u_2} {X : ιΩ} [MeasureTheory.IsFiniteMeasure μ] [Fintype ι] {ι' : Type u_3} [Fintype ι'] {Y : ι'Ω} (hX : ∀ (i : ι), MeasureTheory.MemLp (X i) 2 μ) (hY : ∀ (i : ι'), MeasureTheory.MemLp (Y i) 2 μ) :
        covariance (∑ i : ι, X i) (∑ j : ι', Y j) μ = i : ι, j : ι', covariance (X i) (Y j) μ
        theorem ProbabilityTheory.covariance_fun_sum_fun_sum' {Ω : Type u_1} { : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} {ι : Type u_2} {X : ιΩ} {s : Finset ι} [MeasureTheory.IsFiniteMeasure μ] {ι' : Type u_3} {Y : ι'Ω} {t : Finset ι'} (hX : is, MeasureTheory.MemLp (X i) 2 μ) (hY : it, MeasureTheory.MemLp (Y i) 2 μ) :
        covariance (fun (ω : Ω) => is, X i ω) (fun (ω : Ω) => jt, Y j ω) μ = is, jt, covariance (X i) (Y j) μ
        theorem ProbabilityTheory.covariance_fun_sum_fun_sum {Ω : Type u_1} { : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} {ι : Type u_2} {X : ιΩ} [MeasureTheory.IsFiniteMeasure μ] [Fintype ι] {ι' : Type u_3} [Fintype ι'] {Y : ι'Ω} (hX : ∀ (i : ι), MeasureTheory.MemLp (X i) 2 μ) (hY : ∀ (i : ι'), MeasureTheory.MemLp (Y i) 2 μ) :
        covariance (fun (ω : Ω) => i : ι, X i ω) (fun (ω : Ω) => j : ι', Y j ω) μ = i : ι, j : ι', covariance (X i) (Y j) μ
        theorem ProbabilityTheory.covariance_map_equiv {Ω : Type u_1} { : MeasurableSpace Ω} {Ω' : Type u_2} {mΩ' : MeasurableSpace Ω'} {μ : MeasureTheory.Measure Ω'} (X Y : Ω) (Z : Ω' ≃ᵐ Ω) :
        covariance X Y (MeasureTheory.Measure.map (⇑Z) μ) = covariance (X Z) (Y Z) μ
        theorem ProbabilityTheory.covariance_map_fun {Ω : Type u_1} { : MeasurableSpace Ω} {X Y : Ω} {Ω' : Type u_2} {mΩ' : MeasurableSpace Ω'} {μ : MeasureTheory.Measure Ω'} {Z : Ω'Ω} (hX : MeasureTheory.AEStronglyMeasurable X (MeasureTheory.Measure.map Z μ)) (hY : MeasureTheory.AEStronglyMeasurable Y (MeasureTheory.Measure.map Z μ)) (hZ : AEMeasurable Z μ) :
        covariance X Y (MeasureTheory.Measure.map Z μ) = covariance (fun (ω : Ω') => X (Z ω)) (fun (ω : Ω') => Y (Z ω)) μ
        theorem ProbabilityTheory.IndepFun.covariance_eq_zero {Ω : Type u_1} { : MeasurableSpace Ω} {X Y : Ω} {μ : MeasureTheory.Measure Ω} (h : IndepFun X Y μ) (hX : MeasureTheory.MemLp X 2 μ) (hY : MeasureTheory.MemLp Y 2 μ) :
        covariance X Y μ = 0