Ian Buckner <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > The Box-Muller algorithm rejects roughly 22.5% of the > generated points. I'm not aware of any bound on the number > of consecutive rejections, other than a statistical one, hence > my statement. I would welcome correction if this is not the case. > > Regards > Ian > > "Radford Neal" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > >Box-Muller does not work for real time requirements. > > > > This isn't true, of course. A "real time" application is one where > > one must guarantee that an operation takes no more than some > specified > > maximum time. The Box-Muller method for generating normal random > > variates does not involve any operations that could take arbitrary > > amounts of time, and so is suitable for real-time applications. > > > > This assumes that the time needed for Box-Muller is small enough, > > which will surely often be true. If the time allowed is very small, > > then of course one might need to use some other method. > > > > Rejection sampling methods would not be suitable for real-time > > applications, since there is no bound on how many points may be > > rejected before one is accepted, and hence no bound on the time > > required to generate a random normal variate. > > > > Radford Neal =========================
What is usually called the Box-Muller method is the transformation of normal variates to polar coordinates that we all owe to Laplace for showing us how to evaluate \int_0^\infty e^{-x^2}. To get a pair of independent standard normal variates x,y, use two [0,1) uniform variates U1,U2 and put x = sqrt(-2*ln(U1))*cos(2pi*U2) y = sqrt(-2*ln(U1))*sin(2pi*U2). This is a fixed-time procedure. The random-time procedure, often mistakenly called Box-Muller, was developed in 1956 by Marsaglia: Generate uniform (-1,1) variates V1,V2 until S = V1^2 + V2^2 <1 then return x = V1*sqrt(-2ln(S)/S) y = V2*sqrt(-2ln(S)/S). George Marsaglia ================================================================= Instructions for joining and leaving this list, remarks about the problem of INAPPROPRIATE MESSAGES, and archives are available at http://jse.stat.ncsu.edu/ =================================================================