# 方差

“Variance”的各地常用别名

## 定义

${\displaystyle \operatorname {Var} (X)=\operatorname {E} \left[(X-\mu )^{2}\right]}$

${\displaystyle \operatorname {Var} (X)=\operatorname {Cov} (X,X)}$

${\displaystyle \operatorname {Var} (X)=\operatorname {E} \left[X^{2}-2X\operatorname {E} [X]+(\operatorname {E} [X])^{2}\right]=\operatorname {E} \left[X^{2}\right]-2\operatorname {E} [X]\operatorname {E} [X]+(\operatorname {E} [X])^{2}=\operatorname {E} \left[X^{2}\right]-(\operatorname {E} [X])^{2}}$

### 离散随机变量

${\displaystyle \operatorname {Var} (X)=\sum _{i=1}^{n}p_{i}\cdot (x_{i}-\mu )^{2}=\sum _{i=1}^{n}(p_{i}\cdot x_{i}^{2})-\mu ^{2}}$

${\displaystyle \mu =\sum _{i=1}^{n}p_{i}\cdot x_{i}}$ .

X为有n个相等概率值的平均分布：

${\displaystyle \operatorname {Var} (X)=\sigma ^{2}={\frac {1}{n}}\sum _{i=1}^{n}(x_{i}-\mu )^{2}={\frac {1}{n}}\left(\sum _{i=1}^{n}x_{i}^{2}-n\mu ^{2}\right)={\frac {\sum _{i=1}^{n}x_{i}^{2}}{n}}-\mu ^{2}}$

n个相等概率值的方差亦可以点对点间的方变量表示为：

${\displaystyle \operatorname {Var} (X)={\frac {1}{n^{2}}}\sum _{i=1}^{n}\sum _{j=1}^{n}{\frac {1}{2}}(x_{i}-x_{j})^{2}}$

### 连续型随机变量

${\displaystyle \operatorname {Var} (X)=\sigma ^{2}=\int (x-\mu )^{2}\,f(x)\,dx\,=\int x^{2}\,f(x)\,dx\,-\mu ^{2}}$

${\displaystyle \mu =\int x\,f(x)\,dx\,}$

## 特性

${\displaystyle \operatorname {Var} (X)\geq 0}$

${\displaystyle P(X=a)=1\Leftrightarrow \operatorname {Var} (X)=0}$

${\displaystyle \operatorname {Var} (X+a)=\operatorname {Var} (X).}$

${\displaystyle \operatorname {Var} (aX)=a^{2}\operatorname {Var} (X)}$

${\displaystyle \operatorname {Var} (aX+bY)=a^{2}\operatorname {Var} (X)+b^{2}\operatorname {Var} (Y)+2ab\,\operatorname {Cov} (X,Y),}$
${\displaystyle \operatorname {Var} (X-Y)=\operatorname {Var} (X)+\operatorname {Var} (Y)-2\,\operatorname {Cov} (X,Y),}$

${\displaystyle \operatorname {Var} \left(\sum _{i=1}^{N}X_{i}\right)=\sum _{i,j=1}^{N}\operatorname {Cov} (X_{i},X_{j})=\sum _{i=1}^{N}\operatorname {Var} (X_{i})+\sum _{i\neq j}\operatorname {Cov} (X_{i},X_{j})}$