How can one generate $k$ uniform random variates centered at zero, $X_1, X_2, ..., X_k$, given a constant Euclidean norm, $c =\sqrt{X_1^2+X_2^2+...X_k^2}$?
Asked
Active
Viewed 61 times
0
-
See https://stats.stackexchange.com/questions/7977/how-to-generate-uniformly-distributed-points-on-the-surface-of-the-3-d-unit-sphe – kjetil b halvorsen Sep 14 '20 at 22:48
-
4There is no solution --- if they obey the constraint then they are not independent. Perhaps also related to this [question](https://stats.stackexchange.com/questions/481715/). – Ben Sep 15 '20 at 01:46
-
1@QuestionAsker did you mean that the X's are marginally uniform, or uniform on the hypersurface? – Glen_b Sep 15 '20 at 22:37
-
1@Glen_b Uniform on the hypersurface. I was under the impression that if they were marginally uniform, they would be be uniform on the surface, but I see now this is not the case. – Joby D Sep 16 '20 at 01:54
-
For a sphere, i.e. $k=3$, uniform on the surface does imply marginally uniform (though not independent) - think Archimedes On the Sphere and Cylinder. This is not true in other dimensions. [You can then easily construct](https://stats.stackexchange.com/a/7988/2958) $X_1,X_2,X_3$ from two independent uniform random variables. – Henry Sep 16 '20 at 07:02
1 Answers
2
Generate $k$ independent standard normal random variates $Y_1, Y_2, \ldots, Y_k$
and then scale to give the desired $c$ with $$X_i= \frac{c}{\sqrt{Y_1^2+Y_2^2+\cdots+Y_k^2}}Y_i$$

Henry
- 30,848
- 1
- 63
- 107
-
1probably a duplicate but faster to type an answer than find it - https://stats.stackexchange.com/questions/7977/how-to-generate-uniformly-distributed-points-on-the-surface-of-the-3-d-unit-sphe deals with the 3D case and lots of questions are linked to it – Henry Sep 14 '20 at 22:44
-
Per Ben's comment, this fails to meet the condition that the X's are independent. If the OP removes that condition so that your answer applies, then the question is definitely a duplicate as indicated. – Glen_b Sep 15 '20 at 03:09
-
@Glen_b Whether it's a duplicate depends on how we interpret the "uniform" of the question: does it mean *marginally* uniform or uniform on the sphere's surface? The question, as currently phrased, strongly implies the former meaning is intended, whereas the duplicate addresses the latter meaning only. The answer is in the negative as one can see by drawing a picture of the case $k=2.$ – whuber Sep 15 '20 at 15:10
-
-
@whuber You're right; I didn't consider the first interpretation, but it's a natural interpretation. – Glen_b Sep 15 '20 at 22:35
-
1@whuber given that the OP has now clarified in comments, it should instead close as a duplicate though I doubt we'd gather the votes to both reopen and close again for a new reason. – Glen_b Sep 16 '20 at 02:20