13

I wanted to find the maximum likelihood estimator for $\mathbf{\Sigma}$ in the multivariate gaussian.

I was anticipating the solution would be a bit involved and messy, if not 'brute-forced', but I was surprised to find an elegant and clever shortcut known as the trace trick.

For a vector $\mathbf{x}$ and a matrix $\mathbf{A}$, $\mathbf{x}^T\mathbf{Ax} = tr (\mathbf{x}^T\mathbf{Ax}) = tr (\mathbf{xx}^T\mathbf{A}) = tr (\mathbf{Axx}^T)$.

I am not sure how this can be true. Any insight/rough sketch of proof would be great.

cgo
  • 1,810

1 Answers1

17

The first equality is just using the fact that $x^TAx$ is a real number, so when seen as a $1\times 1$ matrix, it's equal to its trace!

The other equalities use the fact that $tr(AB)=tr(BA)$.

Augustin
  • 8,446