Hi Luigi/Quantlib,
In mcbarrierengine.hpp, the constructor
MCBarrierEngine(
const boost::shared_ptr<GeneralizedBlackScholesProcess>& process,
Size timeSteps,
Size timeStepsPerYear,
bool brownianBridge,
bool antitheticVariate,
Size requiredSamples,
Real requiredTolerance,
Size maxSamples,
bool isBiased,
BigNatural seed);
only takes in GeneralizedBlackScholesProcess, If I want to use hestonprocess for this class also, it does not look possible?
It may be possible if base class stochastic process was passed instead then, perhaps both GeneralizedBlackScholesProcess and hestonprocess could be derived class objects could be passed. I may be wrong here, not really a c++ guru.
for example I would like to price a barrier option in monte carlo using say local vol, heston, bates and slv(stochastic local vol) processes and compare their pvs, how do I do it using MCBarrierEngine?
Regards
Theo
------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
As I quickly look through, it seems MCVanillaEngine will fit your purpose. Regards, Cheng 发件人: Theo Boafo [mailto:[hidden email]] Hi Luigi/Quantlib, In mcbarrierengine.hpp, the constructor MCBarrierEngine( const boost::shared_ptr<GeneralizedBlackScholesProcess>& process, Size timeSteps, Size timeStepsPerYear, bool brownianBridge, bool antitheticVariate, Size requiredSamples, Real requiredTolerance, Size maxSamples, bool isBiased, BigNatural seed); only takes in GeneralizedBlackScholesProcess, If I want to use hestonprocess for this class also, it does not look possible? It may be possible if base class stochastic process was passed instead then, perhaps both GeneralizedBlackScholesProcess and hestonprocess could be derived class objects could be passed. I may be wrong here, not really a c++ guru. for example I would like to price a barrier option in monte carlo using say local vol, heston, bates and slv(stochastic local vol) processes and compare their pvs, how do I do it using MCBarrierEngine? Regards Theo ------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
In reply to this post by Theo Boafo
You could modify the class to take an instance of StochasticProcess, but:
1) you would also have to pass a discount curve; right now the risk-free curve from the Black-Scholes process is used, but a process doesn't always contain one; 2) The corresponding path pricer class takes a Path, since Black-Scholes is a 1-D process. Heston is a 2-D process, so you would have to switch to MultiPath in the path pricer and MultiPathGenerator in the engine. You would also have to make assumptions about which of the variables represents the stock price (you know it for Heston, but now for a generic process). To begin with, it might be easier to write a specific McBarrierHestonEngine. That's what we did for European engines. Once you have it, you can see if you can refactor and merge the two different engines. Luigi On Tue, Jan 14, 2014 at 6:54 PM, Theo Boafo <[hidden email]> wrote: > Hi Luigi/Quantlib, > > In mcbarrierengine.hpp, the constructor > MCBarrierEngine( > const boost::shared_ptr<GeneralizedBlackScholesProcess>& > process, > Size timeSteps, > Size timeStepsPerYear, > bool brownianBridge, > bool antitheticVariate, > Size requiredSamples, > Real requiredTolerance, > Size maxSamples, > bool isBiased, > BigNatural seed); > > > only takes in GeneralizedBlackScholesProcess, If I want to use hestonprocess > for this class also, it does not look possible? > > It may be possible if base class stochastic process was passed instead then, > perhaps both GeneralizedBlackScholesProcess and hestonprocess could be > derived class objects could be passed. I may be wrong here, not really a > c++ guru. > > for example I would like to price a barrier option in monte carlo using say > local vol, heston, bates and slv(stochastic local vol) processes and compare > their pvs, how do I do it using MCBarrierEngine? > > Regards > > Theo > > ------------------------------------------------------------------------------ > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > Learn Why More Businesses Are Choosing CenturyLink Cloud For > Critical Workloads, Development Environments & Everything In Between. > Get a Quote or Start a Free Trial Today. > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk > _______________________________________________ > QuantLib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users > -- <https://implementingquantlib.blogspot.com> <https://twitter.com/lballabio> ------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
In reply to this post by Theo Boafo
Hi Luigi/Chen, Many thanks for your response. I would code a separate heston engine and then later try to refactor. Regards Theo ------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |