# How to prove that the expression E(z'Az) (for a random vector z) is …

I am looking to prove the following

Let $z$ be an $m\times$ 1 random vector with $E(z)=\mu$ and $\operatorname{Cov}(z)=V$ and let $A$ be an $m\times m$ non-stochastic matrix. Then the following identity holds true:

$$E(z'Az) = \operatorname{trace}(AV) + \mu'A\mu$$

I am failing to find a straight forward proof to it.

p.s: This is not a homework assignment (although something in my homework DOES rely on this theorem, and I would love to know why it holds).

I reduced the problem to the following: If we call z'=X and z'A'=Y then we already know that: $\operatorname{cov}(X,Y) = E(XY')-E(X)E(Y)' \rightarrow E(XY')=\operatorname{cov}(X,Y)+E(X)E(Y)' \rightarrow$ $E(z'Az)=\operatorname{cov}(z',z'A')+E(z')E(z'A')'=\operatorname{cov}(z',z'A')+\mu'(\mu'A')'$ $=\operatorname{cov}(z',z'A')+\mu'A\mu$

Which leaves us to show that $\operatorname{cov}(z',z'A')=\operatorname{trace}(AV)$

Is there another direction to this proof that I am missing?

Thanks.

-

It follows from the fact that $\operatorname{trace}(AB)=\operatorname{trace}(BA)$, i.e. one can cyclically permute matrices when taking a trace, it doesn't change the end result. Now, since $\operatorname{cov}(z',z'A')=(z-\mu)'(Az-A\mu)=(z-\mu)'A(z-\mu)$ is a number, $(z-\mu)'A(z-\mu)=\operatorname{trace}((z-\mu)'A(z-\mu))$ trivially. Then permute the $(z-\mu)'$ to the back to get $\operatorname{trace}(A(z-\mu)(z-\mu)')$. But the last two factors form just the covariance matrix of $z$ after taking the expectation of course.
It's true because $A$ is a non-stochastic matrix. And because $E$ can be shifted through any linear operations like taking a trace or multiplying by a non-stochastic matrix. By the way, $Az$ is not a number, it's a column random vector. But $z'Az$ is a single random variable. – Raskolnikov Dec 25 '11 at 9:52