From a Ball to an Ellipsoid
A uniform distribution on a ball assigns equal probability to regions of equal volume inside it. An ellipsoid is a stretched, possibly rotated, ball, so an affine transformation gives a direct way to define and simulate a uniform point in it. The transformation also makes its density and covariance accessible by calculation.
Here, “uniform on an ellipsoid” means uniform with respect to volume throughout its interior. It does not mean uniform on the ellipsoid’s boundary surface. The distinction matters: a point drawn uniformly from the volume can lie anywhere inside, whereas a point drawn from the surface lies on the boundary.
The matrix \(S=AA^\mathsf{T}\) is symmetric positive definite, and it describes the ellipsoid’s shape and orientation. Equivalently, its support is \(\{x:(x-\mu)^\mathsf{T}S^{-1}(x-\mu)\leq1\}\). The centre is \(\mu\). The eigenvectors of \(S\) give the principal-axis directions, and the square roots of its eigenvalues give the corresponding semi-axis lengths.
Density and Covariance
A linear transformation changes volume by a constant factor. That factor determines the density inside the transformed support. The same transformation carries the ball’s symmetry into a covariance matrix for the ellipsoid.
Proof. The inverse transformation is \(u=A^{-1}(x-\mu)\). Its Jacobian in the change-of-variables formula has absolute determinant \(|\det A|^{-1}\). Since \(U\) has density \(1/v_d\) when \(u^\mathsf{T}u\leq1\), the transformed density is \(1/(v_d|\det A|)\) precisely when \[ (x-\mu)^\mathsf{T}(AA^\mathsf{T})^{-1}(x-\mu)\leq1, \] and zero otherwise. This proves the density formula.
Symmetry of the ball gives \(E[U]=0\). Sign changes in individual coordinates imply \(E[U_iU_j]=0\) for \(i\neq j\), while permutations of coordinates imply that all \(E[U_i^2]\) are equal. To find their common value, let \(R=\|U\|\). Scaling the unit ball by \(r\) multiplies its volume by \(r^d\), so \(P(R\leq r)=r^d\) for \(0\leq r\leq1\). Thus \(P(R^2\leq t)=t^{d/2}\) for \(0\leq t\leq1\), and \[ E[R^2]=\int_0^1P(R^2>t)\,dt =\int_0^1(1-t^{d/2})\,dt =\frac{d}{d+2}. \] Since \(R^2=\sum_{i=1}^d U_i^2\), each \(E[U_i^2]=E[R^2]/d=1/(d+2)\). Therefore \(\operatorname{Var}(U)=I_d/(d+2)\). Applying \(X=\mu+AU\) gives \(E[X]=\mu\) and \(\operatorname{Var}(X)=A\operatorname{Var}(U)A^\mathsf{T}=AA^\mathsf{T}/(d+2)\). \(\square\)
In particular, \(S=AA^\mathsf{T}\) is not the covariance matrix: the covariance is \(S/(d+2)\). If a desired covariance matrix is \(C\), the corresponding uniform ellipsoid has shape matrix \((d+2)C\). A density that is constant inside the support is still a proper density: the ellipsoid’s volume is \(v_d|\det A|\), so the constant density times that volume is one.
Worked Example: Density and Covariance of an Ellipse
Let \(U\) be uniform on the unit disk in \(\mathbb{R}^2\), and set \[ X=\begin{pmatrix}1\\-2\end{pmatrix} +\begin{pmatrix}3&0\\0&1\end{pmatrix}U. \] Find the support, density, mean, and covariance of \(X\).
Here \(d=2\), \(v_2=\pi\), and \(A=\operatorname{diag}(3,1)\), so \(|\det A|=3\) and \(AA^\mathsf{T}=\operatorname{diag}(9,1)\). The support condition is \[ \frac{(x_1-1)^2}{9}+(x_2+2)^2\leq1. \] The density is \(1/(3\pi)\) throughout this ellipse and zero outside. Its area is \(3\pi\), confirming that the density integrates to one. The mean is \((1,-2)^\mathsf{T}\), and because \(d+2=4\), \[ \operatorname{Var}(X)=\frac{1}{4}\begin{pmatrix}9&0\\0&1\end{pmatrix} =\begin{pmatrix}9/4&0\\0&1/4\end{pmatrix}. \]
Radial Geometry and Probabilities
An ellipsoid’s probability calculations become simple when expressed in its own geometry. For a point \(x\), define its squared Mahalanobis radius relative to the ellipsoid by \(q(x)=(x-\mu)^\mathsf{T}S^{-1}(x-\mu)\). If \(X=\mu+AU\) and \(S=AA^\mathsf{T}\), then \(q(X)=U^\mathsf{T}U=R^2\). Thus the radial distribution inside the ellipsoid is inherited directly from the unit ball.
Proof. Write \(S=AA^\mathsf{T}\) with \(A\) nonsingular and represent \(X=\mu+AU\), where \(U\) is uniform on \(B_d\). Then \[ Q=U^\mathsf{T}A^\mathsf{T}(AA^\mathsf{T})^{-1}AU=U^\mathsf{T}U=R^2, \] because \(A^\mathsf{T}(AA^\mathsf{T})^{-1}A=I_d\). For \(0\leq t\leq1\), the event \(Q\leq t\) is the event \(\|U\|\leq\sqrt{t}\). The ball of radius \(\sqrt{t}\) has volume \(t^{d/2}v_d\), compared with volume \(v_d\) for the unit ball. Uniformity therefore gives \(P(Q\leq t)=t^{d/2}\). Since \(Q\geq0\) and \(Q\leq1\) on the support, the probabilities for \(t<0\) and \(t>1\) are respectively zero and one. \(\square\)
Consequently, a contour \(q(x)\leq t\) inside the support contains probability \(t^{d/2}\). A shell with inner squared radius \(a\) and outer squared radius \(b\), where \(0\leq a\leq b\leq1\), has probability \(b^{d/2}-a^{d/2}\). Equivalently, for radii \(0\leq r_1\leq r_2\leq1\), the shell probability is \(r_2^d-r_1^d\). These expressions depend on the dimension and the relative radial size, not on the ellipsoid’s centre, orientation, or axis lengths.
Worked Example: Probability Inside a Three-Dimensional Contour
Suppose \(X\) is uniform on the ellipsoid in \(\mathbb{R}^3\) with centre \(\mu=(0,0,0)^\mathsf{T}\) and shape matrix \(S=\operatorname{diag}(4,1,9)\). Find the probability that \(X^\mathsf{T}S^{-1}X\leq1/4\), and the probability that \(1/4<X^\mathsf{T}S^{-1}X\leq1\).
The dimension is three, so \(P(Q\leq t)=t^{3/2}\) for \(0\leq t\leq1\). Therefore \[ P(Q\leq1/4)=(1/4)^{3/2}=1/8. \] The shell probability is \(P(Q\leq1)-P(Q\leq1/4)=1-1/8=7/8\). The first contour has half the ellipsoid’s radius in each transformed direction, and its volume, hence its probability, is \((1/2)^3=1/8\).
Worked Example: Probability in a Two-Dimensional Elliptical Shell
Let \(X\) be uniform on the ellipse \((x_1/2)^2+x_2^2\leq1\). Find the probability that \(X\) lies between the contours with squared Mahalanobis radii \(1/4\) and \(9/16\), including the outer contour but excluding the inner one.
The dimension is two. The probability inside squared radius \(t\) is \(t^{2/2}=t\). Hence \[ P(1/4<Q\leq9/16)=P(Q\leq9/16)-P(Q\leq1/4) =\frac{9}{16}-\frac{1}{4} =\frac{5}{16}. \] Using radii instead gives outer radius \(3/4\) and inner radius \(1/2\); the shell fraction is \((3/4)^2-(1/2)^2=9/16-4/16=5/16\), as required.
A Direct Construction in Two Dimensions
The radial probability formula also gives a convenient way to simulate a uniform point in a disk. Let \(V\) be uniform on \((0,1)\), let \(\Theta\) be uniform on \([0,2\pi)\), and take them independently. Set \(R=\sqrt{V}\) and \(U=(R\cos\Theta,R\sin\Theta)^\mathsf{T}\). Then \(P(R\leq r)=P(V\leq r^2)=r^2\) for \(0\leq r\leq1\), the correct radial law for a uniform disk; the independent uniform angle supplies the rotationally symmetric direction.
Worked Example: Simulating a Uniform Point in an Ellipse
Use independent \(V\sim\operatorname{Uniform}(0,1)\) and \(\Theta\sim\operatorname{Uniform}[0,2\pi)\) to construct a uniform point in the ellipse \((x_1/2)^2+(x_2/3)^2\leq1\).
First construct a uniform point in the unit disk: \[ U=\begin{pmatrix}\sqrt{V}\cos\Theta\\\sqrt{V}\sin\Theta\end{pmatrix}. \] Apply \(A=\operatorname{diag}(2,3)\), giving \[ X=AU=\begin{pmatrix}2\sqrt{V}\cos\Theta\\3\sqrt{V}\sin\Theta\end{pmatrix}. \] Its transformed squared radius is \[ (X_1/2)^2+(X_2/3)^2=V\cos^2\Theta+V\sin^2\Theta=V\leq1, \] so \(X\) lies in the specified ellipse. The density is \(1/(\pi|\det A|)=1/(6\pi)\) there, since the ellipse has area \(6\pi\). The construction is therefore uniform over its area.
Common Mistake and Why the Geometry Matters
A common mistake is to call \(S\) the covariance matrix because it appears in the ellipsoid equation. That confuses geometric scale with probabilistic spread. For a uniform distribution on the ellipsoid with shape matrix \(S\), the covariance is \(S/(d+2)\); the dimension-dependent factor follows from the ball’s radial distribution. For example, in two dimensions, an ellipse with \(S=I_2\) has covariance \(I_2/4\), not \(I_2\).
Another error is to treat the radius \(R\) as uniform on \([0,1]\). Although the angle is uniform in two dimensions, the radius is not: \(P(R\leq r)=r^d\). In two dimensions, the area inside radius \(1/2\) is only \(1/4\) of the disk. Choosing a radius uniformly would put too much probability near the centre. The correct construction uses \(R=V^{1/d}\), which reduces to \(R=\sqrt{V}\) in the disk.
These formulas make uniform ellipsoids useful as bounded models with a specified centre and orientation. They also show exactly how their geometry determines dispersion and how to calculate probabilities for inner regions and shells without integrating the density over each region separately.
Check Your Understanding
Use the affine representation and radial formulas to answer the following.
- For a uniform vector on an ellipsoid with shape matrix \(S\) in dimension \(d\), what is its covariance matrix?
- In dimension four, what is the probability that the squared Mahalanobis radius is at most \(1/4\)?
- Why does the density of an affine image of a uniform ball involve \(|\det A|^{-1}\)?
- In two dimensions, what radius should be used to obtain a uniform point in the unit disk from \(V\sim\operatorname{Uniform}(0,1)\)?
- Explain why a uniform distribution on an ellipsoid is different from a uniform distribution on its boundary.