2

From this post here I am struggling with the matrix multiplication to get from:

$\log \pi _{k} - \frac{1}{2}(x-\mu _k)^T{\sum }^{-1}(x-\mu _k)$

to

$\log \pi _{k} - \frac{1}{2}[x^{T}{\sum }^{-1}x +\mu _k^{T}{\sum }^{-1}\mu _k] + x^{T}{\sum }^{-1}\mu _k$

I get the first two tersm but I struggle with the last term because when I do the foil multiplication I get:

$- \frac{1}{2}[(x^{T}{\sum }^{-1}x +\mu _k^{T}{\sum }^{-1}\mu _k) - (x^{T}{\sum }^{-1}\mu _k + \mu _k^{T}{\sum }^{-1}x) ]$

I don't see how the last two terms are the same? Why do we say: $-(x^{T}{\sum }^{-1}\mu _k$ + $\mu _k^{T}{\sum }^{-1}x)$ = $-2\cdot x^{T}{\sum }^{-1}\mu _k$

1 Answers1

3

We need to show that $$ x^\top \Sigma^{-1} \mu_k = \mu_k^\top \Sigma^{-1} x. $$ Indeed, $$\begin{align} x^\top \Sigma^{-1} \mu_k & = (x^\top \Sigma^{-1} \mu_k)^\top \\ & = \mu_k^\top (\Sigma^{-1})^\top x \\ & = \mu_k^\top \Sigma^{-1} x, \end{align}$$ where the first equality follows from the fact that scalars are invariant to transposes and the third from the fact that $\Sigma$ (and hence $\Sigma^{-1}$) is symmetric.

tddevlin
  • 3,387
  • 1
  • 15
  • 30