Re: random sampling on a sphere



"Mike Edwards" <mricad@xxxxxxxxx> writes:

how to randomly sample (x_1, x_2,...,x_N) such that
sum_i{(x_i)^2}=100?

it's basically sampling from the surface of a super-ball.

The solution I like is to generate a normal (gaussian) RV with randn,
then normalize. This works because the normal distribution is
radially symmetric: For a fully white multivariate gaussian, the
argument is of the form x_1^2 + x_2^2 + ... + x_N^2. A uniform RV
will not work, since the corners will be more dense.


--
Peter Boettcher <boettcher@xxxxxxxxxx>
MIT Lincoln Laboratory
MATLAB FAQ: http://www.mit.edu/~pwb/cssm/
.