I have two sequences of random variables. $X_i, i \in \mathbb{N}$, identically distributed, with covariance matrix $K_X$ and $Y_i, i \in \mathbb{N}$, identically distributed, with covariance matrix $K_Y$, where $Y_i$'s are i.i.d. and $K_Y$ is a scaled identity matrix. $X_i$'s are independent of $Y_i$'s. Now if $Z = \sum_{i=1}^{m}X_iY_i$, I want to find the covariance matrix of $Z$.
For scalars $a_i, i \in \mathbb{N}$, the covariance matrix of $Z = \sum_{i=1}^{m}a_iY_i$ can be found out to be $a^TK_Ya$ using MGF. MGF can't readily be applied to this case. So how does onr compute $K_Z$, the covariance matrix of $Z$? Thanks.
Since $Z$ is a single random variable, its covariance matrix is just a number, $\text{Var}(Z)$. If I am allowed to assume $X_i$ and $Y_i$ are mean zero, then \begin{align} \text{Var}(Z) = E(Z^2) &= \sum_{i=1}^m \sum_{j=1}^m E(X_i Y_i X_j Y_j) \\ &= \sum_{i=1}^m \sum_{j=1}^m E(X_i X_j)E(Y_i Y_j) \\ &= \sum_{i=1}^m \sum_{j=1}^m (K_X)_{i,j} (K_Y)_{i,j} \\ &= \text{trace}(K_X K_Y) . \end{align} If they aren't mean zero, then a similar, but more complicated, formula will work.