Sphere Probability: Understanding Joint Distribution

In summary, the conversation discusses using formulas to generate points inside a sphere with a given radius. The joint distribution of the variables used in the formulas (S, V, and O) is 1/(4*pi*K^3), which is not uniform. The conversation explores different methods to achieve a uniform distribution and concludes that using the inverse CDF method with the correct probability density functions (PDFs) can result in a uniform distribution. However, using the PDFs derived from the volume element may not necessarily lead to a uniform distribution.
  • #1
rabbed
243
3
Hi

If I'm using this method to generate points inside a sphere with radius K:
X = S^(1/3)*sqrt(1-V^2)*sin(O)
Y = S^(1/3)*V
Z = -S^(1/3)*sqrt(1-V^2)*cos(O)

where (0 < s < K^3), (-1 < v < 1) and (0 < o < 2*pi), i guess that:
S_PDF(s) = 1/(K^3)
V_PDF(v) = 1/2
O_PDF(o) = 1/(2*pi)

How come the joint distribution of S, V and O is 1/(4*pi*K^3)?
Shouldn't it be 1/(4*pi*K^3/3) because the volume of the sphere is 4*pi*K^3/3?
 
Physics news on Phys.org
  • #2
A volume element of the sphere is ##dV = r^2 \sin\theta \,dr\, d\theta\, d\phi## so I think it's because you distribute ##r^3## evenly ...
 
  • #3
Should S_PDF(s) actually be 3/(K^3) or is really SVO_PDF(s,v,o) = 1/(4*pi*K^3) in this case?
 
  • #4
I don't speak the jargon. But I guessed you generate a uniform distribution of ##s = r^3## and I think it should be a uniform distribution of ##s = r^2## .
 
  • #5
Was this useful ? I see you follow a multiple-track approach with loosely coupled threads (which is fine, it's just that I find it an interesting subject :smile:).
 
  • #6
Yeah, this is a very interesting subject :)
I haven't studied any of this in school so I'm just picking up bits and pieces from the net trying to make sense of it.
My goal at the moment is to derive the standard normal distribution in the most simple, concrete way possible while heading for the maxwell Boltzmann distribution as a part of understanding machine learning.
With this thread I was thinking that since I started with formulas giving cartesian coordinates from spherical coordinates, then calculated the formulas above (giving uniform surface distribution), maybe I need to use these new formulas to fill in the constants of the "unknown" distribution N(n) = C*e^(-K*n^2) which satisfies N(x)*N(y)*N(z) = N(sqrt(x^2+y^2+z^2)), since uniform direction is needed for isotropy which is a requirement of the maxwell Boltzmann distribution.
But after I posted this thread I thought that just because the joint distribution of the XYZ-components from spherical coordinates is 1/(4*pi*K^3/3) doesn't mean that the joint SVO distribution need to be the same, since they are in different coordinate systems. So maybe it was a stupid thread to begin with anyway?
Hope it made any sense :) Feel free to push me in any direction if you have experience with this.
 
  • #7
rabbed said:
derive the standard normal distribution in the most simple, concrete way possible
There's plenty of ways to get a Gaussian distribution (which can then be properly normalized to standard). A few I remember:
  • as the sum limit of uniformly distributed numbers (*)
  • as a limit of the binomial distribution
I think that even when they are not all that uniformly distributed you still get the gauss function, provided there are no correlations.
 
Last edited:
  • #8
Thanks, I can use those ways also to get a feel for what this distribution is.

I still think there should be a way to derive this N(n) from the formulas and PDF's involved in random vectors.
Maybe I should try some more with these formulas of (X,Y,Z) = f(S,V,O):
X = S^(1/3)*sqrt(1-V^2)*sin(O)
Y = S^(1/3)*V
Z = -S^(1/3)*sqrt(1-V^2)*cos(O)
I'm not sure how to get (S,V,O) = f^-1(X,Y,Z) though.
I know I need to substitute this in that etc., but it was a while since I did it. Do you know?

Hm, on second thought maybe it's enough if I use something like:
X = R*sqrt(1-V^2)*sin(O)
Y = R*V
Z = -R*sqrt(1-V^2)*cos(O)
Since it's the uniform direction I need and the radial distribution I want?
 
Last edited:
  • #10
Hey

This was pretty interesting, if I got the jacobian right for these formulas:
X = s^(1/3)*sqrt(1-v^2)*sin(o)
Y = s^(1/3)*v
Z = -s^(1/3)*sqrt(1-v^2)*cos(o)
I get |J| = (v^2-v-1)/3 which has roots v = (1+/-sqrt(5))/2, the golden ratio?
Not sure what that means if it's correct. But cool :)
 
  • #11
Using that Jacobian I get:

XYZ_PDF(o,v,s) = O_PDF(o) * V_PDF(v) * S_PDF(s) / | d(XYZ) / d(OVS) | = 1/(4*pi*K^3) / ((v^2-v-1)/3) = 1/(4*pi*K^3/3) * 1/(v^2-v-1)

So does that mean that it's still not uniform? XYZ_PDF(o,v,s) = 1/(volume of sphere) * 1/(v^2-v-1)
In that case, is it possible to change V_PDF(v) = 1/2 into something which accounts for 1/(v^2-v-1) so that XYZ_PDF(o,v,s) becomes uniform?
 
  • #12
rabbed said:
Since it's the uniform direction I need and the radial distribution I want
What is it you are trying to achieve ? (remember I don't speak the jargon, so I have to pass on #11 and #12 ).

Bear in mind that if theta is uniformly distributed you definitely don't get 'uniform direction' ! That of course requires a uniform ##\sin\theta##
 
Last edited:
  • #13
Sorry, I should have explained some more..
Instead of regular mathematical convention for coordinates, I'm using what I felt was intuitive from my 3D-coding background - a coordinate system where X is to the right, Y is up and Z is into the screen. For the 2D spherical coordinate system, I'm placing (0,0) at (0,0,-K) in the 3D coordinate system. From that point I wanted the positive longitude to increasing towards positive X before heading off into the screen (Z) and positive latitude to start increasing towards positive Y before heading off towards the north pole (at (0,K,0)). With that settled, this is what I've done so far:

Tried randomizing uniform points inside sphere of radius K using:
X = R*cos(A)*sin(O)
Y = R*sin(A)
Z = -R*cos(A)*cos(O)
(0 < o < 2*pi), (-pi/2 < a < pi/2), (0 < r < K)
The Jacobian | d(XYZ / d(OAR) | = r^2*cos(a) <- note that I get cos(a) instead of sin(a) because of the different coordinate convention.
O_PDF(o) = 1/(2pi)
A_PDF(a) = 1/pi
R_PDF(r) = 1/K

This didn't produce a uniform distribution of points inside the sphere:
XYZ_PDF(o,a,r) = O_PDF(o) * A_PDF(a) * R_PDF(r) / | d(XYZ) / d(OAR) | = 1/(2*pi^2*K) / (r^2*cos(a))

So I calculated new distributions for the variables in the volume element:
O_PDF(o) = 1/(2pi)
A_PDF(a) = cos(a)
R_PDF(r) = 3*r^2/K^3
Which gave me:
XYZ_PDF(o,a,r) = O_PDF(o) * A_PDF(a) * R_PDF(r) / | d(XYZ) / d(OAR) | = 3*r^2*cos(a)/(4*pi*K^3) / (r^2*cos(a)) = 1 / (the volume of the sphere)

So having the correct PDF's, I could use the inverse CDF method for A and R to create a new formula:
X = S^(1/3)*sqrt(1-V^2)*sin(O)
Y = S^(1/3)*V
Z = -S^(1/3)*sqrt(1-V^2)*cos(O)
(0 < o < 2*pi), (-1 < v < 1), (0 < s < K^3)
The Jacobian | d(XYZ) / d(OVS) | = (v^2-v-1)/3
O_PDF(o) = 1/(2*pi)
V_PDF(v) = 1/2
S_PDF(s) = 1/K^3

But now I get:
XYZ_PDF(o,v,s) = O_PDF(o) * V_PDF(v) * S_PDF(s) / | d(XYZ) / d(OVS) | = 1/(4*pi*K^3) / ((v^2-v-1)/3) = 1/(4*pi*K^3/3) * 1/(v^2-v-1) =
1 / (the volume of the sphere) * 1/(v^2-v-1)
So does that mean that I still don't get a uniform distribution, or is it just not uniform relative to this new OVS-space in some way?

I'm hoping that changing V_PDF(v) = 1/2 into something else will give me XYZ_PDF(o,v,s) = 1 / (the volume of the sphere) and that it'll will bring me closer to the standard normal distribution the way I explained before. There should be a connection here, since I've read that normalizing a 3D-vector of components coming from a standard normal distribution will give me uniform points on the surface of the sphere.

Does it make any sense?
 
  • #14
I calculated | d(XYZ) / d(OVS) | again in a program and came up with | d(XYZ) / d(OVS) | = 1/3, which is probably correct and gives XYZ_PDF(o,v,s) = 1 / (the volume of the sphere), so no luck there..

I think the best bet would be to investigate formulas where the direction is uniform and the radial distribution should be found, by setting up the different conditions of the radial distribution R_PDF(r):

X = R*sqrt(1-V^2)*sin(O)
Y = R*V
Z = -R*sqrt(1-V^2)*cos(O)
| d(XYZ) / d(OVR) | = r^2
O_PDF(o) = 1/(2*pi)
V_PDF(v) = 1/2
R_PDF(r) = N(r)

XYZ_PDF(o,v,r) =
O_PDF(o) * V_PDF(v) * R_PDF(r) / | d(XYZ) / d(OVR) | =
1/(2*pi) * 1/2 * N(r) / r^2 = N(r) = N(x)*N(y)*N(z)

N(n) = C*e^(-K*n^2)

The goal being to find C (and then K, somehow) without knowing about the normal distribution beforehand
 
Last edited:

Related to Sphere Probability: Understanding Joint Distribution

What is a joint distribution?

A joint distribution is a probability distribution that represents the probability of two or more random variables occurring together. It provides information on how the variables are related and how they influence each other.

Why is understanding joint distribution important?

Understanding joint distribution allows us to analyze the relationship between variables and make predictions about their behavior. It is also a crucial concept in statistical modeling and machine learning.

How is joint distribution different from marginal distribution?

Joint distribution considers the probability of two or more variables occurring together, while marginal distribution focuses on the probability of a single variable occurring. Marginal distribution can be obtained from a joint distribution by summing over all other variables.

What is the difference between joint distribution and conditional distribution?

Joint distribution considers the probability of two or more variables occurring together, while conditional distribution focuses on the probability of one variable occurring given that another variable has already occurred. Conditional distribution can be obtained from a joint distribution by dividing by the probability of the condition.

How is joint distribution calculated?

Joint distribution can be calculated by multiplying the individual probabilities of each variable occurring together. For example, if we have two events A and B, the joint probability of A and B occurring together is P(A∩B) = P(A) x P(B).

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
25
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
960
  • Set Theory, Logic, Probability, Statistics
Replies
11
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
6
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
9
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
15
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
943
Back
Top