Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I compute the volume of the hyperellipsoid corresponding to a Mahalanobis distance $r^2 = (x-\mu)^{T}\Sigma^{-1}(x-\mu)$?

I'm a bit confused because the answer involves $r$:

$$V = V_{d} |\Sigma|^{1/2}r^{d}$$ with $V_{d}$ as the volume of a d-dimensional unit hypersphere. I have seen that some statements of this problem describe $V_{d}$ as:

$$V_{d} = \left\{ \begin{array}{ll} \pi^{d/2}/(d/2)! \;\;\; \text{for d even}\\\ 2^{d}\pi^{(d-1)/2}\left(\frac{d-1}{2}\right)!/(d)! \;\;\; \text{for d odd} \end{array}\right.$$

I thought I was supposed to integrate $r^{2}$ over $r\in [0, 1]$ and the surface of a unit hypersphere, but that doesn't give the right answer. What is the right procedure?

Thanks in advance

share|cite|improve this question
Start with $\mu = 0$ and $\Sigma = I,$ the identity matrix. Do you know the $d$-volume of an ordinary hypersphere of radius $r?$ – Will Jagy Mar 17 '13 at 1:40
Same idea, really. Do you know how to derive $V_d?$ Not contract $V_d,$ that means something different. – Will Jagy Mar 17 '13 at 1:41
Sure. The differential of volume in cylindrical coordinates takes the form $r^{n-1}d\Omega$ that when integrated produces $\frac{2\pi^{n/2}}{\Gamma(n/2)}\frac{r^{n}}{n}$ (although now I'm not sure why you edited user1938185's answer to include the term $1+d/2$) – Robert Smith Mar 17 '13 at 3:56
Now I can see that the volume of a hypersphere is $\frac 2 d \frac {\pi ^ {d/2}} {\Gamma (1 + (d/2)) } r^d$ according to Wikipedia's n-sphere article ( but the surface of a hypersphere with radius 1 is $2 \frac {\pi ^ {d/2}} {\Gamma ((d/2)) }$ in the Sphere article ( which integrated produces $\frac{2\pi^{n/2}}{\Gamma(n/2)}\frac{r^{n}}{n}$. This result is confirmed by W|A: – Robert Smith Mar 17 '13 at 4:13
I did not notice the extra $d$ in the denominator – Will Jagy Mar 17 '13 at 4:30
up vote 5 down vote accepted

Your ellipsoid is the transformation of the sphere of radius $r$ by the linear transform of matrix $Σ^{1/2}$.

The volume of the sphere of radius $r$ in an $d$-dimensional space is $V = \frac 2 d \frac {\pi ^ {d/2}} {\Gamma ( d/2) } r^d = V_d r^d$. wikipedia. Note the $r^d$.

Your get the volume of the ellipsoid by multiplying with the determinant of the linear transform, which is exactly your formula.

share|cite|improve this answer
Oh, that makes it so easy. Yes, that was the first approach I tried but I didn't know this ellipsoid was a linear transformation of the sphere of radius $r$ using $\Sigma^{1/2}$. How can I see that? I was under the impression that I needed to work with the Mahalanobis distance. – Robert Smith Mar 17 '13 at 2:04

You can put $r$ on the right hand side: $1 = (x-\mu)^T(r \Sigma^{1/2})^{-2} (x-\mu)$. Then the answer becomes clearer: $V = V_d\ \det(r\Sigma^{1/2}) = V_d\ \det(\Sigma)^{1/2}r^d$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.