I have the following setup:
- ( A ) is an ( $M \times N$ ) matrix with entries ( $A \sim \mathrm{Bernoulli}(\nu_{nk})$ ).
- ( B ) is a ( $N \times N$ ) matrix with entries ( $B \sim\mathcal{N}(\mu,\Sigma)$ ).
- ( A ) and ( B ) are independent, implying ( $\mathbb{E}[AB] = 0 $).
I think the diagonal entries of ( A ), because ( $a_{ij}$ ) is Bernoulli-distributed, must be ( $a_{ii}^2 = a_{ii}$ ) and it leads to [ $\mathbb{E}\big[(\mathbf{A}\mathbf{A}^T)_{ii}\big] = \sum_{j=1}^M \nu_{ij}$ ]. Now for off-diagonal entries, it should be [ $\mathbb{E}\big[(\mathbf{A}\mathbf{A}^T)_{ij}\big] = \sum_{k=1}^M \nu_{ik}\nu_{jk}$ ] given that ( $\mathbf{A}_{ik}$ ) and ( $\mathbf{A}_{jk}$ ) are independent for ($ i \neq j$ ).
My question: If $\eta=ABA^T$, how can I compute $\mathbb{E}[\eta]$ with respect to both A and B?
Condition on $A$, then compute the conditional expectation of $\eta$ conditioned on $A$ (using the fact that $A,B$ are independent), then sum over all choices for $A$.
Let's compute $\mathbb{E}[\eta_{1,2}]$. The calculation will be similar for any other entry of $\eta$. We have
$$\eta_{1,2} = \sum_{i,j} A_{1,i} B_{i,j} A_{2,j}.$$
Note that $A_{1,i} A_{2,j}$ is either $1$ (if $A_{1,i} = A_{2,j} = 1$) or $0$ (otherwise). Let's define $W$ to be the number of such $1$'s, i.e.,
$$W = \sum_{i,j} A_{1,i} A_{2,j} = \sum_i A_{1,i} \sum_j A_{2,j}.$$
Let's let $U= \sum_i A_{1,i}$ and $V= \sum_j A_{2,j}$, so that $W=UV$. Now $\eta_{1,2}$ is the sum of $W$ i.i.d. r.v.'s with distribution $\mathcal{N}(\mu,\Sigma)$, so by linearity of expectation,
$$\mathbb{E}[\eta_{1,2} | W=w] = w \mu$$
and therefore $\mathbb{E}[\eta_{1,2} | W] = W \mu$. Applying the law of total expectation, we see
$$\mathbb{E}[\eta_{1,2}] = \mathbb{E}_W[\mathbb{E}[\eta_{1,2}|W]] = \mathbb{E}[W \mu] = \mu \mathbb{E}[W].$$
Now as we wrote above, $W=UV$. You can note that $U,V$ are independent, hence
$$\mathbb{E}[W] = \mathbb{E}[U] \mathbb{E}[V] = \sum_i \nu_{1,i} \sum_j \nu_{2,j}.$$
Plugging in, we find that
$$\mathbb{E}[\eta_{1,2}] = \mu \sum_i \nu_{1,i} \sum_j \nu_{2,j}.$$
The same result applies for $\mathbb{E}[\eta_{k,\ell}]$ whenever $k \ne \ell$.
When $k=\ell$, you need to adjust the above computation slightly, replacing $\mathbb{E}[W]=\mathbb{E}[U] \mathbb{E}[V]$ with $\mathbb{E}[W]=\mathbb{E}[U]$ (as in this case $U=V$ and $UV=U^2=U$ for 0-or-1-valued vectors), then adjusting the rest of the calculation accordingly.