0
$\begingroup$

Currently going through my Lecturer's notes and came across the Mahalanobis distance but nothing in the notes on how to work this out and googling hasn't really turned up anything either. My maths isn't great but I've been at it for 20 minutes now trying to come up with the same answer and can't.

The Mahalanobis norm is defined by $D_M^2(x) = (x-\mu)^T C^{-1}(x-\mu)$, and for my calculation, I have $(x-\mu)^T = [-90, -100]$ with covariance matrix

$C=\begin{pmatrix} 0.00025 & -0.00015 \\ -0.00015 & 0.00025 \end{pmatrix}$

Thanks in advance for your help.

  • 0
    Yes, that was an error @Aaron; I misread the vectors. I'm getting a Mahalanobis distance of $4250\sqrt{10}\approx 1.34397\times 10^4$.2011-05-16

2 Answers 2

1

Plugging in, we have $C^{-1}=\begin{pmatrix} 6250 & 3750 \\ 3750 & 6250 \end{pmatrix}$, and so $D_M^2= \begin{pmatrix}-90 & -100 \end{pmatrix}\begin{pmatrix} 6250 & 3750 \\ 3750 & 6250 \end{pmatrix} \begin{pmatrix}-90 \\ -100\end{pmatrix}=1.80625*10^8.$ Taking square roots, we see that the norm of $x$ is approximately $13439.7$.

  • 0
    Thanks. I got 1.825. We're not required to normalise x and the matrix was already inverted I should've been more specific with my notation.2011-05-16
0

I found myself factorising things to make the computation easier.

We have $x-\mu=-10[9\ 10]^T$ and $C=0.00005\begin{bmatrix}5&-3\\-3&5\end{bmatrix}$. So $C^{-1}=0.00005^{-1}\times \frac1{16}\begin{bmatrix}5&3\\3&5\end{bmatrix}$ and so $(x-\mu)^TC^{-1}(x-\mu)= 0.00005^{-1} \times 1/16 \times (-10) \times (-10) \times [9\ 10]\begin{bmatrix}5&3\\3&5\end{bmatrix}\begin{bmatrix}9\\10\end{bmatrix}=125000 \times [9\ 10]\begin{bmatrix}75\\77\end{bmatrix}=125000 \times 1445=180625000.$ So $D=\sqrt{180625000}\approx 13440$.

[Maybe you should look up matrix multiplication and inversion of $2\times 2$ matrices, since that's all that's going on here].

  • 0
    More exactly(?) $ D = \sqrt {180625000} = 4250 * \sqrt {10} $2011-05-26