# Covariance of quadratic form and a random vector of type $\mathbf{G}\,\mathbf{y}$

Assume that the $$p \times 1$$ vector $$\mathbf{y}$$ has multivariate Normal distribution with $$\mathbb{E}[\mathbf{y}] = \boldsymbol{\mu}$$ and $$\mathrm{V}[\mathbf{y}] = \boldsymbol{\Sigma}$$. Let $$\mathbf{A}$$ and $$\mathbf{G}$$ be two known $$p\times p$$ constant matrices.

Define the quadratic form $$Q = \mathbf{y}^\prime\,\mathbf{A}\,\mathbf{y}$$ and the vector $$\mathbf{v} = \mathbf{G}\,\mathbf{y}$$. Is there analytical formula for the covariance between $$Q$$ and $$\mathbf{v}$$?

That is how can I compute $$\mathrm{Cov}(\mathbf{v}, Q)$$ and $$\mathrm{Cov}(Q, \mathbf{v})$$?

I think the $$\mathrm{Cov}(\mathbf{v}, Q) \neq \mathrm{Cov}(Q, \mathbf{v})$$. Also, my attempt to find $$\mathrm{Cov}(Q, \mathbf{v})$$ is as follows:

\begin{align*} \begin{split} \mathrm{Cov}(\mathbf{v}, Q) &= \mathrm{Cov}(\mathbf{G}\,\mathbf{y}, \mathbf{y}^\prime\,\mathbf{A}\,\mathbf{y}) \\ &= \mathbf{G}\,\mathrm{Cov}(\mathbf{y}, \mathbf{y}^\prime\,\mathbf{A}\,\mathbf{y}) \\ &= \mathbf{G}\,\left\{\mathbb{E}\left[\mathbf{y}\,\mathbf{y}^\prime\,\mathbf{A}\,\mathbf{y} \right] - \mathbb{E}\left[\mathbf{y}\right]\,\mathbb{E}[\mathbf{y}^\prime\,\mathbf{A}\,\mathbf{y}] \right\} \end{split} \end{align*}

But I am not sure is there is a matrix expression for $$\mathbb{E}\left[\mathbf{y}\,\mathbf{y}^\prime\,\mathbf{A}\,\mathbf{y} \right]$$, because the argument is going to be a vector $$p\times 1$$, I cannot apply the $$\mathrm{trace}$$ function.

If anyone has any insights, suggestions, or solutions related to I would be grateful for your input.

• Do $A$ and $G$ have any special structure? i.e. are they invertible, positive semi-definite, etc.? Aug 19, 2023 at 17:31
• In my problem they are the first and second derivatives of a known function, so I can say that they are symmetric and invertible. Aug 19, 2023 at 17:42
• Certainly there's a formula. Just write out any formula you like for covariance. For instance, the hard part is $$E[y^\prime Ay\, Gy]_n=\sum_{ijk} A_{ij}G_{nk}E[y_iy_jy_k].$$
– whuber
Aug 19, 2023 at 18:15
• Please consider accepting my answer @andre Nov 30, 2023 at 21:22

Let $$y \in \mathbb{R}^p \sim \mathcal{N}(\mathbf{\mu}, \mathbf{\Sigma})$$, $$Q = \mathbf{y}'\mathbf{A}\mathbf{y}$$ and $$P = \mathbf{g}'\mathbf{y}$$, with $$\mathbf{A} \in \mathbb{R}^{p\times p}$$ symmetric and $$\mathbf{g} \in \mathbb{R}^p$$.
Then, $$Cov(Q,P) = 2 \mathbf{\mu}' \mathbf{A} \mathbf{\Sigma} \mathbf{g}$$
In the formula above, $$P \in \mathbb{R}$$. This extends easily to your questions with $$\mathbf{v} = \mathbf{G}\mathbf{y} \in \mathbb{R}^p$$:
$$Cov(Q,P) = \mathbf{\mu}' \mathbf{A} \mathbf{\Sigma} \mathbf{G}'$$