[Math] Covariance dependent Binomial variables

probabilitystatistics

Suppose $Y \sim \mathrm{Bin}(n,p)$ given $\Theta=(p,q)$ and $Z \sim \mathrm{Bin}(y,q)$ given $Y=y$ and $\Theta=(p,q)$.
Now I want to determine the variance of $Z-Y$, but I don't know how. I know $\operatorname{Cov}(Z,Y)=E(ZY)-E(Z)E(Y)$, but I'm stuck on the first term.

Best Answer

We'll use the result $\mathbb{E}[X] = \mathbb{E}[ \mathbb{E}[X\mid Y] ]$

It's easy to see that

$$\mathbb{E}[Z\mid Y] = Y q $$

Now,

\begin{align} \mathbb{E}[ZY ] &= \mathbb{E} [ \mathbb{E}[ZY \mid Y] ] \\ &= \mathbb{E}[ Y \mathbb{E}[Z\mid Y] ] \\ &= \mathbb{E}[ q Y^2 ]\\ &= npq ( np + 1 - p) \end{align}

You'll also need the second moment of $Z$, can you figure out how to calculate it now?

Related Question