# Expectation of two Quadratic form

Assume $$\mathbf{h} \in C^{N \times 1}$$ is a Gaussian vector with zero mean and Covariance matrix $$\mathbf{R}$$. Also $$\mathbf{A} \in C^{N \times N}$$ is a deterministic diagonal matrix. In this case, what is $$\mathbb{E}[\mathbf{h} \mathbf{h}^H \mathbf{A} \mathbf{A} \mathbf{h} \mathbf{h}^H]$$ ?

• note that this is the expectation of a matrix with quartic polynomial entries in the entries of $\mathbf{h}$, and that it may written with a single diagonal matrix $\mathbb{E}[\mathbf{h}\mathbf{h}^\top\tilde{\mathbf{A}}\mathbf{h}\mathbf{h}^\top]$. There probably is a closed form for this, but it's probably super gross Jun 13, 2023 at 13:31
• To be accurate, what you wrote is not called "quadratic form" (I never heard of the "two quadratic form"). By the way, does $x^H$ simply mean the transpose of $x$? Jun 13, 2023 at 15:41
• Yes, because it is complex, it is a complex conjugate. Jun 13, 2023 at 16:09
• @Zhanxiong That's a not uncommon symbol for the Hermitian conjugate. This question could be framed without reference to complex numbers just by considering the real and imaginary dimensions separately. It's probably not special that the resulting dimension is even, either. The resulting formula ought to be a fairly simple function of the diagonal elements of $A$ and of $R.$
– whuber
Jun 13, 2023 at 16:26
• I know this notation if the vector is complex. However, it then may not be appropriate to refer it as a "Gaussian vector", whose components are normally real numbers. Jun 13, 2023 at 16:30

Let $$\mathbf S = \mathbf R^{\frac12}$$ then $$\mathbf S\mathbf S^* = \mathbf S^*\mathbf S = \mathbf S^2 = \mathbf R$$
Let $$\mathbf z \sim \mathcal{CN}\left(\mathbf 0, \mathbf I\right)$$, then it is clear that what you are looking for is the same as
\begin{align} \mathbb E\left[\mathbf S\mathbf z\mathbf z^{*} \mathbf S^* \mathbf A\mathbf A\mathbf S\mathbf z\mathbf z^*\mathbf S^*\right] &= \sum_{i=1}^{N}\sum_{j=1}^{N}\sum_{k=1}^{N}\sum_{\ell=1}^{N} \mathbf S\mathbf e_i\mathbf e_j^*\mathbf S^*\mathbf A\mathbf A\mathbf S\mathbf e_k\mathbf e_\ell^*\mathbf S^* \mathbb E\left[\mathbf z_i\mathbf z_j^*\mathbf z_k\mathbf z_{\ell}^*\right]\\ &= \sum_{\ell = 1}^N \mathbf S\mathbf e_\ell\mathbf e_\ell^*\mathbf S^*\mathbf A\mathbf A\mathbf S\mathbf e_\ell\mathbf e_\ell^*\mathbf S^*\underbrace{\mathbb E\left[\left|\mathbf z_\ell\right|^4\right]}_{=2} + \sum_{\ell = 1}^N\sum_{j\neq \ell} \mathbf S\mathbf e_j\mathbf e_j^*\mathbf S^*\mathbf A\mathbf A\mathbf S\mathbf e_\ell\mathbf e_\ell^*\mathbf S^*\underbrace{\mathbb E\left[\left|\mathbf z_\ell\right|^2\left|\mathbf z_j\right|^2\right]}_{=1} + \sum_{\ell = 1}^N\sum_{j\neq \ell} \mathbf S\mathbf e_\ell\mathbf e_j^*\mathbf S^*\mathbf A\mathbf A\mathbf S\mathbf e_j\mathbf e_\ell^*\mathbf S^*\underbrace{\mathbb E\left[\left|\mathbf z_\ell\right|^2\left|\mathbf z_j\right|^2\right]}_{=1}\\ &= \sum_{\ell=1}^N\sum_{j=1}^N \mathbf S\mathbf e_j\mathbf e_j^*\mathbf S^*\mathbf A\mathbf A\mathbf S\mathbf e_\ell\mathbf e_\ell^*\mathbf S^* + \sum_{\ell=1}^N\sum_{j=1}^N \mathbf S\mathbf e_\ell\mathbf e_j^*\mathbf S^*\mathbf A\mathbf A\mathbf S\mathbf e_j\mathbf e_\ell^*\mathbf S^*\\ &= \mathbf S\mathbf S^*\mathbf A\mathbf A\mathbf S\mathbf S^* + \text{Tr}\left(\mathbf S^*\mathbf A\mathbf A\mathbf S\right)\mathbf S\mathbf S^*\\ &= \mathbf R\mathbf A \mathbf A\mathbf R + \text{Tr}\left(\mathbf A\mathbf A\mathbf R\right)\mathbf R \end{align}