I read the matrix cookbook,
In its section 8.2.2, Eq(380). It says that if $x$ is $N(m, \Sigma)$, then, we have
$$ E[(x-m')^TA(x-m')] = (m-m')^TA(m-m') + Tr(A\Sigma) $$
How to proof this euqation step-by-step?
I read the matrix cookbook,
In its section 8.2.2, Eq(380). It says that if $x$ is $N(m, \Sigma)$, then, we have
$$ E[(x-m')^TA(x-m')] = (m-m')^TA(m-m') + Tr(A\Sigma) $$
How to proof this euqation step-by-step?
Copyright © 2021 JogjaFile Inc.
Writing $x-m' = x-m+m-m'$, we have \begin{align} E[(x-m')^\top A (x-m')] &= E[(x-m)^\top A (x-m)] + 2 E[(m-m')^\top A (x-m)] + E[(m-m')^\top A (m-m')] \end{align}
The middle term is zero since $$E[(m-m')^\top A (x-m)] = (m-m')^\top A E[x-m] = 0.$$
The last term is $(m-m')^\top A (m-m')$ because the expectation can be removed.
The first term is \begin{align} E[(x-m)^\top A (x-m)] &= E[\text{Tr}((x-m)^\top A (x-m))] & \text{trace of $1\times 1$ matrix is itself} \\ &= E[\text{Tr}(A (x-m) (x-m)^\top)] & \text{cyclic property of trace} \\ &= \text{Tr}(A E[(x-m)(x-m)^\top]) & \text{linearity of expectation} \\ &= \text{Tr}(A \Sigma) & \text{definition of covariance matrix} \end{align}