# 协方差

“Covariance”的各地常用译名

## 定义

${\displaystyle \Omega }$ 样本空间${\displaystyle P}$  是定义在 ${\displaystyle \Omega }$ 事件族 ${\displaystyle \Sigma }$  上的概率。（换句话说， ${\displaystyle (\Omega ,\,\Sigma ,\,P)}$  是个概率空间

${\displaystyle X}$ ${\displaystyle Y}$  是定义在 ${\displaystyle \Omega }$  上的两个实数随机变量期望值分别为：

${\displaystyle \operatorname {E} (X)=\int _{\Omega }X\,dP=\mu }$
${\displaystyle \operatorname {E} (Y)=\int _{\Omega }Y\,dP=\nu }$

${\displaystyle \operatorname {cov} (X,Y)=\operatorname {E} [(X-\mu )(Y-\nu )]}$

{\displaystyle {\begin{aligned}\operatorname {cov} (X,Y)&=\int _{\Omega }(X-\mu )(Y-\nu )\,dP\\&=\int _{\Omega }X\cdot Y\,dP-\mu \int _{\Omega }Y\,dP-\nu \int _{\Omega }X\,dP+\mu \nu \\&=\operatorname {E} (X\cdot Y)-\mu \nu \end{aligned}}}

## 协方差矩阵

${\displaystyle (\Omega ,\,\Sigma ,\,P)}$ 概率空间${\displaystyle X=\{x_{i}\}_{i=1}^{m}}$ ${\displaystyle Y=\{y_{j}\}_{j=1}^{n}}$  是定义在 ${\displaystyle \Omega }$  上的两列实数随机变量序列（也可视为有序对行向量

${\displaystyle E(x_{i})=\int _{\Omega }x_{i}\,dP=\mu _{i}}$
${\displaystyle E(y_{j})=\int _{\Omega }y_{j}\,dP=\nu _{j}}$

${\displaystyle \operatorname {\mathbf {cov} } (X,Y):={\left[\,\operatorname {cov} (x_{i},y_{j})\,\right]}_{m\times n}}$

${\displaystyle \operatorname {\mathbf {cov} } (X,Y):={\begin{bmatrix}\operatorname {cov} (x_{1},y_{1})&\dots &\operatorname {cov} (x_{1},y_{n})\\\vdots &\ddots &\vdots \\\operatorname {cov} (x_{m},y_{1})&\dots &\operatorname {cov} (x_{m},y_{n})\end{bmatrix}}={\begin{bmatrix}\operatorname {E} (x_{1}y_{1})-\mu _{1}\nu _{1}&\dots &\operatorname {E} (x_{1}y_{n})-\mu _{1}\nu _{n}\\\vdots &\ddots &\vdots \\\operatorname {E} (x_{m}y_{1})-\mu _{m}\nu _{1}&\dots &\operatorname {E} (x_{m}y_{n})-\mu _{m}\nu _{n}\end{bmatrix}}}$

## 性质

### 统计独立

${\displaystyle \operatorname {cov} (X,Y)=0}$

### 计算性质

${\displaystyle \operatorname {cov} (X,X)=\operatorname {var} (X)}$
${\displaystyle \operatorname {cov} (X,Y)=\operatorname {cov} (Y,X)}$
${\displaystyle \operatorname {cov} (aX,bY)=ab\,\operatorname {cov} (X,Y)}$

${\displaystyle \operatorname {cov} \left(\sum _{i=1}^{n}{X_{i}},\sum _{j=1}^{m}{Y_{j}}\right)=\sum _{i=1}^{n}{\sum _{j=1}^{m}{\operatorname {cov} \left(X_{i},Y_{j}\right)}}}$

${\displaystyle \operatorname {var} \left(\sum _{i=1}^{n}X_{i}\right)=\sum _{i=1}^{n}\operatorname {var} (X_{i})+2\sum _{i,j\,:\,i

## 相关系数

${\displaystyle \eta ={\dfrac {\operatorname {cov} (X,Y)}{\sqrt {\operatorname {var} (X)\cdot \operatorname {var} (Y)}}}\ ,}$