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_same {Ω : Type u_1} { : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} {X : Ω} (hX : AEMeasurable X μ) :
        covariance X X μ = variance 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 μ
        @[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 μ