# Finding marginal distribution, unit sphere

I'm asked to find the marginal distribution of $(X,Y)$ as $(X,Y,Z)$ is a point chosen uniformly on the unit sphere.

I've worked out that the joint density function $f_{XYZ}(x,y,z) = \frac{3}{4\pi}$ for $x^2+y^2+z^2 \leq 1.$

I know how to find the marginal distribution when dealing with 2-dimensions, but I'm not sure how I should set up the integrals in this case.

Would this be the correct way to go,

$$F_{X,Y}(x,y) = \int_{-\infty}^x \int_{-\infty}^y \int_{z} f_{XYZ}(x,y,z) dzdydx,$$

or am I really computing the marginal distribution of $F_X(x)$ if I do that?

Also, I'm having some problems understanding the difference between finding the density function and distribution function in cases like this. To me, it seems to be the same method for both functions?

• You're doing the right job. The distribution of the random variable $(X,Y)$ (which is a marginal in this case) must be a function of two real variables, say $(x,y)$; you must therefore "zap" the $z$ from $f_{XYZ}$ by averaging it out. So marginal density is $$f_{XY}(x,y)=\int_{\mathbb R}f_{XYZ}(x,y,z)\operatorname dz,$$ whence (upon averagin in $x$ and $y$) your formula for $(X,Y)$'s distribution. Jan 25, 2016 at 9:27
• Note that "=" should read "$\leq$" in $x^2+y^2+z^2\leq1$. I advise newbies to learn the Iverson--Knuth brackets that make the algebra much easier for this type of exercises. Jan 25, 2016 at 9:33
• About the "=", you are of course right! Will edit. But if I would like to find $f_X(x)$, wouldn't I essentially compute the exact same thing? And is the density function and the distribution function the same thing in this case? Jan 25, 2016 at 9:45
• There is a big difference between a ball ($\leq1$) and a sphere ($=1$). If the original question is about the unit sphere then there cannot exist a 3-dimensional density function. Jan 25, 2016 at 9:47
• Yes you follow the formula to integrate and obtain the joint pdf of $(X, Y)$: $\displaystyle \int_{-\sqrt{1-x^2-y^2}}^{\sqrt{1-x^2-y^2}} \frac {3} {4\pi} dz = \frac {3} {2\pi} \sqrt{1 - x^2 - y^2}, x^2 + y^2 \leq 1$ Note that they are not uniformly distributed inside the unit disk.
– BGM
Jan 25, 2016 at 10:52

A uniform distribution on the sphere does not have a density function in three variables, but the marginal distribution for two of the three variables does have a density. It is obtained by expressing the area element of the sphere $\sin\theta d\varphi\wedge d\theta$ in new coordinates $x$ and $y$ and then normalizing.

\eqalign{ \sin^2\theta&=x^2+y^2\\ 2\sin\theta\cos\theta d\theta&=2xdx+2ydy\\ \sin\theta d\theta&=\frac{xdx+ydy}{\sqrt{1-x^2-y^2}}\\ \varphi&=\arctan\left(\frac y x\right)\\ d\varphi&=\frac1{1+\frac{y^2}{x^2}}\left(\frac1xdy-\frac{y}{x^2}dx\right)\\ \sin\theta d\varphi\wedge d\theta&=\frac1{\sqrt{1-x^2-y^2}}dx\wedge dy\\ }

This gives the density function

$$\frac1{2\pi\sqrt{1-x^2-y^2}}$$

on the disk $x^2+y^2\leq1.$

• I am not sure I follow, would you like to specify how you reached that result? Jan 25, 2016 at 12:06
• There was an error in my original volume element (missing $\sin\theta$); does this one look better? Jan 25, 2016 at 12:23
• That was very helpful, thank you! Jan 25, 2016 at 12:30
• @Justpassingby Very impressive! Could you give a reference which presents the proof details? In multivariate statistics, we know that if $x$ has a density, then any marginal distribution of $x$ has a density. However, the fact that any marginal distribution of $x$ has a density can not guarantee the density existence of $x$; uniform distribution in the surface of the unit is such a case (counterexample), but I don't know how to proof it in details? Mar 9 at 3:55

An alternative solution (eschewing spherical coordinates) may be based on the approximation of the surface density by a bulk one as follows. Let $$h>0$$ (destined to go to zero). Consider the spherical shell $$\Sigma_h$$ of thickness $$h$$ about the sphere of radius $$1$$, i.e., the union of all the spheres of center $$0$$ and radius ranging between $$1-h/2$$ and $$1+h/2$$. Since this is a $$3$$-dimensional volume you may consider on it a uniform distribution (constant function) $$f_{XYZ}^h\equiv c(h)$$, with $$c(h)$$ constant in $$x,y,z$$ (but depending on $$h$$) chosen such that the integral of $$f_{XYZ}^h$$ is $$1$$. So $$c(h)=1/\operatorname{vol}\Sigma_h$$, which the following calculation reveals: $$\operatorname{vol}\Sigma_h = \int_{1-h/2}^{1+h/2}\int_{\partial B_0(\rho)}\operatorname d S\operatorname d\rho = \int_{1-h/2}^{1+h/2}4\pi\rho^2\operatorname d\rho = \frac{4\pi}3\Big(3h+\frac{h^3}4\Big) = 4\pi h+\frac\pi3h^3 .$$ As $$h\to0$$ the mass of the shell stays $$1$$, $$c(h)\approx1/(4\pi{h}\to\infty$$ and the $$f_{XYZ}^h$$ converges (weakly, or in the sense of distributions, or whatever your mathematical religion prescribes, but intuition is what matters) to $$f_{XYZ}$$. Thanks to the integral being bounded to compute $$f_{XY}$$ it is legitimate to interchange limits (here the theory of distribution does come handy, but you can use geometric measure theory,if you prefer) to integrate $$f^h_{XYZ}$$ in $$z$$ first and then take $$h\to0$$. The integration in $$z$$ rests on some simple geometry, for all $$x,y$$ such that $$x^2+y^2<(1-h/2)^2$$, the line passing through $$(x,y)$$ intersect the shell twice symmetrically about the $$(x,y)$$-plane. Looking at the upper half (and then doubling the result) the length of the segment is given by $$S^+_h(x,y)-S^-_h(x,y)$$ where $$S_h^\pm$$ are functions whose graphs are the outer and inner boundaries of the (upper half of the spherical) shell, respectively. Explicitly $$S^\pm_h(x,y)=\sqrt{(1\pm h/2)^2-x^2-y^2}=:F(\pm h).$$ The auxiliary function $$F$$'s Taylor expansion of order $$1$$ about $$0$$ yields $$S^+_h(x,y)-S^-_h(x,y) = 2F'(0)h+o(h) = \frac{h+o(h)}{\sqrt{1-x^2-y^2}} ,$$ since $$F'(\xi)=\frac{1+\xi/2}{2\sqrt{(1+\xi/2)^2-x^2-y^2}}.$$ Multiplying this by $$2$$ (to take into account the lower half of the sphere) and the density normalizing constant $$c(h)$$ we obtain $$\int_{\mathbb R} f^h_{XYZ}(x,y,z)\operatorname dz = \frac{2h+o(h)}{\sqrt{1-x^2-y^2}(4\pi h+\pi h^3/3)} = \frac{1+o(h^0)}{\sqrt{1-x^2-y^2}(2\pi+\pi h^2/6)} \to \frac1{2\pi\sqrt{1-x^2-y^2}} ,\text{ as }h\to0 .$$