Stress Scenario Generator. More...
#include <orea/scenario/stressscenariogenerator.hpp>
Public Member Functions | |
StressScenarioGenerator (const QuantLib::ext::shared_ptr< StressTestScenarioData > &stressData, const QuantLib::ext::shared_ptr< Scenario > &baseScenario, const QuantLib::ext::shared_ptr< ScenarioSimMarketParameters > &simMarketData, const QuantLib::ext::shared_ptr< ScenarioSimMarket > &simMarket, const QuantLib::ext::shared_ptr< ScenarioFactory > &stressScenarioFactory, const QuantLib::ext::shared_ptr< Scenario > &baseScenarioAbsolute=nullptr) | |
Constructor. More... | |
~StressScenarioGenerator () | |
Default destructor. More... | |
Public Member Functions inherited from ShiftScenarioGenerator | |
ShiftScenarioGenerator (const QuantLib::ext::shared_ptr< Scenario > &baseScenario, const QuantLib::ext::shared_ptr< ScenarioSimMarketParameters > &simMarketData, const QuantLib::ext::weak_ptr< ScenarioSimMarket > &simMarket) | |
Constructor. More... | |
~ShiftScenarioGenerator () | |
Default destructor. More... | |
QuantLib::ext::shared_ptr< Scenario > | next (const Date &d) override |
Scenario Generator interface. More... | |
void | reset () override |
Reset the generator so calls to next() return the first scenario. More... | |
Size | samples () |
Inspectors. More... | |
const QuantLib::ext::shared_ptr< Scenario > & | baseScenario () |
Return the base scenario, i.e. cached initial values of all relevant market points. More... | |
const std::vector< QuantLib::ext::shared_ptr< Scenario > > & | scenarios () |
Return vector of sensitivity scenarios, scenario 0 is the base scenario. More... | |
std::vector< ScenarioDescription > | scenarioDescriptions () |
Return vector of scenario descriptions. More... | |
const std::map< RiskFactorKey, std::string > & | keyToFactor () |
const std::map< std::string, RiskFactorKey > & | factorToKey () |
Return revers map of factors to RiskFactorKeys. More... | |
void | applyShift (Size j, Real shiftSize, bool up, ShiftType type, const vector< Time > &shiftTimes, const vector< Real > &values, const vector< Time > ×, vector< Real > &shiftedValues, bool initialise) |
Apply 1d triangular shift to 1d data such as yield curves, public to allow test suite access. More... | |
void | applyShift (Size j, Size k, Real shiftSize, bool up, ShiftType type, const vector< Time > &shiftX, const vector< Time > &shiftY, const vector< Time > &dataX, const vector< Time > &dataY, const vector< vector< Real > > &data, vector< vector< Real > > &shiftedData, bool initialise) |
Apply 2d shift to 2d matrix such as swaption volatilities, public to allow test suite access. More... | |
QuantLib::ext::shared_ptr< Scenario > | baseScenario () const |
return the base scenario More... | |
Public Member Functions inherited from ScenarioGenerator | |
virtual | ~ScenarioGenerator () |
Default destructor. More... | |
virtual QuantLib::ext::shared_ptr< Scenario > | next (const Date &d)=0 |
Return the next scenario for the given date. More... | |
virtual void | reset ()=0 |
Reset the generator so calls to next() return the first scenario. More... | |
Private Attributes | |
QuantLib::ext::shared_ptr< StressTestScenarioData > | stressData_ |
QuantLib::ext::shared_ptr< ScenarioFactory > | stressScenarioFactory_ |
QuantLib::ext::shared_ptr< Scenario > | baseScenarioAbsolute_ |
Additional Inherited Members | |
Protected Attributes inherited from ShiftScenarioGenerator | |
const QuantLib::ext::shared_ptr< Scenario > | baseScenario_ |
const QuantLib::ext::shared_ptr< ScenarioSimMarketParameters > | simMarketData_ |
const QuantLib::ext::weak_ptr< ScenarioSimMarket > | simMarket_ |
std::vector< QuantLib::ext::shared_ptr< Scenario > > | scenarios_ |
Size | counter_ |
std::vector< ScenarioDescription > | scenarioDescriptions_ |
std::map< RiskFactorKey, std::string > | keyToFactor_ |
std::map< std::string, RiskFactorKey > | factorToKey_ |
Stress Scenario Generator.
This class builds a vector of stress scenarios based on instructions in StressScenarioData and ScenarioSimMarketParameters objects passed.
The ScenarioSimMarketParameters object determines the scope and structure of a "simulation" market (currencies, currency pairs, curve tenor points, vol matrix expiries and terms/strikes etc) to which sensitivity scenarios are applied in order to compute their NPV impact.
The StressScenarioData object determines the structure of shift curves (shift tenor points can differ from the simulation market's tenor points), as well as type (relative/absolute) and size of shifts applied.
The generator then produces comprehensive scenarios that can be applied to the simulation market, i.e. covering all quotes in the simulation market, possibly filled with "base" scenario values.
The generator currently covers the IR/FX asset class, with shifts for the following term structure types:
Note:
Definition at line 69 of file stressscenariogenerator.hpp.
StressScenarioGenerator | ( | const QuantLib::ext::shared_ptr< StressTestScenarioData > & | stressData, |
const QuantLib::ext::shared_ptr< Scenario > & | baseScenario, | ||
const QuantLib::ext::shared_ptr< ScenarioSimMarketParameters > & | simMarketData, | ||
const QuantLib::ext::shared_ptr< ScenarioSimMarket > & | simMarket, | ||
const QuantLib::ext::shared_ptr< ScenarioFactory > & | stressScenarioFactory, | ||
const QuantLib::ext::shared_ptr< Scenario > & | baseScenarioAbsolute = nullptr |
||
) |
Constructor.
Definition at line 30 of file stressscenariogenerator.cpp.
|
private |
Definition at line 45 of file stressscenariogenerator.cpp.
|
private |
Definition at line 80 of file stressscenariogenerator.cpp.
|
private |
Definition at line 119 of file stressscenariogenerator.cpp.
|
private |
Definition at line 139 of file stressscenariogenerator.cpp.
|
private |
Definition at line 259 of file stressscenariogenerator.cpp.
|
private |
Definition at line 320 of file stressscenariogenerator.cpp.
|
private |
Definition at line 385 of file stressscenariogenerator.cpp.
|
private |
Definition at line 447 of file stressscenariogenerator.cpp.
|
private |
Definition at line 508 of file stressscenariogenerator.cpp.
|
private |
Definition at line 598 of file stressscenariogenerator.cpp.
|
private |
Definition at line 686 of file stressscenariogenerator.cpp.
|
private |
|
private |
Definition at line 706 of file stressscenariogenerator.cpp.
|
private |
Definition at line 199 of file stressscenariogenerator.cpp.
|
private |
Definition at line 98 of file stressscenariogenerator.hpp.
|
private |
Definition at line 99 of file stressscenariogenerator.hpp.
|
private |
Definition at line 100 of file stressscenariogenerator.hpp.