I am considering a variance of two forms:
- $ R(x) = (x-m)^\top A (x-m) + b^\top (x-m) + c $
- $ R'(\Delta) = \Delta^\top A \Delta + b^\top \Delta + c $
where $x$ is a random variable of $\mathcal{N}(m,\Sigma)$ (Gaussian of mean $m$ and variance $\Sigma$). $\Delta = x-m$, so it is a random variable of $\mathcal{N}(0,\Sigma)$. $A$ is symmetric ($A^\top=A$).
Now, the two equations are the same, so $\mathrm{var}[R]$ and $\mathrm{var}[R']$ should be the same. But when I tried to derive them, the results were different. Please help me to find out this mystery.
Preliminary.
$$\begin{align} \mathrm{var}[x^\top A x] &= 2\mathrm{Tr}(A\Sigma A\Sigma) + 4 m^\top A \Sigma A m \\ \mathrm{var}[b^\top x] &= b^\top \Sigma b \end{align}$$
Case 2.
$$\begin{align} \mathrm{var}[R'] & = \mathrm{var}[\Delta^\top A \Delta] + \mathrm{var}[b^\top \Delta] \\ & = 2\mathrm{Tr}(A\Sigma A\Sigma) + b^\top \Sigma b \end{align}$$
Case 1.
$$\begin{align} R(x) &= (x-m)^\top A (x-m) + b^\top (x-m) + c \\ &= x^\top A x + (b^\top - 2m^\top A) x + \mathit{constant} \end{align}$$
$$\begin{align} \mathrm{var}[R] &= \mathrm{var}[x^\top A x] + \mathrm{var}[(b^\top - 2m^\top A) x] \\ &= 2\mathrm{Tr}(A\Sigma A\Sigma) + 4 m^\top A \Sigma A m + (b^\top - 2m^\top A) \Sigma (b - 2A m) \\ &= 2\mathrm{Tr}(A\Sigma A\Sigma) + 4 m^\top A \Sigma A m \\ &\quad + b^\top \Sigma b - 2m^\top A \Sigma b - 2 b^\top \Sigma A m + 4 m^\top A \Sigma A m \end{align}$$
Therefore, unless $4 m^\top A \Sigma A m - 2m^\top A \Sigma b - 2 b^\top \Sigma A m + 4 m^\top A \Sigma A m$ is zero, the case 1 and 2 are not the same.
Where is the problem? Thank you in advance.