Logo
Reference manual - version orea_version
Public Member Functions | Protected Attributes | List of all members
DynamicInitialMarginCalculator Class Referenceabstract

Dynamic Initial Margin Calculator base class. More...

#include <orea/aggregation/dimcalculator.hpp>

+ Inheritance diagram for DynamicInitialMarginCalculator:

Public Member Functions

 DynamicInitialMarginCalculator (const boost::shared_ptr< InputParameters > &inputs, const boost::shared_ptr< Portfolio > &portfolio, const boost::shared_ptr< NPVCube > &cube, const boost::shared_ptr< CubeInterpretation > &cubeInterpretation, const boost::shared_ptr< AggregationScenarioData > &scenarioData, Real quantile=0.99, Size horizonCalendarDays=14, const std::map< std::string, Real > &currentIM=std::map< std::string, Real >())
 
virtual map< string, Real > unscaledCurrentDIM ()=0
 Model implied t0 DIM by netting set, does not need a call to build() before.
 
map< string, Real > currentIM ()
 t0 IM by netting set, as provided as an arguments
 
virtual void build ()=0
 Compute dynamic initial margin along all paths and fill result structures.
 
virtual void exportDimEvolution (ore::data::Report &dimEvolutionReport)
 DIM evolution report.
 
const boost::shared_ptr< NPVCube > & dimCube ()
 DIM by nettingSet, date, sample returned as a regular NPV cube.
 
const vector< vector< Real > > & dynamicIM (const string &nettingSet)
 DIM matrix by date and sample index for the specified netting set.
 
const vector< vector< Real > > & cashFlow (const string &nettingSet)
 Cash flow matrix by date and sample index for the specified netting set.
 
const vector< Real > & expectedIM (const string &nettingSet)
 Expected DIM vector by date for the specified netting set.
 
const std::map< std::string, Real > & getInitialMarginScaling ()
 Get the implied netting set specific scaling factors.
 

Protected Attributes

boost::shared_ptr< InputParametersinputs_
 
boost::shared_ptr< Portfolioportfolio_
 
boost::shared_ptr< NPVCubecube_
 
boost::shared_ptr< NPVCubedimCube_
 
boost::shared_ptr< CubeInterpretationcubeInterpretation_
 
boost::shared_ptr< AggregationScenarioDatascenarioData_
 
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_
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DynamicInitialMarginCalculator()

DynamicInitialMarginCalculator ( const boost::shared_ptr< InputParameters > &  inputs,
const boost::shared_ptr< Portfolio > &  portfolio,
const boost::shared_ptr< NPVCube > &  cube,
const boost::shared_ptr< CubeInterpretation > &  cubeInterpretation,
const boost::shared_ptr< AggregationScenarioData > &  scenarioData,
Real  quantile = 0.99,
Size  horizonCalendarDays = 14,
const std::map< std::string, Real > &  currentIM = std::map< std::string, Real >() 
)
Parameters
inputsGlobal input parameters
portfolioDriving portfolio consistent with the cube below
cubeNPV cube resulting from the Monte Carlo simulation loop
cubeInterpretationInterpretation of the cube, regular NPV, MPoR grid etc
scenarioDataAdditional output of the MC simulation loop with numeraires, index fixings, FX spots etc
quantileVaR quantile, e.g. 0.99 for 99%
horizonCalendarDaysVaR holding period in calendar days
currentIMActual t0 IM by netting set used to scale the DIM evolution, no scaling if the argument is omitted