32#include <ql/patterns/lazyobject.hpp>
33#include <ql/settings.hpp>
34#include <ql/time/daycounters/actualactual.hpp>
35#include <ql/methods/montecarlo/lsmbasissystem.hpp>
37#include <boost/any.hpp>
38#include <boost/enable_shared_from_this.hpp>
45class Model :
public LazyObject {
58 QuantLib::LsmBasisSystem::PolynomialType
polynomType = QuantLib::LsmBasisSystem::PolynomialType::Monomial;
59 QuantLib::SobolBrownianGenerator::Ordering
sobolOrdering = QuantLib::SobolBrownianGenerator::Steps;
71 virtual Size
size()
const {
return n_; }
84 virtual const std::string&
baseCcy()
const = 0;
87 virtual Real
dt(
const Date& d1,
const Date& d2)
const {
88 return ActualActual(ActualActual::ISDA).yearFraction(d1, d2);
96 const std::string& currency)
const = 0;
103 const boost::optional<long>& memSlot,
const RandomVariable& addRegressor1,
117 const bool returnMissingFixingAsNull =
false,
118 const bool ignoreTodaysFixing =
false)
const = 0;
122 const Date& start,
const Date& end,
const Real spread,
const Real gearing,
123 const Integer lookback,
const Natural rateCutoff,
const Natural fixingDays,
124 const bool includeSpread,
const Real cap,
const Real floor,
125 const bool nakedOption,
const bool localCapFloor)
const = 0;
132 virtual Real
fxSpotT0(
const std::string& forCcy,
const std::string& domCcy)
const = 0;
virtual Real dt(const Date &d1, const Date &d2) const
virtual RandomVariable eval(const std::string &index, const Date &obsdate, const Date &fwddate, const bool returnMissingFixingAsNull=false, const bool ignoreTodaysFixing=false) const =0
virtual const Date & referenceDate() const =0
void performCalculations() const override
virtual void resetNPVMem()
virtual Type type() const =0
virtual RandomVariable pay(const RandomVariable &amount, const Date &obsdate, const Date &paydate, const std::string ¤cy) const =0
std::map< std::string, boost::any > additionalResults_
virtual Real extractT0Result(const RandomVariable &value) const =0
virtual Real fxSpotT0(const std::string &forCcy, const std::string &domCcy) const =0
virtual void releaseMemory()
virtual void toggleTrainingPaths() const
Real timeFromReference(const Date &d) const
virtual RandomVariable discount(const Date &obsdate, const Date &paydate, const std::string ¤cy) const =0
virtual Size trainingSamples() const
virtual Size size() const
virtual const std::string & baseCcy() const =0
virtual RandomVariable npv(const RandomVariable &amount, const Date &obsdate, const Filter &filter, const boost::optional< long > &memSlot, const RandomVariable &addRegressor1, const RandomVariable &addRegressor2) const =0
virtual RandomVariable barrierProbability(const std::string &index, const Date &obsdate1, const Date &obsdate2, const RandomVariable &barrier, const bool above) const =0
const std::map< std::string, boost::any > & additionalResults() const
virtual RandomVariable fwdCompAvg(const bool isAvg, const std::string &index, const Date &obsdate, const Date &start, const Date &end, const Real spread, const Real gearing, const Integer lookback, const Natural rateCutoff, const Natural fixingDays, const bool includeSpread, const Real cap, const Real floor, const bool nakedOption, const bool localCapFloor) const =0
SafeStack< ValueType > value
SafeStack< Filter > filter
Serializable Credit Default Swap.
bool externalDeviceCompatibilityMode
QuantExt::SequenceType sequenceType
QuantLib::SobolBrownianGenerator::Ordering sobolOrdering
QuantExt::SequenceType trainingSequenceType
QuantLib::SobolRsg::DirectionIntegers sobolDirectionIntegers
QuantLib::Real regressionVarianceCutoff
QuantLib::LsmBasisSystem::PolynomialType polynomType
value type and operations