# If $U$ is uniformly distributed on $S^{d-1} \subset \mathbb{R}^d$, what's the distribution of its orthogonal projection onto any vector?

Let $$U \in S^{d-1} \subset \mathbb{R}^d$$ follow a uniform distribution on a sphere. Let $$v \in \mathbb{R}^d.$$ Then is the orthogonal projection $$U^{T}v=\langle U,v \rangle$$ uniformly distributed, and if yes/no, how do I go about proving it? This is motivated by this relevant question for uniform distributions on 2D spheres. If it's wrong, could you give a counterexample?

If it's not uniformly distributed, how can we find the PDF of $$U^{T}v=\langle U,v \rangle?$$

• $U$ is a vector right? So $Uv$ is what? A real number given by the euclidean product? – Stockfish Jul 23 at 8:14
• Simpler question : taking $v = e_1 = (1,0,...,0)$, we have $U^Tv = U_1$. Now, the question is : if $U$ is uniformly distributed on the $d-1$ sphere, is $U_1$ uniformly distributed? Think about this one. – Teresa Lisbon Jul 23 at 8:18
• Hint: Suppose $d=2$ and $v$ has unit-length. Then $U^Tv= \cos\theta$, where $\theta$ is the angle between $U$ and $v$. Clearly $\theta$ is uniformly distributed in $[-\pi,\pi]$, but you can check that $\cos \theta$ is not uniformly distributed on $[-1,1]$. – Jan Bohr Jul 23 at 8:28
• @LearningMath That is for $d=3$, right? – Teresa Lisbon Jul 23 at 11:07
• The square of your $\langle U,v\rangle$ has a "beta distribution" if $\|v\|=1$, as can be seen from the representation of $U=Z/\|Z\|$ where the coordinates of $Z$ are iid $N(0,1)$. – kimchi lover Jul 23 at 13:50

Let $$v$$ be a unit vector. Since the orthogonal group acts transitively on the unit sphere, there exists a rotation matrix $$R$$ such that $$Rv=e$$, where $$e=(1,0,\ldots,0)'$$.
Now let $$Z=(Z_1,\ldots,Z_d)'$$ be a vector of independent identically distributed $$N(0,1)$$ random variables. The distribution of $$Z$$ is clearly rotationally invariant, and the normalized vector $$U=Z/\|Z\|$$ is uniformly distributed over the unit sphere, as is $$R'U$$. (See, eg, the answer by Henricus V. to this MSE question, and comments, and this one, about this trick. It is a converse to Maxwell's theorem.) The quantity $$\langle U, v\rangle=\langle U,Re\rangle=\langle R' U,e\rangle,$$ so the distribution of $$\langle U, v\rangle$$ is the same as that of $$\langle U, e\rangle$$. So we may as well assume $$v=e$$ in working out the distribution of $$T=\langle U,v\rangle$$.
With this notation, $$T=\langle U,v\rangle=Z_1/\sqrt{\sum_{i=1}^d Z_i^2}$$, and $$T^2=Z_1^2/\sum_{i=1}^d T_i^2$$. The quantities $$Z_i^2$$ are iid Gamma distributed: $$Z_i^2\sim\Gamma(\frac 1 2,\frac 1 2)$$ and $$\sum_{i=2}^d Z_i^2\sim\Gamma(\frac{d-1}2,\frac 12)$$ and hence $$T^2$$ has the $$\operatorname{Beta}(\frac 1 2,\frac {d-1}2)$$ distribution. If we write $$W=T^2$$, the density function of $$W$$ is proportional to $$w^{-\frac{1}2} (1-w)^{\frac{d-1}2-1}$$ for $$0, and the density of $$T$$ is proportional to $$(1-t^2)^{(d-3)/2}$$ for $$-1. Only if $$d=3$$ does the distribution of $$T$$ become uniform over its range.
• Thank you for your answer! To finish your line of arguments, I think we need to show that any uniform distribution $U$ on the sphere can be written as a ratio $U:= Z/||Z||, Z=(Z_1 \dots Z_d), Z_i \sim_{iid} \mathcal{N}(0,1).$ Is it obvious, sorry if it is. I know that the other side is true: if $Z \sim \mathcal{N}(0,I_d),$ then $U:= Z/||Z|| \sim \mathcal{U}nif(S^{d-1}).$ – Learning Math Jul 23 at 16:33
• Also for a general unit vector $v, U^{T}v$ seems hard to relate with $Ue_1, e_1:=(1, 0, \dots 0).$ I was thinking of using rotation matrix to bring $v$ to $e_1,$ but couldn't make it work instantly. So I guess one way to go about it will be $U^{T}v = v_1U_1 + \dots v_dU_d, U_i$ following square root of a $Beta(1/2, \frac{d-1}{2})$ distribution as you showed. But these Beta distributions are not independent, being component of a sphere-valued distribution. So how do we calculate the distribution of $U^{T}v$ for a general unit vector $v?$ – Learning Math Jul 23 at 16:58
• I have edited again, with pointers to $Z/\|Z\|$ being uniformly distributed on the sphere. This is related to the spherical symmetry of both the sphere and of the multivariate Gaussian distribution. – kimchi lover Jul 23 at 20:16