# Does transpose commute through expectation?

Working with the generalized covariance formula for vector, $x$, I have: $E[(x-\mu)(x-\mu)^T)] = E(xx^t) - \mu E(x^T)$

But the term $E(x^T)$ doesn't make much sense to me. Does anyone have an idea why I'm getting this term with my matrix algebra?

-

The short answer is "yes", $E(x^T) = E(x)^T=\mu^T$. Your full expression will be:
$E[(x−μ)(x−μ)^T)]=E(xx^T)−μE(x^T)-E(x)\mu^T+\mu\mu^T = E(xx^T)-\mu\mu^T$
Looking at the simplest non-trivial example can help. For instance, when $\mathbf{x}$ is a row vector of length 2, say with components $x_1$ and $x_2$, then $\mathbf{x}^t$ is a column vector of length 2 with components $x_1$ and $x_2$. The expectations are $E[x_1]$ and $E[x_2]$: these are the components of $E[\mathbf{x}]$ and $E[\mathbf{x}^t]$; the only difference is that in the first case they are arranged side-by-side in the row vector and in the second they are arranged top-to-bottom in the column vector. – whuber Jan 10 '12 at 18:39