2
$\begingroup$

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$

$\endgroup$
2
  • $\begingroup$ Is it on purpose that some x's are capital letters? $\endgroup$ Commented Apr 25, 2019 at 17:53
  • $\begingroup$ You’re right they should be lower case. I will try to fix. $\endgroup$ Commented Apr 26, 2019 at 13:03

1 Answer 1

3
$\begingroup$

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.

$\endgroup$
2
  • $\begingroup$ How is the first equality true? Seems like you just wrapped left side in a transpose? I get the rest. $\endgroup$ Commented Apr 26, 2019 at 1:55
  • $\begingroup$ As was remarked at the end, Brian, transposing a scalar does nothing to it and $x^\prime\Sigma^{-1}\mu_k$ is a scalar. $\endgroup$ Commented Apr 26, 2019 at 15:13

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.