31#include <ql/indexes/interestrateindex.hpp>
32#include <ql/methods/finitedifferences/meshers/fdmmesher.hpp>
33#include <ql/methods/finitedifferences/solvers/fdmbackwardsolver.hpp>
34#include <ql/processes/blackscholesprocess.hpp>
35#include <ql/timegrid.hpp>
53 const Size stateGridPoints,
const std::vector<std::string>& currencies,
54 const std::vector<Handle<YieldTermStructure>>& curves,
const std::vector<Handle<Quote>>& fxSpots,
55 const std::vector<std::pair<std::string, QuantLib::ext::shared_ptr<InterestRateIndex>>>& irIndices,
56 const std::vector<std::pair<std::string, QuantLib::ext::shared_ptr<ZeroInflationIndex>>>& infIndices,
57 const std::vector<std::string>& indices,
const std::vector<std::string>& indexCurrencies,
58 const std::set<std::string>&
payCcys_,
const Handle<BlackScholesModelWrapper>& model,
59 const std::map<std::pair<std::string, std::string>, Handle<QuantExt::CorrelationTermStructure>>& correlations,
61 const std::string& calibration,
const std::map<std::string, std::vector<Real>>& calibrationStrikes = {},
62 const Real mesherEpsilon = 1E-4,
const Real mesherScaling = 1.5,
const Real mesherConcentration = 0.1,
63 const Size mesherMaxConcentratingPoints = 9999,
const bool staticMesher =
false);
66 FdBlackScholesBase(
const Size stateGridPoints,
const std::string& currency,
const Handle<YieldTermStructure>& curve,
67 const std::string& index,
const std::string& indexCurrency,
68 const Handle<BlackScholesModelWrapper>& model,
const std::set<Date>& simulationDates,
70 const std::vector<Real>& calibrationStrikes = {},
const Real mesherEpsilon = 1E-4,
71 const Real mesherScaling = 1.5,
const Real mesherConcentration = 0.1,
72 const Size mesherMaxConcentratingPoints = 9999,
const bool staticMesher =
false);
78 const boost::optional<long>& memSlot,
const RandomVariable& addRegressor1,
81 const Date& end,
const Real spread,
const Real gearing,
const Integer lookback,
82 const Natural rateCutoff,
const Natural fixingDays,
const bool includeSpread,
83 const Real cap,
const Real floor,
const bool nakedOption,
84 const bool localCapFloor)
const override;
89 const std::string&
baseCcy()
const override;
91 const std::string& currency)
const override;
101 Real
getFxSpot(
const Size idx)
const override;
109 const std::vector<Handle<YieldTermStructure>>
curves_;
112 const Handle<BlackScholesModelWrapper>
model_;
113 const std::map<std::pair<std::string, std::string>, Handle<QuantExt::CorrelationTermStructure>>
correlations_;
132 mutable QuantLib::ext::shared_ptr<FdmMesher>
mesher_;
133 mutable QuantLib::ext::shared_ptr<FdmLinearOpComposite>
operator_;
134 mutable QuantLib::ext::shared_ptr<FdmBackwardSolver>
solver_;
RandomVariable getInfIndexValue(const Size indexNo, const Date &d, const Date &fwd=Null< Date >()) const override
void performCalculations() const override
Size quantoTargetCcyIndex_
void releaseMemory() override
RandomVariable getFutureBarrierProb(const std::string &index, const Date &obsdate1, const Date &obsdate2, const RandomVariable &barrier, const bool above) const override
QuantLib::ext::shared_ptr< FdmLinearOpComposite > operator_
const std::vector< Date > simulationDates_
const Real mesherConcentration_
RandomVariable getIrIndexValue(const Size indexNo, const Date &d, const Date &fwd=Null< Date >()) const override
RandomVariable npv(const RandomVariable &amount, const Date &obsdate, const Filter &filter, const boost::optional< long > &memSlot, const RandomVariable &addRegressor1, const RandomVariable &addRegressor2) const override
Real getFxSpot(const Size idx) const override
std::vector< std::function< RandomVariable(const std::vector< const RandomVariable * > &)> > basisFns_
Size quantoSourceCcyIndex_
const Real mesherScaling_
const Date & referenceDate() const override
const std::string & baseCcy() const override
RandomVariable getNumeraire(const Date &s) const override
const std::set< std::string > payCcys_
QuantLib::ext::shared_ptr< FdmBackwardSolver > solver_
Real extractT0Result(const RandomVariable &result) const override
Type type() const override
std::set< Date > effectiveSimulationDates_
QuantLib::ext::shared_ptr< FdmMesher > mesher_
RandomVariable underlyingValues_
const std::vector< Handle< Quote > > fxSpots_
RandomVariable pay(const RandomVariable &amount, const Date &obsdate, const Date &paydate, const std::string ¤cy) const override
const Handle< BlackScholesModelWrapper > model_
const std::map< std::string, std::vector< Real > > calibrationStrikes_
RandomVariable getDiscount(const Size idx, const Date &s, const Date &t) const override
const Size mesherMaxConcentratingPoints_
RandomVariable getIndexValue(const Size indexNo, const Date &d, const Date &fwd=Null< Date >()) const override
const Real mesherEpsilon_
const std::map< std::pair< std::string, std::string >, Handle< QuantExt::CorrelationTermStructure > > correlations_
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 override
const std::string calibration_
Real quantoCorrelationMultiplier_
const std::vector< Handle< YieldTermStructure > > curves_
std::vector< Size > positionInTimeGrid_
Matrix getCorrelation() const
bool applyQuantoAdjustment_
SafeStack< Filter > filter
basis implementation for a script engine model
Serializable Credit Default Swap.