Login  Register

Re: Barrier options

Posted by Yannis on Jan 22, 2017; 7:39am
URL: http://quantlib.414.s1.nabble.com/Barrier-options-tp17983p17984.html

Hi Mariano,

Try replacing RandomSequenceGenerator<MersenneTwisterUniformRng> with either PseudoRandom or PoissonPseudoRandom for normally or exponentially distributed random number generator. Both use MersenneTwisterUniformRng since they are defined as follows:

    typedef GenericPseudoRandom<MersenneTwisterUniformRng, InverseCumulativeNormal> PseudoRandom;
    typedef GenericPseudoRandom<MersenneTwisterUniformRng, InverseCumulativePoisson> PoissonPseudoRandom;

Regards
Yannis


Mariano Zeron <[hidden email]> schrieb am 9:35 Sonntag, 22.Januar 2017:


Hi,

I'm interested in pricing a barrier option not using an analytic solution,
for example through a Monte Carlo simulation. I found MCBarrierEngine but so
far I have had problems using it.

I seem to have a problem passing the right template argument list. I tried


boost::shared_ptr<PricingEngine> barrierEngineMC(
new MCBarrierEngine<RandomSequenceGenerator&lt;MersenneTwisterUniformRng>,
GeneralStatistics>(bsmProcess, timeSteps, 24, true, true, nSamples,
0.000001, nSamples + 10000, false, 42));


There are quite a few errors all of them related to the use of

RandomSequenceGenerator<MersenneTwisterUniformRng>

for example (I can pass all if needed):

  'rsg_type' : is not a member of
'QuantLib::RandomSequenceGenerator<QuantLib::MersenneTwisterUniformRng>'


What is the right way of using this engine? As a side question but directly
related to what I need, can this engine be used to price single barrier
options (which I can price using the analytic pricer) or is this engine
restricted to more exotic barriers?

Thanks in advance!

Mariano



--
View this message in context: http://quantlib.10058.n7.nabble.com/Barrier-options-tp17983.html
Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users