26#include <ql/math/randomnumbers/rngtraits.hpp>
27#include <ql/methods/montecarlo/brownianbridge.hpp>
28#include <ql/methods/montecarlo/multipath.hpp>
29#include <ql/methods/montecarlo/multipathgenerator.hpp>
30#include <ql/methods/montecarlo/sample.hpp>
31#include <ql/models/marketmodels/browniangenerators/sobolbrowniangenerator.hpp>
32#include <ql/stochasticprocess.hpp>
52 virtual const Sample<MultiPath>&
next()
const = 0;
62 bool antitheticSampling =
false);
63 const Sample<MultiPath>&
next()
const override;
64 void reset()
override;
67 const QuantLib::ext::shared_ptr<StochasticProcess>
process_;
71 QuantLib::ext::shared_ptr<MultiPathGenerator<PseudoRandom::rsg_type>>
pg_;
72 QuantLib::ext::shared_ptr<PathGenerator<PseudoRandom::rsg_type>>
pg1D_;
75 mutable Sample<MultiPath>
next_;
93 MultiPathGeneratorSobol(
const QuantLib::ext::shared_ptr<StochasticProcess>&,
const TimeGrid&, BigNatural seed = 0,
94 SobolRsg::DirectionIntegers directionIntegers = SobolRsg::JoeKuoD7);
95 const Sample<MultiPath>&
next()
const override;
96 void reset()
override;
99 const QuantLib::ext::shared_ptr<StochasticProcess>
process_;
104 QuantLib::ext::shared_ptr<MultiPathGenerator<LowDiscrepancy::rsg_type>>
pg_;
105 QuantLib::ext::shared_ptr<PathGenerator<LowDiscrepancy::rsg_type>>
pg1D_;
118 BigNatural seed = 42,
119 SobolRsg::DirectionIntegers directionIntegers = SobolRsg::JoeKuoD7,
120 BigNatural scrambleSeed = 43);
121 const Sample<MultiPath>&
next()
const override;
122 void reset()
override;
125 const QuantLib::ext::shared_ptr<StochasticProcess>
process_;
131 QuantLib::ext::shared_ptr<MultiPathGenerator<InverseCumulativeRsg<Burley2020SobolRsg, InverseCumulativeNormal>>>
pg_;
132 QuantLib::ext::shared_ptr<PathGenerator<InverseCumulativeRsg<Burley2020SobolRsg, InverseCumulativeNormal>>>
pg1D_;
142 SobolBrownianGenerator::Ordering ordering = SobolBrownianGenerator::Steps,
144 SobolRsg::DirectionIntegers directionIntegers = SobolRsg::JoeKuoD7);
145 const Sample<MultiPath>&
next()
const override;
148 const QuantLib::ext::shared_ptr<StochasticProcess>
process_;
153 QuantLib::ext::shared_ptr<SobolBrownianGeneratorBase>
gen_;
164 SobolBrownianGenerator::Ordering ordering = SobolBrownianGenerator::Steps,
166 SobolRsg::DirectionIntegers directionIntegers = SobolRsg::JoeKuoD7);
167 void reset()
override final;
176 const QuantLib::ext::shared_ptr<StochasticProcess>&,
const TimeGrid&,
177 SobolBrownianGenerator::Ordering ordering = SobolBrownianGenerator::Steps, BigNatural seed = 42,
178 SobolRsg::DirectionIntegers directionIntegers = SobolRsg::JoeKuoD7, BigNatural scrambleSeed = 43);
179 void reset()
override final;
186QuantLib::ext::shared_ptr<MultiPathGeneratorBase>
188 const TimeGrid& timeGrid,
const BigNatural seed,
189 const SobolBrownianGenerator::Ordering ordering = SobolBrownianGenerator::Steps,
190 const SobolRsg::DirectionIntegers directionIntegers = SobolRsg::JoeKuoD7);
Multi Path Generator Base.
virtual const Sample< MultiPath > & next() const =0
virtual ~MultiPathGeneratorBase()
Instantiation using Burley2020SobolBrownianGenerator from models/marketmodels/browniangenerators.
void reset() override final
Instantiation of MultiPathGenerator with standard LowDiscrepancy traits.
const QuantLib::ext::shared_ptr< StochasticProcess > process_
Sample< MultiPath > next_
SobolRsg::DirectionIntegers directionIntegers_
QuantLib::ext::shared_ptr< MultiPathGenerator< InverseCumulativeRsg< Burley2020SobolRsg, InverseCumulativeNormal > > > pg_
QuantLib::ext::shared_ptr< PathGenerator< InverseCumulativeRsg< Burley2020SobolRsg, InverseCumulativeNormal > > > pg1D_
const Sample< MultiPath > & next() const override
MultiPathGeneratorMersenneTwisterAntithetic(const QuantLib::ext::shared_ptr< StochasticProcess > &p, const TimeGrid &grid, BigNatural seed=0)
Instantiation of MultiPathGenerator with standard PseudoRandom traits.
const QuantLib::ext::shared_ptr< StochasticProcess > process_
Sample< MultiPath > next_
QuantLib::ext::shared_ptr< PathGenerator< PseudoRandom::rsg_type > > pg1D_
QuantLib::ext::shared_ptr< MultiPathGenerator< PseudoRandom::rsg_type > > pg_
const Sample< MultiPath > & next() const override
Base class for instantiations using brownian generators from models/marketmodels/browniangenerators.
const QuantLib::ext::shared_ptr< StochasticProcess > process_
Sample< MultiPath > next_
QuantLib::ext::shared_ptr< StochasticProcess1D > process1D_
SobolBrownianGenerator::Ordering ordering_
SobolRsg::DirectionIntegers directionIntegers_
const Sample< MultiPath > & next() const override
QuantLib::ext::shared_ptr< SobolBrownianGeneratorBase > gen_
Instantiation using SobolBrownianGenerator from models/marketmodels/browniangenerators.
void reset() override final
Instantiation of MultiPathGenerator with standard LowDiscrepancy traits.
const QuantLib::ext::shared_ptr< StochasticProcess > process_
Sample< MultiPath > next_
SobolRsg::DirectionIntegers directionIntegers_
QuantLib::ext::shared_ptr< MultiPathGenerator< LowDiscrepancy::rsg_type > > pg_
const Sample< MultiPath > & next() const override
QuantLib::ext::shared_ptr< PathGenerator< LowDiscrepancy::rsg_type > > pg1D_
@ MersenneTwisterAntithetic
@ Burley2020SobolBrownianBridge
QuantLib::ext::shared_ptr< MultiPathGeneratorBase > makeMultiPathGenerator(const SequenceType s, const QuantLib::ext::shared_ptr< StochasticProcess > &process, const TimeGrid &timeGrid, const BigNatural seed, const SobolBrownianGenerator::Ordering ordering, const SobolRsg::DirectionIntegers directionIntegers)
Make function for path generators.
std::ostream & operator<<(std::ostream &out, EquityReturnType t)