Understanding Random Vectors and Hypersphere Distributions

In summary: You are correct, my mistake! In that case, the correct R_PDF(r) should be 3/(K^3), as you calculated. Sorry for the confusion!
  • #1
rabbed
243
3
Hi

There are so many different kinds of probability distributions regarding a uniform distribution
of points on the surface or inside a hypersphere in 2D and 3D and it's hard to see the big picture
or any pattern between them. I'm confused and exhausted :)

The overall fuzzy plan is to go from 2D polar coordinates (integrating by r*dr*dθ) to 3D suitable
coordinates (integrating by whatever the equivalent might be).
In both cases, I want to multiply the independent components PDF's, get the CDF and invert it
to get the cartesian coordinates of a point that will be uniformly distributed inside the
hypersphere. I guess normalization after this will give me a random vector?
Then I want to show that independent standard normal distributed coordinates will also accomplish
this after normalization, in a more unified way.

Does that plan make sense from a mathematician point of view and have I got something wrong?

Right now I'm stuck at the 2D case, I guess I want to multiply V_PDF(v) = 1/(2*pi) with some R_PDF(r).
How do I get such an R_PDF(r)?
I should end up with (x,y) = r*sqrt(u)*e^(i*2*pi*v) with u and v ~ U(0,1).

/rabbed
 
Physics news on Phys.org
  • #2
rabbed said:
How do I get such an R_PDF(r)?
Your area between r and r+dr is proportional to r, so the right pdf should have the same property. That leads to r^2 plus normalization for the cumulative probability distribution. Compare this to the area where the radial coordinate is smaller than r...
For low dimensions, suitable distributions for cartesian coordinates are so much easier.
 
  • #3
First lame attempt:

R_PDF(r) = k
V_PDF(v) = 1/(2*pi)

RV_PDF(r,v) = R_PDF(r)*V_PDF(v) = k*r/(2*pi)

RV_CDF(r,v) =
P(R < r AND V < v) =
integral wrt v from 0 to 2*pi of integral wrt r from 0 to x of RV_PDF(r,v) * r*dr*dv =
integral wrt v from 0 to 2*pi of integral wrt r from 0 to x of k/(2*pi) * r*dr*dv =
integral wrt v from 0 to 2*pi of dv * [k*r^2/(2*pi)] wrt r from 0 to x =
integral wrt v from 0 to 2*pi of k*x^2/(2*pi) * dv =
[v*k*x^2/(2*pi)] wrt v from 0 to 2*pi =
k*x^2 = 1
so k = 1/(x^2) ?

Not sure what that means :)

Also, do I have to do this in two steps where the second step gives the cartesian coordinate Y using Y_PDF(y) calculated below, and also include R_PDF(r) to get the CDF and then invert it?

V_PDF(v) = 1/(2*pi)
Y = r*sin(V)

Y_CDF(y) =
integral wrt v from pi-arcsin(y/r) to pi+arcsin(y/r) of V_PDF(v)*dv =
integral wrt v from pi-arcsin(y/r) to pi+arcsin(y/r) of 1/(2*pi)*dv =
[v/(2*pi)] wrt v from pi-arcsin(y/r) to pi+arcsin(y/r) =
(pi+arcsin(y/r))/(2*pi) - (pi-arcsin(y/r))/(2*pi) =
( (pi+arcsin(y/r)) - (pi-arcsin(y/r)) )/(2*pi) =
( pi+arcsin(y/r) - pi + arcsin(y/r) )/(2*pi) =
2*arcsin(y/r)/(2*pi) =
arcsin(y/r)/pi

Y_PDF(y) =
d[arcsin(y/r)/pi]/dy =
1/(pi*sqrt(r^2-y^2))
 
  • #4
rabbed said:
so k = 1/(x^2) ?

Not sure what that means :)
If x is your radius, that prefactor will give the right normalization.
rabbed said:
Y_CDF(y) = [...] = arcsin(y/r)/pi
Y_PDF(y) = [...] = 1/(pi*sqrt(r^2-y^2))
Looks like a reasonable result. I don't think it is helpful if you want to generate points, however, as X and Y are correlated then.

A fast way if you have access to random numbers with uniform distribution: scale/shift the distribution so it goes from -r to r. Calculate a point (x,y), compare x^2+y^2 to r^2: if the point is in the circle, you are done, if it is outside, repeat the process. While it is not guaranteed to succeed, you have a pi/4 > 75% chance each time, so on average you just need ~2.6 random numbers and a few multiplications and additions.
 
  • #5
Ok, thanks..
I spotted some errors and did some research and there is still something not adding up.
So if we have a disc with radius K on which we randomize points by using the random variables R (radius) and V (angle):

R_PDF(r) = c where (0 < r < K)
V_PDF(v) = 1/(2*pi) where (0 < v < 2*pi)

RV_PDF(r,v) = R_PDF(r)*V_PDF(v) = c/(2*pi)

RV_CDF(r,v) =
P(R < r AND V < v) =
integral wrt v from 0 to 2*pi of integral wrt r from 0 to K of RV_PDF(r,v) * r*dr*dv =
integral wrt v from 0 to 2*pi of integral wrt r from 0 to K of c/(2*pi) * r*dr*dv =
integral wrt v from 0 to 2*pi of dv * [c*r^2/(4*pi)] wrt r from 0 to K =
integral wrt v from 0 to 2*pi of c*K^2/(4*pi) * dv =
[v*c*K^2/(4*pi)] wrt v from 0 to 2*pi =
2*pi*c*K^2/(4*pi) =
c*K^2/2 = 1

so c = 2/(K^2) and we get:
R_PDF(r) = 2/(K^2)

but this should be proportional to r?

am I using the area element r*dr*dv wrong in the integration?
 
  • #6
You forgot the factor r in R_PDF(r). It has to be proportional to r.
rabbed said:
am I using the area element r*dr*dv wrong in the integration?
No, that is fine.
 
  • #7
But won't that give me the following?

R_PDF(r) = c*r where (0 < r < K)
V_PDF(v) = 1/(2*pi) where (0 < v < 2*pi)

RV_PDF(r,v) = R_PDF(r)*V_PDF(v) = c*r/(2*pi)

RV_CDF(r,v) =
P(R < r AND V < v) =
integral wrt v from 0 to 2*pi of integral wrt r from 0 to K of RV_PDF(r,v) * r*dr*dv =
integral wrt v from 0 to 2*pi of integral wrt r from 0 to K of c*r/(2*pi) * r*dr*dv =
integral wrt v from 0 to 2*pi of integral wrt r from 0 to K of c*r^2/(2*pi) * dr*dv =
integral wrt v from 0 to 2*pi of dv * [c*r^3/(6*pi)] wrt r from 0 to K =
integral wrt v from 0 to 2*pi of c*K^3/(6*pi) * dv =
[v*c*K^3/(6*pi)] wrt v from 0 to 2*pi =
2*pi*c*K^3/(6*pi) =
c*K^3/3 = 1
so c = 3/(K^3)

R_PDF(r) = r*3/(K^3)
 
  • #10
Can anyone explain this?

I'm pretty sure R_PDF(r) = 2*r/(K^2)

But how can it be derived?
 

1. What is a random vector?

A random vector is a mathematical concept used to represent a set of random variables. It is a collection of random variables, each with its own probability distribution, that are grouped together to form a vector.

2. How is a random vector different from a regular vector?

A regular vector contains deterministic values, whereas a random vector contains random variables with associated probability distributions. This means that the values in a random vector are not fixed and can change with each trial or experiment.

3. What is the importance of random vectors in statistics?

Random vectors are important in statistics because they allow us to model and analyze complex systems that involve multiple random variables. They also help us to make predictions and draw conclusions based on probability and statistical analysis.

4. How are random vectors used in machine learning?

In machine learning, random vectors are used to represent data points with multiple features or attributes. They can be used for tasks such as clustering, classification, and regression, where the goal is to find patterns and make predictions based on the data.

5. How can we generate random vectors?

Random vectors can be generated using various methods, such as sampling from a known distribution, using a random number generator, or using simulation techniques. The method used will depend on the specific problem or application at hand.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
8
Views
927
  • Set Theory, Logic, Probability, Statistics
Replies
11
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
15
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
926
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
339
  • New Member Introductions
Replies
1
Views
68
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
1K
Back
Top