Logo
Reference manual - version orea_version
Public Member Functions | List of all members
StressScenarioGenerator Class Reference

Stress Scenario Generator. More...

#include <orea/scenario/stressscenariogenerator.hpp>

+ Inheritance diagram for StressScenarioGenerator:

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.
 
 ~StressScenarioGenerator ()
 Default destructor.
 
- 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.
 
 ~ShiftScenarioGenerator ()
 Default destructor.
 
QuantLib::ext::shared_ptr< Scenarionext (const Date &d) override
 Scenario Generator interface.
 
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.
 
const std::vector< QuantLib::ext::shared_ptr< Scenario > > & scenarios ()
 Return vector of sensitivity scenarios, scenario 0 is the base scenario.
 
std::vector< ScenarioDescriptionscenarioDescriptions ()
 Return vector of scenario descriptions.
 
const std::map< RiskFactorKey, std::string > & keyToFactor ()
 
const std::map< std::string, RiskFactorKey > & factorToKey ()
 Return revers map of factors to RiskFactorKeys.
 
void applyShift (Size j, Real shiftSize, bool up, ShiftType type, const vector< Time > &shiftTimes, const vector< Real > &values, const vector< Time > &times, 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< ScenariobaseScenario () const
 return the base scenario
 
- Public Member Functions inherited from ScenarioGenerator
virtual ~ScenarioGenerator ()
 Default destructor.
 

Additional Inherited Members

- Protected Attributes inherited from ShiftScenarioGenerator
const QuantLib::ext::shared_ptr< ScenariobaseScenario_
 
const QuantLib::ext::shared_ptr< ScenarioSimMarketParameterssimMarketData_
 
const QuantLib::ext::weak_ptr< ScenarioSimMarketsimMarket_
 
std::vector< QuantLib::ext::shared_ptr< Scenario > > scenarios_
 
Size counter_
 
std::vector< ScenarioDescriptionscenarioDescriptions_
 
std::map< RiskFactorKey, std::string > keyToFactor_
 
std::map< std::string, RiskFactorKeyfactorToKey_
 

Detailed Description

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: