This is a beta course, so its structure, chapters, and examples may continue to change.
Covariance and the Correlation Coefficient
Definition of the Covariance
Mathematical Definition of the Covariance
Definition
A definition is a precise description of what a concept, a term, or an object means. Understanding definitions is the foundation of learning any field, and every concept has its own exact meaning.
Covariance
Let X and Y be two random variables. If both E(X) and E(Y) exist, then:
Cov(X,Y)=E[(X−E(X))(Y−E(Y))]
is called the covariance of X and Y.
Computation Formula for the Covariance
Discrete random variables:
Cov(X,Y)=∑i,j(xi−E(X))(yj−E(Y))P(X=xi,Y=yj)
Continuous random variables:
Cov(X,Y)=∫−∞+∞∫−∞+∞(x−E(X))(y−E(Y))f(x,y)dxdy
Simplified Computation Formula for the Covariance
Mathematical formula
A formula is a symbolic expression of quantitative relations and structural patterns, and an essential tool for solving mathematical problems. Key formulas should be mastered and applied flexibly.
Understanding: the covariance reflects the degree of linear correlation between two random variables. A positive value indicates a positive correlation, a negative value indicates a negative correlation, and a zero value indicates no correlation.
Examples of the Covariance
Example 1: suppose the joint distribution law of X and Y is:
Property 5: if X and Y are independent, then Cov(X,Y)=0
Proof: if X and Y are independent, then E(XY)=E(X)E(Y), so Cov(X,Y)=E(XY)−E(X)E(Y)=0
Note: the converse does not hold, that is, Cov(X,Y)=0 does not necessarily mean that X and Y are independent.
Definition of the Correlation Coefficient
Mathematical Definition of the Correlation Coefficient
Definition
A definition is a precise description of what a concept, a term, or an object means. Understanding definitions is the foundation of learning any field, and every concept has its own exact meaning.
Correlation Coefficient
Let X and Y be two random variables with D(X)>0 and D(Y)>0. Then:
ρXY=D(X)D(Y)Cov(X,Y)=σXσYCov(X,Y)
is called the correlation coefficient of X and Y, where σX=D(X) and σY=D(Y).
Properties of the Correlation Coefficient
Property 1: −1≤ρXY≤1
Proof: use the Cauchy-Schwarz inequality:
∣E[(X−E(X))(Y−E(Y))]∣≤E[(X−E(X))2]E[(Y−E(Y))2]
Hence ∣Cov(X,Y)∣≤σXσY, that is, ∣ρXY∣≤1.
Property 2: ρXY=1 if and only if Y=aX+b, where a>0
Property 3: ρXY=−1 if and only if Y=aX+b, where a<0
Property 4: ρXY=0 if and only if Cov(X,Y)=0
Intuitive Understanding of the Correlation Coefficient
Understanding:
ρXY=1: perfect positive correlation
ρXY=−1: perfect negative correlation
ρXY=0: no correlation
0<ρXY<1: positive correlation
−1<ρXY<0: negative correlation
Examples of the Correlation Coefficient
Example 2: continuing Example 1, find ρXY.
Solution:
D(X)=E(X2)−[E(X)]2=0.5−0.25=0.25
D(Y)=E(Y2)−[E(Y)]2=0.5−0.25=0.25
σX=σY=0.25=0.5
ρXY=σXσYCov(X,Y)=0.5×0.50.05=0.2
Covariance Matrix
Covariance Matrix of a Two-Dimensional Random Variable
Definition
A definition is a precise description of what a concept, a term, or an object means. Understanding definitions is the foundation of learning any field, and every concept has its own exact meaning.
Covariance Matrix
Let (X,Y) be a two-dimensional random variable. Its covariance matrix is:
Property 1: the covariance matrix is a symmetric matrix
Property 2: the covariance matrix is a positive semidefinite matrix
Property 3: if X and Y are independent, then the covariance matrix is a diagonal matrix
Covariance of Multidimensional Random Variables
Covariance Matrix of a Multidimensional Random Variable
Definition
A definition is a precise description of what a concept, a term, or an object means. Understanding definitions is the foundation of learning any field, and every concept has its own exact meaning.
Covariance Matrix (Multidimensional Case)
Let X=(X1,X2,…,Xn)T be an n-dimensional random variable. Its covariance matrix is: