I have the pdf for a d-dimensional Gaussian as follows:
$P_X(x) = \frac{1}{\sqrt{(2\pi)^d|\boldsymbol\Sigma|}}\exp\left(-\frac{1}{2}({x}-{\mu})^T{\boldsymbol\Sigma}^{-1}({x}-{\mu})\right)$
I'd like to expand the exponential term
$-\frac{1}{2}({x}-{\mu})^T{\boldsymbol\Sigma}^{-1}({x}-{\mu})$
but am not sure how the covariance matrix factors into the "foiling."
This is what I came up with, is this the correct expansion?
$-\frac{1}{2}({x}^T{\boldsymbol\Sigma}^{-1}{x} -\mu{x}^T{\boldsymbol\Sigma}^{-1} – \mu^Tx{\boldsymbol\Sigma}^{-1} + \mu^T{\boldsymbol\Sigma}^{-1}\mu)$
can this be further simplified if it is correct? Thank you!!
Best Answer
Your proposed answer can’t be quite right, since, e.g. $x^\text{T}\Sigma^{-1}x$ is a scalar, while $\mu{x^\text{T}}\Sigma^{-1}$ is a matrix (so it doesn’t make sense to add them together).
In general, to expand $(x-c)^\text{T}A(x-c)$ for vectors $x$ and $c$ and a matrix $A$, first distribute the $A$: $$ (x-c)^\text{T}A(x-c)=(x-c)^\text{T}(Ax-Ac). $$ Then you can pass the transpose through the parentheses to get $(x^\text{T}-c^\text{T})(Ax-Ac)$. Next, apply “FOIL”. The first term is $x^\text{T}Ax$, the outer term is $-x^\text{T}Ac$, etc.