Box-Muller and polar algorithms

Discussion in 'CT6' started by Simon C, Apr 23, 2011.

  1. Simon C

    Simon C Member

    Hi

    Both of these algorithms generate a pair of standard normal random variates.

    As the Core Reading only really states them and doesn't give much indication of how they have been arrived at, I'm a little unsure of how they should be used in practice and what practices are/aren't valid.

    1) If I only require 1 standard normal random variate, is it valid to just choose one of the pair of variates produced?

    2) Assuming the answer to question 1 is "yes", does it matter which one of the pair I choose?

    3) If I require, say, 4 standard normal random variates, must I produce two pairs of variates or could I just produce 4 variates using only one of the algorithms? Q&A 4.24 (ii) seems to suggest the latter is the usual method which makes me wonder why we ever need to think about the second algorithm.

    Thanks
    Simon
     
  2. didster

    didster Member

    Basically it's easier to generate a pair than a single value.

    So the methods generate pairs.

    So if you want a single value you could use either method and either of the pair.

    Again if you need 4, you could use on method to generate 2 pairs or 4 pairs (where you disregard 4 of the values)
     
  3. John Lee

    John Lee ActEd Tutor Staff Member

    Apologies Simon. We have made a bodge there. It would've been far more efficient producing two pairs. I'll get that changed for next year's notes.
     
  4. Simon C

    Simon C Member

    Thanks for the replies.

    I follow now; these algorithms both use a pair of random numbers to produce a pair of standard normal random variates. Both of the random numbers are used in the calculation of both of the random variates. Furthermore the formulae used to calculate both of the random variates are extremely similar.

    Once one of the random variates in the pair has been calculated, it is therefore much more efficient to go on and calculate the second one in the pair rather than immediately start again with a new pair of random numbers.
     

Share This Page