13
$\begingroup$

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.

$\endgroup$

1 Answer 1

17
$\begingroup$

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)$.

$\endgroup$
1
  • 3
    $\begingroup$ To clarify for the asker: this means that $$ \operatorname{trace}([x^TA][x]) = \operatorname{trace}([x][x^TA]) $$ $\endgroup$ Commented Apr 27, 2016 at 15:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .