# Volume of hyperellipsoid

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?

• Start with $\mu = 0$ and $\Sigma = I,$ the identity matrix. Do you know the $d$-volume of an ordinary hypersphere of radius $r?$ 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. 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$) 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 (en.wikipedia.org/wiki/N_sphere) but the surface of a hypersphere with radius 1 is $2 \frac {\pi ^ {d/2}} {\Gamma ((d/2)) }$ in the Sphere article (en.wikipedia.org/wiki/Sphere) which integrated produces $\frac{2\pi^{n/2}}{\Gamma(n/2)}\frac{r^{n}}{n}$. This result is confirmed by W|A: wolframalpha.com/input/?i=volume+hypersphere Mar 17 '13 at 4:13
• I did not notice the extra $d$ in the denominator Mar 17 '13 at 4:30

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$.
• 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. 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$.