Login  Register

Re: Normal Random Generator

Posted by Jon Davidson-2 on Jun 02, 2010; 9:38am
URL: http://quantlib.414.s1.nabble.com/Normal-Random-Generator-tp8012p8021.html

I've used the Ziggurat method a bit. Its the matlab implementation for normal random numbers and you can get some C source code from Octave. There is a small issue with generating uniform random numbers, which are embedded in the normal random number calculation. They use a very simple modular arithmetic number generator. In my code I replaced this with a Mersenne twister genertor. The whole thing is still about 5 to 10 times faster than box-muller which I first noticed because my matlab black-scholes was working as fast a C version of black-scholes, which doesn't make sense. However, my own implementation was in java but was just a translation of the octave C code.

Hope this is useful.

Jonathan Davidson

--- On Wed, 2/6/10, Kakhkhor Abdijalilov <[hidden email]> wrote:

> From: Kakhkhor Abdijalilov <[hidden email]>
> Subject: Re: [Quantlib-users] Normal Random Generator
> To: [hidden email]
> Date: Wednesday, 2 June, 2010, 1:22
> I will take a look. Please post your
> code here.
>
> Looks like Ziggurat method can generate many distributions
> precisely
> and very quickly, provided a good RNG is available.
>
> On Tue, Jun 1, 2010 at 4:59 PM, Seb Venus <[hidden email]>
> wrote:
> > There are a lot of different generators, but an
> obvious candidate is the
> > Ziggurat method, which has become a standard method in
> the Matlab library.
> > http://www.mathworks.com/company/newsletters/news_notes/clevescorner/spring01_cleve.html
> >
> > It is far faster than many other pseudo generators. I
> have some code that I
> > could provide if it would be useful.
> >
> >
> >> CC: [hidden email]
> >> From: [hidden email]
> >> To: [hidden email]
> >> Subject: Re: [Quantlib-users] Normal Random
> Generator
> >> Date: Tue, 1 Jun 2010 21:48:50 +0200
> >>
> >>
> >> On Jun 1, 2010, at 7:43 PM, Seb Venus wrote:
> >>
> >> > Has anyone given thought to using something
> other than boxmuller,
> >> > centrallimit or InverseCumulativeNormal?
> >>
> >> Such as?
> >>
> >> Luigi
> >>
> >
> > ________________________________
> > Get a free e-mail account with Hotmail. Sign-up now.
> >
> ------------------------------------------------------------------------------
> >
> >
> > _______________________________________________
> > QuantLib-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/quantlib-users
> >
> >
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>


     

------------------------------------------------------------------------------

_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users