Question about Random Sequence

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about Random Sequence

cypanic

Hi all,

I am a student researching with Quantlib.
Since I am a beginner, I'm working on an example, equityOption.cpp, which is posted Quantlib.org.

What I'm trying to do is switching a random sequence.
=======================================================
mcengine1 =
            MakeMCEuropeanEngine<PseudoRandom>().withSteps(timeSteps)
            .withSamples(1000).withSeed(mcSeed);
=======================================================
What this is using is PseudoRandom which is an Uniform Random sequence.
I would like to use Normal Random Sequence using the Box-Muller method already implemented in ql.

Unfortunately, I dont know how to change the sequence that I want to use.
What should I do ?
Anyone can help me out? I will be glad to hear any advice.

Thanks.

Young.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: Question about Random Sequence

Luigi Ballabio
On Thu, 2007-09-20 at 05:36 -0500, Young Cho wrote:

> What I'm trying to do is switching a random sequence.
> =======================================================
> mcengine1 =
>             MakeMCEuropeanEngine<PseudoRandom>().withSteps(timeSteps)
>             .withSamples(1000).withSeed(mcSeed);
> =======================================================
> What this is using is PseudoRandom which is an Uniform Random
> sequence.
> I would like to use Normal Random Sequence using the Box-Muller method
> already implemented in ql.

Young,
        the MC engine is already using a Normal random sequence. The
PseudoRandom class specifies both the basic uniform generator and the
method to use for turning it into a normal generator (which by default
is the inverse-cumulative method---it is faster than Box-Muller and at
least as accurate.)

Luigi


--

Better to remain silent and be thought a fool than to speak out and
remove all doubt.
-- Abraham Lincoln



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev