Skip to content

n-dimensional spheres and ellipsoids – III – Surface area of n-dimensional ellipsoid and its relation to MVN-statistics

In the 2nd post of this series we have derived an explicit formula for the volume of a n-dimensional ellipsoid (in an Euclidean space). One reason for the relatively simple derivation was that the determinant of the generating linear transformation could be taken in front of the volume integral. Unfortunately, an analogue sequence of steps is not possible for an ellipsoid’s surface area. Reasons, also on a formal mathematical level, are given by P. Masson in [1] and M. Jorgensen in [2]. The metric and varying curvature of the surface do not allow for getting the semi-axes in whatever kind of expression out of the required surface area integrals.

However, as I. Rivin has shown in [3] and [4], statistics can help us – once again and a bit surprisingly. Rivin derived a formula which relates the surface of an ellipsoid with the expectation value of special coordinate dependent function fp weighted by a simple probability density. The function must dependent on polar coordinates in such a way that it can be written as a product given by a power of the radius and an angle-dependent rest-function. The probability density used to calculate the expectation value is simply given by a product of Gaussian functions, which describes a set of independent normal distributions (one distribution per coordinate). The function fp in our context of ellipsoids turns out to be one given by projections of the ellipsoid’s n semi-axes onto vectors of a unit sphere.

I admit, this is a very special mathematical topic. But the underlying proof has some elements which are both beautiful and not obvious for us normal mortals. I cover the topic here for the sake of completeness of this series and because we get another example for the relation of Gaussian based MVN-statistics and the geometry of objects described by quadratic forms.

I will first try to briefly repeat Rivin’s ideas below – and to make their results at least plausible. Then, I provide a factor needed for practical purposes and the adaption of Rivin’s result to the standard definition of a Gaussian with a variance equal to 1. This post predominantly works with theory. All credits belong to I. Rivin.

In a sub-sequent post, we shall verify the applicability of Rivin’s formula for ellipsoid’s in 2 and 3 dimensions, created from a 4-dim MVN. Afterward, I will discuss the applicability in the context of ellipsoidal cores of centered data distributions which approximate a Multivariate Normal Distribution up to a certain distance from the origin. The basic message is that as soon as you can determine the covariance matrix for a spatially limited MVN-like data distribution, you can numerically calculate the surface area of its ellipsoidal contour surface in n dimensions.

Previous posts in this series:

The relation of the volume and the surface area of an ellipsoid

We work with an (n-1)-dimensional convex and closed ellipsoidal surface in the Euclidean ℝn. The center of the enclosed volume is assumed to coincide with the origin of a Cartesian Coordinate system [CCS] covering the Euclidean space. Rivin starts with citing a formula of Cauchy for general bodies with a closed convex surface; for details of Cauchy’s formulas see e.g. [5] and [8]. This formula relates the convex surface to an averaged integration of volumes/areas of orthogonal projections of the body to (n-1)-dimensional sub-spaces of the ℝn.

As we need to measure volumes and surfaces areas across lower dimensional sub-spaces we need a consistently defined chain of Lebesgue measures. Let us call the measure of a (n-1)-dimensional sub-space μn-1 and afterward forget about subtleties and speak of volumes V and surface areas S of respective manifolds. We use the symbol 𝕊n-1 for the (n-1)-dimensional unit sphere and 𝔹n for the respective n-dim unit ball in the ℝn. The ∂-symbol indicates a surface:

\[ \begin{align} & \small { \text{ (n-1)-dim centered unit sphere in the } }\mathbb{R}^n : \mathbb{S}^{n-1} \,, \\[10pt] & \small { \text{ n-dim centered unit ball in the } }\mathbb{R}^n : \mathbb{B}^{n} \,, \\[10pt] &\Rightarrow \quad \mathbb{S}^{n-1} \,=\, \partial \left( \mathbb{B}^{n} \right) \,. \end{align} \]

𝕊n-1 and 𝔹n , of course, cover different sets of vectors. As in the first post of this series, we call the volume of the (n-1) dimensional unit sphere vn,1 = VSn,1 and its surface sn-1,1 = SSn-1,1 :

\[ \begin{align} V_{\mathbb{B}^n} \,&:=\ v_{n,1} \,=\, V^{\mathbb{S}}_{n,1} \,, \tag{1} \\[10pt] S_{\mathbb{S}^{n-1}} \,&:=\, s_{n-1,1} \,=\, S^{\mathbb{S}}_{n-1,1} \,. \tag{2} \end{align} \]

From the first post we know already the following relations between surfaces and volumes of general spheres with radius r

\[ \begin{align} S^S_{n-1}(r) \,&=\, {n \over r} \, V^S_{n} \,, \tag{3} \\[10pt] S^S_{n-2}(r) \,&=\, {n-1 \over r} \, V^S_{n} \,, \tag{4} \end{align}\]

and therefore

\[ \begin{align} S_{\mathbb{S}^{n-1}} \,&=\, n * V_{\mathbb{B}^n} \,, \tag{5} \\[10pt] S_{\mathbb{S}^{n-2}} \,&=\, (n-1) * V_{\mathbb{B}^{n-1}} \,. \tag{6} \end{align}\]

Cauchy’s averaging formula for the surface area

Imagine a body K ⊂ ℝn, enclosed in a convex (n-1)-dimensional surface/manifold. Now take a vector u ∈ 𝕊n-1 of the (n-1)-dimensional unit sphere 𝕊n-1 around the origin and regard the (n-1)-dimensional sub-space of the ℝn perpendicular to u. In my understanding, Cauchy’s surface area formula then states the following:

An averaged integral over the areas of all orthogonal projections on the (n-1)-dimensional sub-spaces (each perpendicular to a vector of the unit-sphere) is equal to the surface area of the body, up to a constant in the dimension.

Let μn−1 be the (n−1)-dimensional Lebesgue measure for such a (n-1)-dimensional sub-space. By K|u, we denote the projection of K onto the (n − 1)-dimensional subspace of ℝn perpendicular to u. Then:

\[ S({K}) \,=\, {1\over \mu_{n-1} \left(\mathbb{B}^{n-1} \right) } \, \int_{\mathbb{S}^{n-1}} \mu_{n-1} ( K | \pmb{u}_\perp) \, d \pmb{\sigma} \,, \tag{7} \]

or with a notation for normal mortals,

\[ S(K) \,=\, {1 \over V_{\mathbb{B}^{n-1}} } \, \int_{\mathbb{S}^{n-1}} \, V_{n-1} ( K | \pmb{u}_\perp) \, d \pmb{\sigma} \ \,. \tag{8} \]

Due to formulas for the unit ball and its surface given above we can rewrite this to

\[ S(K) \,=\, {n-1 \over S_{\mathbb{S}^{n-2}} } \, \int_{\mathbb{S}^{n-1}} \, V_{n-1} ( K | \pmb{u}_\perp) \, d \pmb{\sigma} \ \,. \tag{9} \]

dσ denotes a standard surface element of the unit sphere 𝕊n-1 in the ℝn. The volume inside the integral refers to the (n-1)-dim volume of the (n-1)-dim projection of the n-dim body K . However, the averaging surface area in the denominator is of dimension (n-2). It is worthwhile to dwell a bit on the message of this formula. You may test e.g its truth for the surface of a sphere in the ℝ3.

Let us follow Rivin and put a proper averaging of an integral over some space S into a special integral symbol (with x being a vector)

\[\def\avint{\mathop{\,\rlap{-}\!\!\int}\nolimits} \underset{S}{\avint} \, f(\pmb{x}) \,d\mu \,:=\, {1 \over \mu(S) } \, \int_S \, f(\pmb{x}) \,d\mu \,. \tag{10}\]

For our unit sphere:

\[\def\avint{\mathop{\,\rlap{-}\!\!\int}\nolimits} \underset{\mathbb{S}^{n-1}}{\avint} \, f(\pmb{x}) \,d\mu \,:=\, {1 \over \mu(\mathbb{S}^{n-1}) } \, \int_{\mathbb{S}^{n-1}} \, f(\pmb{x}) \,d\mu \,. \tag{11}\]

Then we can rewrite eq. (8) as

\[ V_{n-1} (\partial K) \,=\, S(K) \,=\, (n-1) \, {S_{\mathbb{S}^{n-1}} \over S_{\mathbb{S}^{n-2}} } \, \underset{\mathbb{S}^{n-1}}{\avint} \, V_{n-1} ( K | \pmb{u}_\perp) \, d \pmb{\sigma} \, \,. \tag{12} \]

The integrand for ellipsoids

We just accept a (rather plausible) formula which Rivin derived in [4] for the integrand of eq. (12), i.e. the (n-1)-dim volume of a projection of an ellipsoid’s volume to a sub-space orthogonal to u ∈ 𝕊n-1. We first denote the ellipsoid by E and its semi-axes by ai :

\[ E \,=\, \left\{ x \in \mathbb{R}^n \,\,\,\,|\,\,\,\, \sum_{i=1}^n \, q_i^2 \ x_i^2 \le 1 \, \right\}\,, \,\, \text{with} \,\, q_i := {1 \over a_i} \,. \tag{12} \]

The volume of the (n-1)-dim projection is given by:

\[ \begin{align} V_{n-1} ( K | \pmb{u}_\perp) \,=\, \, V_{\mathbb{B}^{n-1} } \, { \sqrt { \left( \sum_{i=1}^n \, u_i^2 \, q_i^2 \right) \, } \over \prod_{i=1}^n q_i }, \,\, \tag{13} \\[12pt] \text{with} \,\, \pmb{u} = \left( u_1, \, u_2, … \, u_n \right)^T \in \mathbb{S}^{n-1} \,. \end{align} \]

With the volume Vn(E) of an (n-1) dim ellipsoid in the ℝn (see the previous 2nd post, eq. 28, in this series)

\[ V^E_{n} \,=\, V_n(E) \,= \, {\pi^{n/2} \over \Gamma \left(1 + {n \over 2}\right) } \, \prod_{i=1}^n \, a_i \,=\, V_{\mathbb{B}^{n} } \, {1\over \prod_{i=1}^n q_i } \,, \tag{14} \]

and with the help of eqs.(5), (6) and (12), we reproduce an intermediate result of Rivin, namely a relation between the volume and the surface area of an ellipsoid

\[ R(E) \,:=\, { V_{n-1} ( \partial E) \over V_n(E) } \,=\, n \, \underset{\mathbb{S}^{n-1}}{\avint} \, \sqrt { \left( \sum_{i=1}^n \, u_i^2 \, q_i^2 \right) \, } \, d \pmb{\sigma} \,. \tag{15} \]

I find it just “beautiful” that such a proportionality relation exists. But there is more to it. The next step exploits the fact that a general MVN and its confidence ellipses in the ℝn can be generated from a spherical MVN to its full extend.

Integrals of certain radius dependent functions over unit spheres, Gaussian statistics, expectation values

I change the more general argumentation of Rivin a bit below. Let us assume you have a function fp of polar coordinates ( dependent on r and angles) with the following property

\[ \begin{align} f_p(x_i, \, x_2,\, ..\, x_n) \,&=\, f_p( r*y_1, \, r*y_2, \, …,\, r*x_n) \\[10pt] & =\, r^p * f_{\theta}(y_1,\, y_2 \,…\, y_n) \, ,\,\, \text{with} \, \, y_i = y_i([\theta_1, \theta_2, …].\theta_i, [… \theta_n] ) \,. \tag{16} \end{align} \]

Now, let us look at the expectation value of the function fp weighted by Gaussians for independent normal distributions Xi along the n coordinate axes with a variance of 1/2:

\[ \begin{align} & \mathbb{E} \left( f_p (X_1, \, X_2, … X_n) \right) \,=\, I_{\mathbb{E}(f_p)} \,, \tag{17} \\[10pt] & I_{\mathbb{E}(f_p)} \,=\, c_n \, \int_{\mathbb{R}^n} \, \exp\left( – \sum_{i=1}^n x_i^2 \right) \, f_p(x_1, \, x_2, \, .. \, x_n) \,\, dx_1dx_2 …\ dx_n \, . \tag{18} \end{align}\]

(We will see below how we adjust such integrals for standard Gaussians with a variance = 1 by a leading factor.)

We change to polar coordinates and use the following integral over the surface of the unit sphere

\[ \begin{align} I_{f, \mathbb{S}^{n-1}} \,& =\, \underset{\mathbb{S}^{n-1}}{\avint} \, f_p(x_1,\, x_2, \,…\, x_n) \, d \pmb{\sigma} \, \\[10pt] & \underset{\mathbb{S}^{n-1}}{\avint} \, f_p(x_1,\, x_2, \,…\, x_n \,|\, r=1) \, d \pmb{\sigma} \\[10pt] &=\, \underset{\mathbb{S}^{n-1}}{\avint} \, f_{\theta} (y_1,\, y_2, \,…\, y_n) \, d \pmb{\sigma} \,=\, I_{f, \mathbb{S}^{n-1}}\left( \theta_1, \theta_2, …\theta_n \right) \,. \end{align} \tag{19}\]

Then, with a substitution u = r2, we can evaluate the expectation value:

\[ \begin{align} I_{\mathbb{E}(f_p)} \,&=\, c_n\, S_{\mathbb{S}^{n-1}} \, {1 \over S_{\mathbb{S}^{n-1}} }\, \int_0^{\infty} \, \int_{\mathbb{S}^{n-1}} \, e^{- \,r^2} \, r^{n-1 +p } \, f_{\theta}(y_1,y_2,..y_n) \, d \pmb{\sigma} \, dr \\[10pt] &=\, c_n \, \, S_{\mathbb{S}^{n-1}} \, I_{f, \mathbb{S}^{n-1}} \, \int_0^{\infty} \, e^{- \,r^2} \, r^{n-1 +p } \, dr \\[10pt] &=\, c_n \, \, S_{\mathbb{S}^{n-1}} \, I_{f, \mathbb{S}^{n-1}} \, {1 \over 2}\, \int_0^{\infty} \, e^{- \,u} \, u^{(n-1 +p)/2 } \, du \\[10pt] &=\, c_n \, \, S_{\mathbb{S}^{n-1}} \, I_{f, \mathbb{S}^{n-1}} \, {1 \over 2}\, \Gamma \left( {n+p \over 2 }\right) \,. \end{align} \tag{20} \]

Let us check the normalization factor of Rivin’s somewhat special Gaussian:

\[ \begin{align} 1\,& =\, c_n \, S_{\mathbb{S}^{n-1}} \, \int_0^{\infty} \, e^{- \,r^2} \, r^{n-1} \, dr \\[10pt] &=\, {c_n \over 2} \, S_{\mathbb{S}^{n-1}} \, \Gamma \left( {n \over 2 }\right) \,\, \Rightarrow \\[10pt] c_n \,&=\, { 2 \over S_{\mathbb{S}^{n-1}} \, \Gamma \left( {n \over 2 }\right) }\,. \end{align} \tag{21} \]

Thus we get

\[ I_{f, \mathbb{S}^{n-1}} \,=\, { \Gamma \left( {n \over 2 }\right) \over \Gamma \left( {n+p \over 2 }\right) } \, I_{\mathbb{E}(f)} \,=\, I_{f, \mathbb{S}^{n-1}} \,=\, { \Gamma \left( {n \over 2 }\right) \over \Gamma \left( {n+p \over 2 }\right) } \, \mathbb{E} \left( f_p (X_1, \, X_2, … X_n) \right) \,. \tag{22} \]

All in all

\[ \underset{\mathbb{S}^{n-1}}{\avint} \, f_p(x_1,\, x_2, \,…\, x_n \,|\, r=1) \, d \pmb{\sigma} \,=\, { \Gamma \left( {n \over 2 }\right) \over \Gamma \left( {n+p \over 2 }\right) } \,\, \mathbb{E} \left( f_p (X_1, \, X_2, … X_n) \right) \,. \tag{23} \]

This is a noteworthy relation between a surface integral of a radius dependent function and a Gaussian expectation value for the very same function. And it certainly is a very original idea of I. Rivin.

The normalization factor – directly derived

We first get the normalization factor C of Rivin’s Gaussian for a variance of 0.5:

\[ 1 \,=\, C\, \int_{\mathbb{R}^n} \, \exp\left( – \sum_{i=1}^n x_i^2 \right) \, \, dx_1dx_2 …\ dx_n \, . \tag{24} \]

We look at one of the 1-dim integrals :

\[ \int_{-\infty}^{\infty} e^{-\, x^2} \, dx \,=\, 2\ \int_0^{\infty} e^{-\, x^2} \, dx \,=\, \sqrt{\pi} \,. \]

So, we find

\[ C \,=\, { 2^{n/2} \over (2 \pi)^{n/2} } \,=\, c_n \,. \tag{25} \]

Application to our (n-1)-dimensional ellipsoids in a n-dimensional Euclidean space

Let us return to eq.(15), we see that

\[ f_p \,=\, \sqrt { \left( \sum_{i=1}^n \, u_i^2 \, q_i^2 \right) } \,=\, r * f_{\theta} \,=\, r * \sqrt { \left( \sum_{i=1}^n \, (u_i/r)^2(\theta_1, … \theta_i, .. ) \, q_i^2 \right) } \,. \tag{26} \]

I.e.,

\[ p \,=\, 1 \,, \tag{27} \]

and,

\[ R(E) \,:=\, { V_{n-1} ( \partial E) \over V_n(E) } \,=\, n \, { \Gamma \left( {n \over 2 }\right) \over \Gamma \left( {n+1 \over 2 }\right) } \, \, \mathbb{E} \left( \sqrt{ q_1^2 \, X_1^2 + q_2^2\, X_2^2 + \, … + q_n^2 \, X^2_n \, } \, \right) \,. \tag{28} \]

The notation deviates here from the one chosen by Rivin. We mean by Xi2 that a concrete coordinate value of a point in the Gaussian distribution must first be squared and then multiplied by qi2 ahead of the summation over all dimensions (and their Gaussians). See also [6] for this notation. The probability density by which the square root must be multiplied is given by the product of the n probability densities of the n independent Gaussian distributions (all with a variance of 1/2, so far).

Now, we can use our formula for the volume of an ellipsoid derived in post II of this series (see eq. 14 above)

\[ \begin{align} S_{n-1}(E) \,&=\, V_{n-1} ( \partial E) \\[10pt] &=\, n \, {\pi^{n/2} \over \Gamma \left(1 + {n \over 2}\right) } \, { \Gamma \left( {n \over 2 }\right) \over \Gamma \left( {n+1 \over 2 }\right) } \, \left[\prod_{i=1}^n \, a_i \right] \, \, \mathbb{E} \left( \sqrt{ q_1^2 \, X_1^2 + q_2^2\, X_2^2 + \, … + q_n^2 \, X^2_n \, } \, \right) \,. \tag{29} \end{align}\]

Because

\[ \Gamma \left({n\over 2}\right) \,=\, {2 \over n} \Gamma\left(1 + {n\over2}\right) \,, \tag{30} \]

we eventually have

\[ S_{n-1}(E) \,=\, V_{n-1} ( \partial E) \,=\, 2 \, \pi^{n/2} \, { 1 \over \Gamma \left( {n+1 \over 2 }\right) } \, \left[\prod_{i=1}^n \, a_i \right] \, \, \mathbb{E} \left( \sqrt{ q_1^2 \, X_1^2 + q_2^2\, X_2^2 + \, … + q_n^2 \, X^2_n \, } \, \right) \,. \tag{31} \]

This dependence on an expectation value is also referred to in [6].

Adaption of expectation value to standard Gaussians with a variance equal to 1

Let us evaluate the expectation value a bit further and substitute variable such that a transition to a 1-dim Gaussians for a variance = 1 occurs:

\[ I_{\mathbb{E}(f_p)} \,=\, {1 \over \pi^{n/2} } \, \int_{\mathbb{R}^{n}} \, e^{- \,r^2} \, \, f_p(x_1,x_2,..x_n\, | \, r=1) \, \,\, dx_1\, dx_2 \,…\, dx_n \,. \]

A substitution xi = vi / (21/2 ) leads to

\[ \begin{align} I_{\mathbb{E}(f_p)} \, =&\, { 2^{n/2} \over \sqrt{ (2\pi)^{n/2} \, } } \, { 1 \over 2^{n/2} } \, { \over 2^{1/2} } \, \int_{\mathbb{R}^{n}} \, e^{- \, {1\over 2} \, u^2} \, \, f_p(x_1,x_2,..x_n\, ;r=1) \, \,\, dx_1\, dx_2 \, …\, dx_n \,.\\[10pt] & { 1 \over \sqrt{2} } * { 1 \over \sqrt{ (2\pi)^{n/2} \, } } \, \int_{\mathbb{R}^{n}} \, e^{- \, {1\over 2} \, u^2} \, \, f_p(x_1,x_2,..x_n\, ;r=1) \, \,\, du_1\, du_2\, …\ du_n \, \end{align} \]

So, to move to standard Gaussians for a variance of 1 we just have to add a n-independent (!) factor 1/sqrt(2). This is of relevance when numerical programs create MVNs based on standard Gaussians.

Conclusion

The surface of an ellipsoid in the ℝn is a surprisingly difficult topic if no rotational symmetries around some axes of the ellipsoid are assumed. Today’s modern treatment normally involve incomplete elliptic and Abelian integrals; see e.g. [7] and [9]. We did not move in that direction. Instead we followed an idea of I. Rivin. We derived a formula which relates the ellipsoid’s (n-1)-dimensional surface area to an expectation value of a certain function of the ellipsoids semi-axes and Gaussian probability densities. This opens up for a numerical calculation of ellipsoidal surfaces by the means of MVN statistics. In the next post we will show numerically that Rivin’s formula is correct for general 2-dimensional ellipses and 3-dimensional ellipsoids.

Links and literature

[1] Paul Masson, Independent Physicist, San Francisco, 2021, contribution at analyticphysics.com on n-dimensional ellipsoids
https://analyticphysics.com/Higher%20Dimensions/Ellipsoids%20in%20Higher%20Dimensions.htm

[2] M.Jorgensen, 2014, “Volumes of n-dimensional spheres and ellipsoids”,
https://www.whitman.edu/Documents/Academics/Mathematics/2014/jorgenmd.pdf

[3] I. Rivin, 2003, “Surface Area of Ellipsoids”, DOI: 10.48550/arXiv.math/0306387,
https://arxiv.org/abs/math/0306387v4

[4] I. Rivin, 2004, “Surface Area And Other Measures Of Ellipsoids”, DOI: https://doi.org/10.48550/arXiv.math/0403375,
https://arxiv.org/abs/math/0403375

[5] E. Tsukerman, E.Veomett, 2016, “A Simple Proof of Cauchy’s Surface Area Formula”, DOI: 10.48550/arXiv.1604.05815 ,
https://arxiv.org/abs/1604.05815

[6] J. D. Cook, 2023, “Hyperellipsoid surface area”, blog post at
https://www.johndcook.com/blog/2023/09/11/hyperellipsoid-surface-area/

[7] G. Tee, 2004, “Surface Area And CapacityOf Ellipsoids In n Dimensions”, publication of the University of Auckland,
https://researchspace.auckland.ac.nz/server/api/core/bitstreams/64845042-d15c-4667-9ffe-c59682665f1d/content

[8] D. Hug, R. Schneider, 2020, “Vectorial analogues of Cauchy’s surface area formula”, Arch. Math. 122, 343–352 (2024).
https://doi.org/10.1007/s00013-023-01962-y and https://link.springer.com/article/10.1007/s00013-023-01962-y

[9] L. Maas, 1994, “On the surface area of an ellipsoid and related integrals of elliptic integrals”, Journal of Computational and Applied Mathematics, Volume 51, Issue 2, 1994, Pages 237-249, ISSN 0377-0427,
https://doi.org/10.1016/0377-0427(92)00009-X.