Bivariate transformation using CDF method

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
33 replies · 5K views
Yeah, that got a bit nasty. Thanks, I'll dig into how that relates geometrically later.
My main wondering was if there was some general way to deal with source RV limits when they consist of variables, but I guess it's highly specific to the geometry.

I think you might have missed something I wrote above, because I edited it while you wrote your reply maybe:
For a uniformly distributed angle of a circle with radius r, I calculated X_PDF(x) = 1/(pi*sqrt(r^2-x^2)), Y_PDF(y) = 1/(pi*sqrt(r^2-y^2)). I guess that means that I can randomize a bunch of x-coordinates according to X_PDF(x) and for each x, I set y = +/-sqrt(r^2-x^2) and this will give me a uniform distribution of points around the circle?
Would the equivalent for a sphere be to solve X_PDF(x) and Y_PDF(y) by building on the knowledge we've gathered in this post, then randomize an x and y-coordinate according to those distributions and set z = +/-sqrt(R^2-Y^2-X^2)?
Y_PDF(y) = 1/(2*R)
Z_PDF(z) = 1/(2*R)
X^2 = R^2 - Y^2 - Z^2
 
Physics news on Phys.org
rabbed said:
Yeah, that got a bit nasty. Thanks, I'll dig into how that relates geometrically later.
My main wondering was if there was some general way to deal with source RV limits when they consist of variables, but I guess it's highly specific to the geometry.
It can all be done without the geometry, but it takes a lot of checking ranges to make sure the integrals are right. Where possible, a picture will make things much clearer. Did you try drawing this one?
rabbed said:
For a uniformly distributed angle of a circle with radius r, I calculated X_PDF(x) = 1/(pi*sqrt(r^2-x^2)), Y_PDF(y) = 1/(pi*sqrt(r^2-y^2)).
Not sure how you are defining the distribution. A uniform distribution over the circle will lead to a uniform distribution of angle from the centre, but a non-uniform distribution of radius. But you might mean some other distribution over the circle. Your PDF formula doesn't look right, it doesn't integrate to 1.
 
Okay
Yes, I graphed it on www.desmos.com, but I think i'll give it up for now.

Sorry, should have been more clear, I calculated it using:
Source RV: A_pdf(a) = 1/(2*pi) 0 < a < 2*pi
Destination RV: X = R*cos(A)
If I integrate the PDF between -r to r it results in 1.
I'm learning about the inverse CDF method now so I can check if the generated x-coordinates (non-uniform along the x-axis) with associated y-coordinate +/-sqrt(1-x^2) produces points according to a uniform angle-distribution.

I would like to do the same in 3D, randomize according to some distribution(s) along for example the Y and Z-axes, set x=+/-sqrt(R^1-Y^2-Z^2) to produce uniform points on the surface of a sphere of radius R. Does it seem resonable and do you think I can get the distribution(s) using the conditions from my last post? I tried earlier today, but the result didn't seem right so i'll go over it again.
 
Or can I just distribute y and z uniformly over [-R, R] and set the associated x coordinate = +/-sqrt(R^2-Y^2-Z^2) to get points that are also uniform over the surface area of the sphere?