1
$\begingroup$

Define a fish-bowl as a sphere comprised between two horizontal disks. That is, a sphere where we have replaced the top and bottom sectors by horizontal disks. See picture below.

How to sample uniformly from this surface?

My approach is to:

  1. Choose either the diskless bowl or one of the disk with probability proportional to its surface.
  2. Then, sample uniformly from this surface.
    • For the disks, we know how to do it in close form.
    • For the sphere with truncated sectors, I do rejection sampling by sampling from the sphere and rejecting until the sampled point is not in one of the removed sectors.

If my computation is correct, a surface area wholly comprised within a disk or within the truncated sphere has same probability. But what about the boundaries? My intuition is that the points neighbors to the circle of contact between a disk and the sphere won't be uniformly distributed.

enter image description here

$\endgroup$
  • 1
    $\begingroup$ They will be uniformly distributed with respect to surface area - that's exactly what your algorithm guarantees. So I think you need to examine why your intuition says otherwise near the boundary. Perhaps the distribution won't look uniform there because the curvature changes. You seem to want to connect the points sequentially. If the result is somehow wrong for your application you need to select other than uniformly on area. $\endgroup$ – Ethan Bolker May 9 '19 at 15:11
  • 2
    $\begingroup$ Incidentally, you need not do rejection sampling for the spherical part: Suprisingly the $z$ coordinate for that part turns out to be uniformly distributed across the allowed interval! (And for the other two coordinates sample $\phi$ uniformly from $[0,2\pi)$ and let $x=\sqrt{R^2-z^2}\cos\phi$, $y=\sqrt{R^2-z^2}\sin\phi)$ $\endgroup$ – Hagen von Eitzen May 9 '19 at 15:20
  • 1
    $\begingroup$ The boundaries have two-dimensional measure $0$, so they don't matter. $\endgroup$ – Robert Israel May 9 '19 at 15:51
  • $\begingroup$ @EthanBolker, well I'd rather trust an experienced mathematician than my intuition. I will accept your answer if you post it. $\endgroup$ – Julien__ May 9 '19 at 19:32
  • $\begingroup$ @HagenvonEitzen, thanks for the tip, it could be very useful! Are you sure that choosing $\phi$ uniformly in $[0, 2\pi[$ gives uniform distribution on the surface? Because It doesn't work if you take the whole sphere. A good link I used is this one corysimon.github.io/articles/uniformdistn-on-sphere $\endgroup$ – Julien__ May 9 '19 at 19:33
1
$\begingroup$

The points will be uniformly distributed with respect to surface area - that's exactly what your algorithm guarantees. So I think you need to examine why your intuition says otherwise near the boundary. Perhaps the distribution won't look uniform there because the curvature changes.

You seem to want to connect the points sequentially. Then the lines that go through the interior of the sphere may seem to be sparser than those on the disks, since they have three dimensions to play in. If the result is somehow wrong for your application you need to select other than uniformly on area.

$\endgroup$
  • $\begingroup$ And also, as @Robert Israel noted, the boundaries themselves have two-dimensional measure 0, so they don't matter. $\endgroup$ – Julien__ May 11 '19 at 12:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.