Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Box Muller transform

  1. May 24, 2010 #1
    Can i use box muller transform to generate a distribution with two different sigma (i.e. sigma_x and sigma_y)?

    I want to generate a random gaussian angle (C) relative to z axis on circle plane, then set the angle relative to the x, A and y axis, B, wrt to the original angle.
    However, I want the output to be elliptical on x/y plane...

    Some pseudo code would help.
     
  2. jcsd
  3. May 24, 2010 #2
    If X is normal with zero mean and std dev = 1, then you can transform it into a random variable Z with mean u and std dev sigma as follows:

    Z = sigma*X + u

    The Box-Muller transform gives you two random variables which are standard normally distributed iirc, so just apply the above transformation to each.
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook