Dynamic Initial Margin Calculator base class. More...
#include <orea/aggregation/dimcalculator.hpp>
Public Member Functions | |
DynamicInitialMarginCalculator (const QuantLib::ext::shared_ptr< InputParameters > &inputs, const QuantLib::ext::shared_ptr< Portfolio > &portfolio, const QuantLib::ext::shared_ptr< NPVCube > &cube, const QuantLib::ext::shared_ptr< CubeInterpretation > &cubeInterpretation, const QuantLib::ext::shared_ptr< AggregationScenarioData > &scenarioData, Real quantile=0.99, Size horizonCalendarDays=14, const std::map< std::string, Real > ¤tIM=std::map< std::string, Real >()) | |
virtual | ~DynamicInitialMarginCalculator () |
virtual map< string, Real > | unscaledCurrentDIM ()=0 |
Model implied t0 DIM by netting set, does not need a call to build() before. More... | |
const map< string, Real > & | currentIM () const |
t0 IM by netting set, as provided as an arguments More... | |
virtual void | build ()=0 |
Compute dynamic initial margin along all paths and fill result structures. More... | |
virtual void | exportDimEvolution (ore::data::Report &dimEvolutionReport) const |
DIM evolution report. More... | |
const QuantLib::ext::shared_ptr< NPVCube > & | dimCube () |
DIM by nettingSet, date, sample returned as a regular NPV cube. More... | |
const vector< vector< Real > > & | dynamicIM (const string &nettingSet) |
DIM matrix by date and sample index for the specified netting set. More... | |
const vector< vector< Real > > & | cashFlow (const string &nettingSet) |
Cash flow matrix by date and sample index for the specified netting set. More... | |
const vector< Real > & | expectedIM (const string &nettingSet) |
Expected DIM vector by date for the specified netting set. More... | |
const std::map< std::string, Real > & | getInitialMarginScaling () |
Get the implied netting set specific scaling factors. More... | |
Protected Attributes | |
QuantLib::ext::shared_ptr< InputParameters > | inputs_ |
QuantLib::ext::shared_ptr< Portfolio > | portfolio_ |
QuantLib::ext::shared_ptr< NPVCube > | cube_ |
QuantLib::ext::shared_ptr< NPVCube > | dimCube_ |
QuantLib::ext::shared_ptr< CubeInterpretation > | cubeInterpretation_ |
QuantLib::ext::shared_ptr< AggregationScenarioData > | scenarioData_ |
Real | quantile_ |
Size | horizonCalendarDays_ |
map< string, Real > | currentIM_ |
bool | cubeIsRegular_ |
Size | datesLoopSize_ |
std::set< string > | nettingSetIds_ |
map< string, Real > | nettingSetScaling_ |
map< string, vector< vector< Real > > > | nettingSetNPV_ |
map< string, vector< vector< Real > > > | nettingSetCloseOutNPV_ |
map< string, vector< vector< Real > > > | nettingSetFLOW_ |
map< string, vector< vector< Real > > > | nettingSetDeltaNPV_ |
map< string, vector< vector< Real > > > | nettingSetDIM_ |
map< string, vector< Real > > | nettingSetExpectedDIM_ |
Dynamic Initial Margin Calculator base class.
Derived classes implement a constructor with the relevant additional input data and a build function that performs the DIM calculations for all netting sets and along all paths.
Definition at line 53 of file dimcalculator.hpp.
DynamicInitialMarginCalculator | ( | const QuantLib::ext::shared_ptr< InputParameters > & | inputs, |
const QuantLib::ext::shared_ptr< Portfolio > & | portfolio, | ||
const QuantLib::ext::shared_ptr< NPVCube > & | cube, | ||
const QuantLib::ext::shared_ptr< CubeInterpretation > & | cubeInterpretation, | ||
const QuantLib::ext::shared_ptr< AggregationScenarioData > & | scenarioData, | ||
Real | quantile = 0.99 , |
||
Size | horizonCalendarDays = 14 , |
||
const std::map< std::string, Real > & | currentIM = std::map<std::string, Real>() |
||
) |
inputs | Global input parameters |
portfolio | Driving portfolio consistent with the cube below |
cube | NPV cube resulting from the Monte Carlo simulation loop |
cubeInterpretation | Interpretation of the cube, regular NPV, MPoR grid etc |
scenarioData | Additional output of the MC simulation loop with numeraires, index fixings, FX spots etc |
quantile | VaR quantile, e.g. 0.99 for 99% |
horizonCalendarDays | VaR holding period in calendar days |
currentIM | Actual t0 IM by netting set used to scale the DIM evolution, no scaling if the argument is omitted |
Definition at line 48 of file dimcalculator.cpp.
|
virtual |
Definition at line 73 of file dimcalculator.hpp.
|
pure virtual |
Model implied t0 DIM by netting set, does not need a call to build() before.
Implemented in FlatDynamicInitialMarginCalculator, and RegressionDynamicInitialMarginCalculator.
const map< string, Real > & currentIM | ( | ) | const |
t0 IM by netting set, as provided as an arguments
Definition at line 79 of file dimcalculator.hpp.
|
pure virtual |
Compute dynamic initial margin along all paths and fill result structures.
Implemented in FlatDynamicInitialMarginCalculator, and RegressionDynamicInitialMarginCalculator.
|
virtual |
DIM evolution report.
Reimplemented in FlatDynamicInitialMarginCalculator, and RegressionDynamicInitialMarginCalculator.
Definition at line 129 of file dimcalculator.cpp.
const QuantLib::ext::shared_ptr< NPVCube > & dimCube | ( | ) |
DIM by nettingSet, date, sample returned as a regular NPV cube.
Definition at line 88 of file dimcalculator.hpp.
const vector< vector< Real > > & dynamicIM | ( | const string & | nettingSet | ) |
DIM matrix by date and sample index for the specified netting set.
Definition at line 108 of file dimcalculator.cpp.
const vector< vector< Real > > & cashFlow | ( | const string & | nettingSet | ) |
Cash flow matrix by date and sample index for the specified netting set.
Definition at line 122 of file dimcalculator.cpp.
const vector< Real > & expectedIM | ( | const string & | nettingSet | ) |
Expected DIM vector by date for the specified netting set.
Definition at line 115 of file dimcalculator.cpp.
const std::map< std::string, Real > & getInitialMarginScaling | ( | ) |
Get the implied netting set specific scaling factors.
Definition at line 100 of file dimcalculator.hpp.
|
protected |
Definition at line 103 of file dimcalculator.hpp.
|
protected |
Definition at line 104 of file dimcalculator.hpp.
|
protected |
Definition at line 105 of file dimcalculator.hpp.
|
protected |
Definition at line 105 of file dimcalculator.hpp.
|
protected |
Definition at line 106 of file dimcalculator.hpp.
|
protected |
Definition at line 107 of file dimcalculator.hpp.
|
protected |
Definition at line 108 of file dimcalculator.hpp.
|
protected |
Definition at line 109 of file dimcalculator.hpp.
|
protected |
Definition at line 110 of file dimcalculator.hpp.
|
protected |
Definition at line 112 of file dimcalculator.hpp.
|
protected |
Definition at line 113 of file dimcalculator.hpp.
|
protected |
Definition at line 114 of file dimcalculator.hpp.
|
protected |
Definition at line 115 of file dimcalculator.hpp.
|
protected |
Definition at line 118 of file dimcalculator.hpp.
|
protected |
Definition at line 119 of file dimcalculator.hpp.
|
protected |
Definition at line 120 of file dimcalculator.hpp.
|
protected |
Definition at line 121 of file dimcalculator.hpp.
|
protected |
Definition at line 122 of file dimcalculator.hpp.
|
protected |
Definition at line 125 of file dimcalculator.hpp.