How to convert a gaussian distributed rnd sequence to uniform dist and viceversa

In summary, to convert a gaussian distributed random sequence to a uniform distribution, you can use the Box-Muller transformation which involves taking two independent random variables from a standard uniform distribution and using them to calculate two new variables that follow a normal distribution. The formula for the Box-Muller transformation is X = sqrt(-2ln(R1)) * cos(2pi*R2) and Y = sqrt(-2ln(R1)) * sin(2pi*R2), where R1 and R2 are random variables from a standard uniform distribution, and X and Y are the new variables following a normal distribution. It is possible to convert any gaussian distributed random sequence to a uniform distribution using the Box-Muller transformation, but the resulting distribution
  • #1
dexterdev
194
1
Hi PF,
I have a device (with a microcontroller) which generates random numbers. when I analyzed those numbers using Matlab software I found that it is following a uniform distribution. How can I mathematically (any algorithm?) convert this random output to a gaussian one. Also I would like to know the reverse case ie gaussian to uniform one.

-Devanand T
 
Physics news on Phys.org
  • #2
If F is the cdf of the Gaussian distribution, and x is a point from your uniform distribution 0<=x<=1, then [itex]y= F^{-1} (x) [/itex] has a Gaussian distribution.
 

1. How do I convert a gaussian distributed random sequence to a uniform distribution?

To convert a gaussian distributed random sequence to a uniform distribution, you can use the Box-Muller transformation. This involves taking two independent random variables from a standard uniform distribution and using them to calculate two new variables that follow a normal distribution.

2. What is the formula for converting a gaussian distributed random sequence to a uniform distribution?

The formula for the Box-Muller transformation is:

X = sqrt(-2ln(R1)) * cos(2pi*R2)

Y = sqrt(-2ln(R1)) * sin(2pi*R2)

where R1 and R2 are random variables from a standard uniform distribution, and X and Y are the new variables following a normal distribution.

3. Is it possible to convert any gaussian distributed random sequence to a uniform distribution?

Yes, it is possible to convert any gaussian distributed random sequence to a uniform distribution using the Box-Muller transformation. However, the resulting uniform distribution may not be a perfect fit due to the limitations of generating random numbers on a computer.

4. How can I convert a uniform distribution to a gaussian distributed random sequence?

To convert a uniform distribution to a gaussian distributed random sequence, you can use the inverse of the Box-Muller transformation. This involves taking two independent random variables from a standard normal distribution and using them to calculate two new variables that follow a uniform distribution.

5. Can I use other methods besides the Box-Muller transformation to convert between distributions?

Yes, there are other methods for converting between distributions, such as the Ziggurat algorithm and the Marsaglia polar method. However, the Box-Muller transformation is the most commonly used method for converting between a gaussian distributed random sequence and a uniform distribution. It is also relatively easy to implement and computationally efficient.

Similar threads

  • Calculus and Beyond Homework Help
Replies
1
Views
508
  • Set Theory, Logic, Probability, Statistics
Replies
15
Views
1K
  • Programming and Computer Science
Replies
1
Views
579
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
5K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
8K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
5K
Replies
1
Views
727
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
1K
Back
Top