#include <ored/scripting/models/gaussiancam.hpp>
Public Member Functions | |
GaussianCam (const Handle< CrossAssetModel > &cam, const Size paths, const std::vector< std::string > ¤cies, const std::vector< Handle< YieldTermStructure > > &curves, const std::vector< Handle< Quote > > &fxSpots, const std::vector< std::pair< std::string, QuantLib::ext::shared_ptr< InterestRateIndex > > > &irIndices, const std::vector< std::pair< std::string, QuantLib::ext::shared_ptr< ZeroInflationIndex > > > &infIndices, const std::vector< std::string > &indices, const std::vector< std::string > &indexCurrencies, const std::set< Date > &simulationDates, const McParams &mcParams, const Size timeStepsPerYear=1, const IborFallbackConfig &iborFallbackConfig=IborFallbackConfig::defaultConfig(), const std::vector< Size > &projectedStateProcessIndices={}, const std::vector< std::string > &conditionalExpectationModelStates={}) | |
Type | type () const override |
const Date & | referenceDate () const override |
Size | size () 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 |
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 |
void | releaseMemory () override |
void | resetNPVMem () override |
void | toggleTrainingPaths () const override |
Size | trainingSamples () const override |
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 |
Public Member Functions inherited from ModelImpl | |
ModelImpl (const DayCounter &dayCounter, const Size size, const std::vector< std::string > ¤cies, const std::vector< std::pair< std::string, QuantLib::ext::shared_ptr< InterestRateIndex > > > &irIndices, const std::vector< std::pair< std::string, QuantLib::ext::shared_ptr< ZeroInflationIndex > > > &infIndices, const std::vector< std::string > &indices, const std::vector< std::string > &indexCurrencies, const std::set< Date > &simulationDates, const IborFallbackConfig &iborFallbackConfig) | |
const std::string & | baseCcy () const override |
Real | dt (const Date &d1, const Date &d2) const override |
RandomVariable | pay (const RandomVariable &amount, const Date &obsdate, const Date &paydate, const std::string ¤cy) const override |
RandomVariable | discount (const Date &obsdate, const Date &paydate, const std::string ¤cy) const override |
RandomVariable | eval (const std::string &index, const Date &obsdate, const Date &fwddate, const bool returnMissingMissingAsNull=false, const bool ignoreTodaysFixing=false) const override |
Real | fxSpotT0 (const std::string &forCcy, const std::string &domCcy) const override |
RandomVariable | barrierProbability (const std::string &index, const Date &obsdate1, const Date &obsdate2, const RandomVariable &barrier, const bool above) const override |
Real | extractT0Result (const RandomVariable &value) const override |
Public Member Functions inherited from Model | |
Model (const Size n) | |
virtual | ~Model () |
virtual Type | type () const =0 |
virtual Size | size () const |
virtual Size | trainingSamples () const |
virtual void | toggleTrainingPaths () const |
virtual const Date & | referenceDate () const =0 |
virtual const std::string & | baseCcy () const =0 |
virtual Real | dt (const Date &d1, const Date &d2) const |
Real | timeFromReference (const Date &d) const |
virtual RandomVariable | pay (const RandomVariable &amount, const Date &obsdate, const Date &paydate, const std::string ¤cy) const =0 |
virtual RandomVariable | discount (const Date &obsdate, const Date &paydate, const std::string ¤cy) 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 | eval (const std::string &index, const Date &obsdate, const Date &fwddate, const bool returnMissingFixingAsNull=false, const bool ignoreTodaysFixing=false) const =0 |
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 |
virtual RandomVariable | barrierProbability (const std::string &index, const Date &obsdate1, const Date &obsdate2, const RandomVariable &barrier, const bool above) const =0 |
virtual Real | fxSpotT0 (const std::string &forCcy, const std::string &domCcy) const =0 |
virtual Real | extractT0Result (const RandomVariable &value) const =0 |
virtual void | releaseMemory () |
virtual void | resetNPVMem () |
const std::map< std::string, boost::any > & | additionalResults () const |
Public Member Functions inherited from AmcModel | |
virtual | ~AmcModel () |
virtual void | injectPaths (const std::vector< QuantLib::Real > *pathTimes, const std::vector< std::vector< QuantExt::RandomVariable > > *variates, const std::vector< size_t > *pathIndexes, const std::vector< size_t > *timeIndexes)=0 |
Private Member Functions | |
RandomVariable | getFutureBarrierProb (const std::string &index, const Date &obsdate1, const Date &obsdate2, const RandomVariable &barrier, const bool above) const override |
void | performCalculations () const override |
RandomVariable | getIndexValue (const Size indexNo, const Date &d, const Date &fwd=Null< Date >()) const override |
RandomVariable | getIrIndexValue (const Size indexNo, const Date &d, const Date &fwd=Null< Date >()) const override |
RandomVariable | getInfIndexValue (const Size indexNo, const Date &d, const Date &fwd=Null< Date >()) const override |
RandomVariable | getDiscount (const Size idx, const Date &s, const Date &t) const override |
RandomVariable | getNumeraire (const Date &s) const override |
Real | getFxSpot (const Size idx) const override |
RandomVariable | getDiscount (const Size idx, const Date &s, const Date &t, const Handle< YieldTermStructure > &targetCurve) const |
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 |
Private Attributes | |
const Handle< CrossAssetModel > | cam_ |
const std::vector< Handle< YieldTermStructure > > | curves_ |
const std::vector< Handle< Quote > > | fxSpots_ |
const McParams | mcParams_ |
const Size | timeStepsPerYear_ |
const std::vector< Size > | projectedStateProcessIndices_ |
const Real | regressionVarianceCutoff_ = Null<Real>() |
Date | referenceDate_ |
std::set< Date > | effectiveSimulationDates_ |
TimeGrid | timeGrid_ |
std::vector< Size > | positionInTimeGrid_ |
std::map< Date, std::vector< RandomVariable > > | underlyingPaths_ |
std::map< Date, std::vector< RandomVariable > > | irStates_ |
std::map< Date, std::vector< std::pair< RandomVariable, RandomVariable > > > | infStates_ |
std::map< Date, std::vector< RandomVariable > > | underlyingPathsTraining_ |
std::map< Date, std::vector< RandomVariable > > | irStatesTraining_ |
std::map< Date, std::vector< std::pair< RandomVariable, RandomVariable > > > | infStatesTraining_ |
bool | inTrainingPhase_ = false |
std::vector< Size > | indexPositionInProcess_ |
std::vector< Size > | infIndexPositionInProcess_ |
std::vector< Size > | currencyPositionInProcess_ |
std::vector< Size > | irIndexPositionInCam_ |
std::vector< Size > | infIndexPositionInCam_ |
std::vector< Size > | currencyPositionInCam_ |
std::vector< Size > | eqIndexInCam_ |
std::vector< Size > | comIndexInCam_ |
bool | conditionalExpectationUseIr_ |
bool | conditionalExpectationUseInf_ |
bool | conditionalExpectationUseAsset_ |
std::map< std::tuple< Size, Date, Date >, RandomVariable > | irIndexValueCache_ |
const std::vector< QuantLib::Real > * | injectedPathTimes_ = nullptr |
const std::vector< std::vector< QuantExt::RandomVariable > > * | injectedPaths_ = nullptr |
const std::vector< size_t > * | injectedPathRelevantPathIndexes_ |
const std::vector< size_t > * | injectedPathRelevantTimeIndexes_ |
Size | overwriteModelSize_ = Null<Size>() |
std::map< long, std::tuple< Array, Size, Matrix > > | storedRegressionModel_ |
Additional Inherited Members | |
Public Types inherited from Model | |
enum class | Type { MC , FD } |
virtual RandomVariable | getIndexValue (const Size indexNo, const Date &d, const Date &fwd=Null< Date >()) const =0 |
virtual RandomVariable | getIrIndexValue (const Size indexNo, const Date &d, const Date &fwd=Null< Date >()) const =0 |
virtual RandomVariable | getInfIndexValue (const Size indexNo, const Date &d, const Date &fwd) const =0 |
virtual RandomVariable | getDiscount (const Size idx, const Date &s, const Date &t) const =0 |
virtual RandomVariable | getNumeraire (const Date &s) const =0 |
virtual Real | getFxSpot (const Size idx) const =0 |
virtual RandomVariable | getFutureBarrierProb (const std::string &index, const Date &obsdate1, const Date &obsdate2, const RandomVariable &barrier, const bool above) const =0 |
Protected Member Functions inherited from Model | |
void | performCalculations () const override |
Protected Attributes inherited from ModelImpl | |
const DayCounter | dayCounter_ |
const std::vector< std::string > | currencies_ |
const std::vector< std::string > | indexCurrencies_ |
const std::set< Date > | simulationDates_ |
const IborFallbackConfig | iborFallbackConfig_ |
std::vector< std::pair< IndexInfo, QuantLib::ext::shared_ptr< InterestRateIndex > > > | irIndices_ |
std::vector< std::pair< IndexInfo, QuantLib::ext::shared_ptr< ZeroInflationIndex > > > | infIndices_ |
std::vector< IndexInfo > | indices_ |
Protected Attributes inherited from Model | |
std::map< std::string, boost::any > | additionalResults_ |
Definition at line 38 of file gaussiancam.hpp.
GaussianCam | ( | const Handle< CrossAssetModel > & | cam, |
const Size | paths, | ||
const std::vector< std::string > & | currencies, | ||
const std::vector< Handle< YieldTermStructure > > & | curves, | ||
const std::vector< Handle< Quote > > & | fxSpots, | ||
const std::vector< std::pair< std::string, QuantLib::ext::shared_ptr< InterestRateIndex > > > & | irIndices, | ||
const std::vector< std::pair< std::string, QuantLib::ext::shared_ptr< ZeroInflationIndex > > > & | infIndices, | ||
const std::vector< std::string > & | indices, | ||
const std::vector< std::string > & | indexCurrencies, | ||
const std::set< Date > & | simulationDates, | ||
const McParams & | mcParams, | ||
const Size | timeStepsPerYear = 1 , |
||
const IborFallbackConfig & | iborFallbackConfig = IborFallbackConfig::defaultConfig() , |
||
const std::vector< Size > & | projectedStateProcessIndices = {} , |
||
const std::vector< std::string > & | conditionalExpectationModelStates = {} |
||
) |
Definition at line 47 of file gaussiancam.cpp.
|
overridevirtual |
|
overridevirtual |
Implements Model.
Definition at line 116 of file gaussiancam.cpp.
|
overridevirtual |
Reimplemented from Model.
Definition at line 93 of file gaussiancam.cpp.
|
overridevirtual |
Implements Model.
Definition at line 576 of file gaussiancam.cpp.
|
overridevirtual |
Implements Model.
Definition at line 523 of file gaussiancam.cpp.
|
overridevirtual |
Reimplemented from Model.
Definition at line 104 of file gaussiancam.cpp.
|
overridevirtual |
Reimplemented from Model.
Definition at line 114 of file gaussiancam.cpp.
|
overridevirtual |
Reimplemented from Model.
Definition at line 701 of file gaussiancam.cpp.
|
overridevirtual |
Reimplemented from Model.
Definition at line 709 of file gaussiancam.cpp.
|
overridevirtual |
Implements AmcModel.
Definition at line 711 of file gaussiancam.cpp.
|
overrideprivatevirtual |
Implements ModelImpl.
Definition at line 82 of file gaussiancam.hpp.
|
overrideprivate |
Definition at line 121 of file gaussiancam.cpp.
|
overrideprivatevirtual |
Implements ModelImpl.
Definition at line 427 of file gaussiancam.cpp.
|
overrideprivatevirtual |
Implements ModelImpl.
Definition at line 461 of file gaussiancam.cpp.
|
overrideprivatevirtual |
Implements ModelImpl.
Definition at line 481 of file gaussiancam.cpp.
|
overrideprivatevirtual |
Implements ModelImpl.
Definition at line 558 of file gaussiancam.cpp.
|
overrideprivatevirtual |
Implements ModelImpl.
Definition at line 569 of file gaussiancam.cpp.
|
overrideprivatevirtual |
|
private |
Definition at line 562 of file gaussiancam.cpp.
|
private |
Definition at line 235 of file gaussiancam.cpp.
|
private |
Definition at line 104 of file gaussiancam.hpp.
|
private |
Definition at line 105 of file gaussiancam.hpp.
|
private |
Definition at line 106 of file gaussiancam.hpp.
|
private |
Definition at line 107 of file gaussiancam.hpp.
|
private |
Definition at line 108 of file gaussiancam.hpp.
|
private |
Definition at line 109 of file gaussiancam.hpp.
|
private |
Definition at line 110 of file gaussiancam.hpp.
|
mutableprivate |
Definition at line 113 of file gaussiancam.hpp.
|
mutableprivate |
Definition at line 114 of file gaussiancam.hpp.
|
mutableprivate |
Definition at line 115 of file gaussiancam.hpp.
|
mutableprivate |
Definition at line 116 of file gaussiancam.hpp.
|
mutableprivate |
Definition at line 117 of file gaussiancam.hpp.
|
mutableprivate |
Definition at line 118 of file gaussiancam.hpp.
|
mutableprivate |
Definition at line 120 of file gaussiancam.hpp.
|
mutableprivate |
Definition at line 121 of file gaussiancam.hpp.
|
mutableprivate |
Definition at line 122 of file gaussiancam.hpp.
|
mutableprivate |
Definition at line 124 of file gaussiancam.hpp.
|
mutableprivate |
Definition at line 125 of file gaussiancam.hpp.
|
mutableprivate |
Definition at line 126 of file gaussiancam.hpp.
|
mutableprivate |
Definition at line 127 of file gaussiancam.hpp.
|
mutableprivate |
Definition at line 128 of file gaussiancam.hpp.
|
mutableprivate |
Definition at line 129 of file gaussiancam.hpp.
|
mutableprivate |
Definition at line 130 of file gaussiancam.hpp.
|
mutableprivate |
Definition at line 131 of file gaussiancam.hpp.
|
mutableprivate |
Definition at line 132 of file gaussiancam.hpp.
|
mutableprivate |
Definition at line 133 of file gaussiancam.hpp.
|
mutableprivate |
Definition at line 134 of file gaussiancam.hpp.
|
mutableprivate |
Definition at line 135 of file gaussiancam.hpp.
|
mutableprivate |
Definition at line 136 of file gaussiancam.hpp.
|
mutableprivate |
Definition at line 139 of file gaussiancam.hpp.
|
private |
Definition at line 142 of file gaussiancam.hpp.
|
private |
Definition at line 143 of file gaussiancam.hpp.
|
private |
Definition at line 144 of file gaussiancam.hpp.
|
private |
Definition at line 145 of file gaussiancam.hpp.
|
private |
Definition at line 146 of file gaussiancam.hpp.
|
mutableprivate |
Definition at line 149 of file gaussiancam.hpp.