Var[X]=E[(X−E[X])2]=E[X2]−(E(X))2 Var[X]=E[(X-E[X])^{2}]=E[X^{2}]-(E(X))^{2} Var[X]=E[(X−E[X])2]=E[X2]−(E(X))2
Var[X]=E[X2]−(E[X])2=∫−∞∞x2f(x) dx−(∫−∞∞xf(x) dx)2 Var[X]=E[X^{2}]-(E[X])^{2}=\int_{-\infty}^{\infty}x^{2}f(x)\,dx-\left(\int_{-\infty}^{\infty}xf(x)\,dx\right)^{2} Var[X]=E[X2]−(E[X])2=∫−∞∞x2f(x)dx−(∫−∞∞xf(x)dx)2
因为期望运算与实数运算满足结合律,所以有以下推导
E[(X−E[X])2]=E[X2−2E[X]X+(E[X])2]=E[X2]−E[2E[X]X+(E[X])2]=E[X2]−[2E[X]E[X]+(E[X])2]=E[X2]−(E(X))2 \begin{align*} &E[(X-E[X])^{2}]\\ =&E\left[X^{2}-2E[X]X+(E[X])^{2}\right]\\ =&E[X^{2}]-E\left[2E[X]X+(E[X])^{2}\right]\\ =&E[X^{2}]-\left[2E[X]E[X]+(E[X])^{2}\right]\\ =&E[X^{2}]-(E(X))^{2}\\ \end{align*} ====E[(X−E[X])2]E[X2−2E[X]X+(E[X])2]E[X2]−E[2E[X]X+(E[X])2]E[X2]−[2E[X]E[X]+(E[X])2]E[X2]−(E(X))2
方差可看作协方差的随机变量的X,YX,YX,Y为同一变量时的特殊情况