33#include <ql/termstructures/volatility/swaption/swaptionvolstructure.hpp>
48 GaussianCam(
const Handle<CrossAssetModel>& cam,
const Size paths,
const std::vector<std::string>& currencies,
49 const std::vector<Handle<YieldTermStructure>>& curves,
const std::vector<Handle<Quote>>& fxSpots,
50 const std::vector<std::pair<std::string, QuantLib::ext::shared_ptr<InterestRateIndex>>>& irIndices,
51 const std::vector<std::pair<std::string, QuantLib::ext::shared_ptr<ZeroInflationIndex>>>& infIndices,
52 const std::vector<std::string>& indices,
const std::vector<std::string>& indexCurrencies,
53 const std::set<Date>& simulationDates,
const McParams& mcParams,
const Size timeStepsPerYear = 1,
55 const std::vector<Size>& projectedStateProcessIndices = {},
56 const std::vector<std::string>& conditionalExpectationModelStates = {});
61 Size
size()
const override;
63 const boost::optional<long>& memSlot,
const RandomVariable& addRegressor1,
66 const Date& end,
const Real spread,
const Real gearing,
const Integer lookback,
67 const Natural rateCutoff,
const Natural fixingDays,
const bool includeSpread,
68 const Real cap,
const Real floor,
const bool nakedOption,
69 const bool localCapFloor)
const override;
76 void injectPaths(
const std::vector<QuantLib::Real>* pathTimes,
77 const std::vector<std::vector<QuantExt::RandomVariable>>* paths,
78 const std::vector<size_t>* pathIndexes,
const std::vector<size_t>* timeIndexes)
override;
84 QL_FAIL(
"getFutureBarrierProb not implemented by GaussianCam");
93 Real
getFxSpot(
const Size idx)
const override;
97 const Handle<YieldTermStructure>& targetCurve)
const;
99 void populatePathValues(
const Size nSamples, std::map<Date, std::vector<RandomVariable>>& paths,
100 std::map<Date, std::vector<RandomVariable>>& irStates,
101 std::map<Date, std::vector<std::pair<RandomVariable, RandomVariable>>>& infStates,
102 const std::vector<Real>& times,
const bool isTraining)
const;
104 const Handle<CrossAssetModel>
cam_;
105 const std::vector<Handle<YieldTermStructure>>
curves_;
118 mutable std::map<Date, std::vector<RandomVariable>>
irStates_;
119 mutable std::map<Date, std::vector<std::pair<RandomVariable, RandomVariable>>>
123 mutable std::map<Date, std::vector<std::pair<RandomVariable, RandomVariable>>>
143 const std::vector<std::vector<QuantExt::RandomVariable>>*
injectedPaths_ =
nullptr;
additional interface for amc enabled models
RandomVariable getInfIndexValue(const Size indexNo, const Date &d, const Date &fwd=Null< Date >()) const override
void performCalculations() const override
void releaseMemory() override
RandomVariable getFutureBarrierProb(const std::string &index, const Date &obsdate1, const Date &obsdate2, const RandomVariable &barrier, const bool above) const override
std::map< Date, std::vector< std::pair< RandomVariable, RandomVariable > > > infStates_
const std::vector< size_t > * injectedPathRelevantPathIndexes_
Size size() const override
std::vector< Size > infIndexPositionInCam_
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::map< std::tuple< Size, Date, Date >, RandomVariable > irIndexValueCache_
std::vector< Size > infIndexPositionInProcess_
std::vector< Size > indexPositionInProcess_
void populatePathValues(const Size nSamples, std::map< Date, std::vector< RandomVariable > > &paths, std::map< Date, std::vector< RandomVariable > > &irStates, std::map< Date, std::vector< std::pair< RandomVariable, RandomVariable > > > &infStates, const std::vector< Real > ×, const bool isTraining) const
std::vector< Size > eqIndexInCam_
const std::vector< std::vector< QuantExt::RandomVariable > > * injectedPaths_
const std::vector< QuantLib::Real > * injectedPathTimes_
const Date & referenceDate() const override
std::map< long, std::tuple< Array, Size, Matrix > > storedRegressionModel_
std::map< Date, std::vector< RandomVariable > > underlyingPathsTraining_
std::map< Date, std::vector< std::pair< RandomVariable, RandomVariable > > > infStatesTraining_
bool conditionalExpectationUseAsset_
std::vector< Size > currencyPositionInProcess_
std::vector< Size > comIndexInCam_
RandomVariable getNumeraire(const Date &s) const override
std::vector< Size > irIndexPositionInCam_
bool conditionalExpectationUseIr_
std::vector< Size > currencyPositionInCam_
const Handle< CrossAssetModel > cam_
Type type() const override
std::map< Date, std::vector< RandomVariable > > underlyingPaths_
std::set< Date > effectiveSimulationDates_
const Real regressionVarianceCutoff_
std::map< Date, std::vector< RandomVariable > > irStates_
bool conditionalExpectationUseInf_
const std::vector< Handle< Quote > > fxSpots_
std::map< Date, std::vector< RandomVariable > > irStatesTraining_
RandomVariable getDiscount(const Size idx, const Date &s, const Date &t) const override
const std::vector< Size > projectedStateProcessIndices_
RandomVariable getIndexValue(const Size indexNo, const Date &d, const Date &fwd=Null< Date >()) const override
Size trainingSamples() const override
void resetNPVMem() override
const Size timeStepsPerYear_
void toggleTrainingPaths() const override
const std::vector< size_t > * injectedPathRelevantTimeIndexes_
void injectPaths(const std::vector< QuantLib::Real > *pathTimes, const std::vector< std::vector< QuantExt::RandomVariable > > *paths, const std::vector< size_t > *pathIndexes, const std::vector< size_t > *timeIndexes) override
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::vector< Handle< YieldTermStructure > > curves_
std::vector< Size > positionInTimeGrid_
static IborFallbackConfig defaultConfig()
SafeStack< Filter > filter
Build a cross asset model.
basis implementation for a script engine model
Serializable Credit Default Swap.