How do you go from $E[X]$ equation to $Var(x)$ equation in the picture?

56 Views Asked by At

On the following picture, how do you go from equation 4 to 6? I just don't get how variance can be derived from expected value.

Thank you so much

1

2

There are 2 best solutions below

14
On

$$\begin{align}&\mathsf E(X) \\[2ex]=~&\mathsf E(\mathsf{Var}(X\mid L))+\mathsf{Var}(\mathsf E(X\mid L))&&\text{Law of Total Variance} \\[2ex] =~&\mathsf E(\mathsf {Var}(\sum_{t=1}^LD_t\mid L))+\mathsf{Var}(\mathsf E(\sum_{t=1}^L D_t\mid L))&&X=\sum_{t=1}^LD_t \\[2ex] =~&\mathsf E(\sum_{t=1}^L\mathsf {Var}(D_t\mid L))+\mathsf{Var}(\sum_{t=1}^L\mathsf E( D_t\mid L))&&{\text{Linearity of Expectation,}\\\text{ Bilinearity of Covariance}\\\text{ and uncorrelation of all $D_t$}} \\[2ex] =~&\mathsf E(\sum_{t=1}^L~\mathsf{Var}(D_t))+\mathsf{Var}(\sum_{t=1}^L~\mathsf E(D_t))&&\text{independence of $L$ and $D_t$} \\[2ex]=~&\mathsf E(L~\mathsf{Var}(D_1))+\mathsf{Var}(L~\mathsf E(D_1))&&\text{identical distribution of all $D_t$} \\[2ex]=~&\mathsf E(L)~\mathsf{Var}(D_1)+\mathsf{Var}(L)~\mathsf E(D_1)^2&&{\text{expectation, and variance,}\\\text{ of a scalar product of a RV}}\end{align}$$

0
On

You should state that the random variables $\{D_{t}\}$ is i.i.d, and is independent to the random variable $L$, then we can get the following deduction:

\begin{align*} Var(X) &=E[X^2]-E[X]^2=E\left[(\sum^{L}_{t=1}D_t)^2\right]-E[X]^2 \\ &=E\left[\sum^{L}_{t=1}D^2_t+\sum^{L}_{i=1}\sum^{L}_{j=1,j\neq i}D_iD_j\right]-l^2d^2 \\ &=E[L]E[D^2_t]+E(D_i)E[D_j]E[L(L-1)]-l^2d^2 \\ &=l(d^2+\sigma^2_D)+d^2(l^2-l+\sigma^2_L)-l^2d^2 \\ &=l\sigma^2_D+d^2\sigma^2_L. \end{align*}