# Variance of x_i chosen from uniformly distributed hypersphere

I'm looking for an expression of the variance of a single component of a point chosen from within a uniformly distributed n-ball with radius r for any n.

There are a few proofs showing that components of a point chosen this way become increasingly normally distributed as n tends to infinity. I can't seem to find expressions for any n.

Assume first the radius of the ball is $$r=1$$.

Write your point $$X$$ as a scaled point of the surface of the unit sphere: $$X=R\sigma$$, where $$R=\|X\|$$ and $$\sigma=X/R$$. It should be easy to convince yourself that $$X$$ and $$\sigma$$ are independent, and that what you want is $$E[R^2]E[\sigma_1^2]$$. The density function for $$R$$ is $$n\rho^{n-1}$$, and $$E[\sigma_1^2] = E[Z_1^2/(Z_1^2+\cdots+Z_n^2)]= 1/n$$, where the $$Z_i$$ are iid $$N(0,1)$$ variates. Thus, $$\text{Var}(X_1) = E[X_1^2] -(E[X_1])^2 = E[X_1^2]-0^2 = \int_0^1 n\rho^{n-1} \rho^2\,d\rho \times \frac 1 n = \frac {n}{n+2} \times\frac 1 n = \frac 1 {n+2}.$$

Relaxing the assumption that $$r=1$$, a simple rescaling give the general expression that $$\text{Var}(X_1)=\frac{r^2}{n+2}$$. (Because if $$X$$ is uniformly distributed on the $$1$$-ball then $$rX$$ is uniformly distributed on the $$r$$-ball and for any random variable $$Y$$, we always know $$\text{Var}(rY) = r^2\text{Var}(Y)$$.)

Note we distinguish here between the non-random $$r$$, the radius of the problem-statement ball; $$R$$ the length of the random point in the ball; and $$\rho$$, the variable of integration when taking the expectation of $$R^2$$.

Going beyond the question asked here, this formulation can help in evaluating higher moments $$E\|X_1\|^k$$ for $$k>2$$, at the price of added complexity. One has $$E\|X_1\|^k=r^k E[R^k]E[\sigma_1^k]$$. The first expectation is just $$\int_0^1n\rho^{n-1}\rho^k d\rho$$ but the second involves the $$$$Beta'' distribution, and is given by a ratio of gamma functions.

• You're a star @kimchi; thank you. Marked answered. If you get a moment, could you elaborate on how you got $\frac{r^2}{n+2}$? – Russell Apr 24 at 21:10
• He got it from $VAR[cX] = c^2 VAR[X]$. – user49404 May 15 at 18:43

I didn't totally follow @kimchi lover's answer (particularly his assumption of normality), so here is a similar approach.

Suppose X is hyperspherically uniformly distributed with r=1, so each $$X_i$$ has $$E[X_i] = 0$$, and we want to compute $$VAR[X_i]$$. Since $$E[X_i]=0$$, by the variance-squares identity, we have $$VAR[X_i] = E[X^{2}_i] - E[X_i]^2 = E[X^{2}_i]$$, so we really just need to compute $$E[X^{2}_i]$$.

Notice that $$r^2 = \Sigma_{i=1}^n X^{2}_i$$, so we have $$E[r^2] = nE[X^{2}_i]$$. Since we know that r has pdf $$p_n (r) = nr^{n-1}$$, we can trivially compute $$E[r^2] = \int_0^1 r^2 nr^{n-1}dr = \frac{n}{n+2}$$, so then $$E[X^{2}_i] = VAR[X_i] = \frac{E[r^2]}{n} = \frac{1}{n+2}$$.