Radially distributed Cartesian coordinates

  • #1
243
3
Ok, so randomizing three random variables, X, Y and Z, each from a standard normal distribution, then plotting these in an ordinary cartesian coordinate system gets me a spherically symmetric cloud of points.

Now I want to create this cloud having the same probability distribution but by using a sphere formula having a uniform direction distribution and a radius of some function f(R) where R has some unknown distribution:
X = f(R)*sqrt(1-V^2)*sin(O)
Y = f(R)*V
Z = -f(R)*sqrt(1-V^2)*cos(O)
|J| = | d(XYZ) / d(OVR) | = f(r)^2*f'(r)
O_PDF(o) = 1/(2*pi) where (0 < o < 2*pi)
V_PDF(v) = 1/2 where (-1 < v < 1)
R_PDF(r) = ?

So I want to calculate R_PDF(r). I know that R^2 = X^2 + Y^2 + Z^2 so I use the CDF method to first
find the distribution of XS = X^2 knowing that X_PDF(x) = 1/sqrt(2*pi)*e^(-x^2/2).

This gets me XS_PDF(xs) = 1/sqrt(2*pi*xs)*e^(-xs/2) which is the same for YS_PDF and ZS_PDF

Then I want to calculate RS_PDF(rs) from RS = XS + YS + ZS, knowing XS_PDF(xs), YS_PDF(ys) and ZS_PDF(zs):

RS_PDF(rs) =
RS_CDF'(rs) =
( P(RS < rs) )' =
( P(XS + YS + ZS < rs) )' = ?

What to do here?
 
Last edited:
  • #3
Hi rabbed:

If you assume that the x, y, and z variable Gaussian distributions all have a zero mean as well as the same standard deviation, then what is the joint probability density p(x,y,z) at a point [x,y,z]? What do you get if you then convert p(x,y,z) to spherical coordinates, p(r,θ,φ)?

Hope this helps.

Regards,
Buzz
 
  • #4
Hi Buzz

XYZ_PDF(x,y,z) =
X_PDF(x) * Y_PDF(y) * Z_PDF(z) =
1/sqrt(2*pi)*e^(-x^2/2) * 1/sqrt(2*pi)*e^(-y^2/2) * 1/sqrt(2*pi)*e^(-z^2/2) =
1/(2*pi)^(3/2)*e^(-(x^2+y^2+z^2)/2)

Substituting with these:
x = r*cos(a)*sin(o)
y = r*sin(a)
z = -r*cos(a)*cos(o)
Gives:
XYZ_PDF(x,y,z) =
1/(2*pi)^(3/2)*e^(-((r*cos(a)*sin(o))^2+(r*sin(a))^2+(-r*cos(a)*cos(o))^2)/2) =
1/(2*pi)^(3/2)*e^(-r^2/2)

Subtituting with these:
X = f(R)*sqrt(1-V^2)*sin(O)
Y = f(R)*V
Z = -f(R)*sqrt(1-V^2)*cos(O)
Gives:
XYZ_PDF(x,y,z) =
1/(2*pi)^(3/2)*e^(-((f(R)*sqrt(1-V^2)*sin(O))^2+(f(R)*V)^2+(-f(R)*sqrt(1-V^2)*cos(O))^2)/2) =
1/(2*pi)^(3/2)*e^(-f(R)^2/2)

So then I have
X = f(R)*sqrt(1-V^2)*sin(O)
Y = f(R)*V
Z = -f(R)*sqrt(1-V^2)*cos(O)
|J| = | d(XYZ) / d(OVR) | = f(r)^2*f'(r)
O_PDF(o) = 1/(2*pi) where (0 < o < 2*pi)
V_PDF(v) = 1/2 where (-1 < v < 1)
R_PDF(r) = 1/(2*pi)^(3/2)*e^(-f(r)^2/2)

But what is f(r)?

Is it now true that O_PDF(o) * V_PDF(v) * R_PDF(r) / |J| = X_PDF(x) * Y_PDF(y) * Z_PDF(z) or are the coordinates of either (O, V, R) or (X, Y, Z) statistically dependent?
 
Last edited:
  • #5
1/(2*pi)^(3/2)*e^(-r^2/2)
Hi rabbed:

Why is this not the radially symmetric distribution you want?

Regards,
Buzz
 
  • #6
Hi Buzz

It probably is. But after learning about the jacobian and how the area/volume-element for a circle/sphere depends on the radius I'm a bit suspicious about radial distributions.. :)
I guess since I'm just substituting coordinates, it's ok and the first step I should make, so XYZ_PDF(r,a,o) = XYZ_PDF(r,v,o) = 1/(2*pi)^(3/2)*e^(-r^2/2)?
But for finding out this f(R) and formulas to visualize the cloud radially, i would need to continue as I did, right? Because of the Jacobian..
I think my last question is relevant in doing this? Or is it not possible to create such formulas?

Rgds
rabbed
 
  • #7
XYZ_PDF(r,a,o) = XYZ_PDF(r,v,o) = 1/(2*pi)^(3/2)*e^(-r^2/2)?
Hi rabbed:

The density function gives a value for a point in the domain of the distribution. To get the probability of a random point being in a specific volume, you would integrate the density function over the volume.
P = prob {random point is in V} = ∫ p dV .​
For Cartesian coordinates,
P = ∫ p(x,y,z) dx dy dz .​
For polar coordinates,
P = ∫ p(r) r2 dr dφ sin θ dθ .​

I think that is a ll you need.

Regards,
Buzz
 
  • #8
Hi again Buzz

So to find f(R), I need to check out how to treat the error function? Or Box Muller in 3D? I've also seen something about covariance matrices..

I still think this link was interesting, because it will lead me into Gamma and Chi squared, which I've understood are important:
Maybe the change of variables/PDF method is better..
I found this document: https://www2.stat.duke.edu/courses/Spring11/sta114/lec/114mvnorm.pdf

I don't understand how, on page 2, fY(y) = 2/sqrt(2*pi)*e^(-y/2) / |2*sqrt(y)|
shouldn't it be fY(y) = 1/sqrt(2*pi)*e^(-y/2) / |2*sqrt(y)| since fY(y) = fX(g^-1(y)) / g'(g^-(y)) ?

Can you answer that?
 
  • #9
Can you answer that?
Hi rabbed:

Sorry, but I can't help you with this. The notation for expressing problems used at the link you gave is different than the notations I learned many decades ago, and I am unable to make sense of it. The equations you quoted also use notations I don't understand. For example, what does fY(y) mean? If you wrote English defintions for all the notations, then perhaps I might be able to answer your question.

Regards,
Buzz
 
Last edited:
  • #10
Hi

Glad to see someone else having issues with notation.
fY(y) should be the wanted PDF of Y where Y is a random variable expressed as a function, g, of the random variable X.
Since Y = g(X) = X^2, the inverse of g gives us X = g^-1(Y) = +/- sqrt(Y)
I thought the PDF of X was 1/sqrt(2*pi)*e^(-x^2/2), but the X~No(0,1) and the sigma x:x^2=y makes me think now that what's being calculated is different from what I was trying to do in the first post of this thread.

Hope you or someone else can explain
 
Last edited:
  • #11
According to this page http://www.gamlss.org/wp-content/uploads/2014/10/distributions.pdf on page 225, NO(0,1) = 1/sqrt(2*pi)*e^(-x^2/2)
So that means maybe X_PDF(x) = 1/sqrt(2*pi)*e^(-x^2/2) in the other document, after all.

Maybe the sigma is summing X_PDF's so that we get:
Y_PDF(y) = (X_PDF(x) + X_PDF(x)) / g'(X) = 2*X_PDF(g^-1(y)) / g'(g^-1(y)) = 2*X_PDF(sqrt(y))) / g'(sqrt(y)) = 2/sqrt(2*pi)*e^(-y/2) / |2*sqrt(y)|
Instead of:
Y_PDF(y) = X_PDF(x) / g'(X) = X_PDF(g^-1(y)) / g'(g^-1(y)) = X_PDF(sqrt(y))) / g'(sqrt(y)) = 1/sqrt(2*pi)*e^(-y/2) / |2*sqrt(y)|
?

It could be tied to the fact that the Gamma function has one special case of parameters, (Ga(1/2,1/2) according to the document), which is why the Box Muller method can sample the normal distribution. I read something about that.

Can someone confirm?
 
  • #12
Hi again

If we skip the side track, is it possible to sample from the radial distribution 1/(2*pi)^(3/2)*e^(-r^2/2) that was derived?

According to this link:
http://mathematics.livejournal.com/1144375.html
I think I should sample the "lower incomplete gamma function", somehow..

Rgds
rabbed
 
Last edited:

Suggested for: Radially distributed Cartesian coordinates

Replies
5
Views
4K
Replies
2
Views
964
Replies
4
Views
1K
Replies
3
Views
931
Replies
2
Views
991
Replies
8
Views
1K
Replies
4
Views
1K
Back
Top