I have a 4-dimensional ellipsoid from which I want to draw samples uniformly. I thought of an approach using a hyper cube around the ellipsoid. We can draw a sample from it and check if it is in the ellipsoid. But the volume ratio of hypercube and ellipsoid in 4 dimensions is 0.3. That means I have only 30 percent success rate. As my algorithm has speed issues I don't want to use this approach. I have also been looking at Inverse transform sampling. Can you give me an insight on how to do this with a 4-dimensional ellipsoid ?
Asked
Active
Viewed 1,090 times
1 Answers
1
You can transform your hyper ellipsoid to a sphere.
So the given algorithm is valid for the sphere but can easily transformed to your ellipsoid.
- Draw from a gaussian distribution N(0,1) for all coordinates x1, to x4. x=[x1,x2,x3,x4].
- Normalize the vector x. ==> You have obtained uniformly distributed vectors on the surface.
- Now, draw a radius u from [0,1] for the inner point from unit sphere
- p=u**(1/4)*x is the uniformly distributed vector within the 4 dimensional unit sphere.

Bort
- 2,423
- 14
- 22
-
Thank you so much :-). Just what I wanted. – chaithu Jul 02 '14 at 10:57