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

Dynamic Initial Margin Calculator using polynomial regression. More...

#include <orea/aggregation/dimregressioncalculator.hpp>

+ Inheritance diagram for RegressionDynamicInitialMarginCalculator:

Public Member Functions

 RegressionDynamicInitialMarginCalculator (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, Size horizonCalendarDays, Size regressionOrder, vector< string > regressors, Size localRegressionEvaluations=0, Real localRegressionBandWidth=0, const std::map< std::string, Real > &currentIM=std::map< std::string, Real >())
 
map< string, Real > unscaledCurrentDIM () override
 Model implied t0 DIM by netting set, does not need a call to build() before.
 
void build () override
 Compute dynamic initial margin along all paths and fill result structures.
 
void exportDimEvolution (ore::data::Report &dimEvolutionReport) override
 DIM evolution report.
 
void exportDimRegression (const std::string &nettingSet, const std::vector< Size > &timeSteps, const std::vector< boost::shared_ptr< ore::data::Report >> &dimRegReports)
 
const vector< vector< Real > > & localRegressionResults (const string &nettingSet)
 
const vector< Real > & zeroOrderResults (const string &nettingSet)
 
const vector< Real > & simpleResultsUpper (const string &nettingSet)
 
const vector< Real > & simpleResultsLower (const string &nettingSet)
 
- Public Member Functions inherited from 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 >())
 
map< string, Real > currentIM ()
 t0 IM by netting set, as provided as an arguments
 
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.
 

Additional Inherited Members

- Protected Attributes inherited from DynamicInitialMarginCalculator
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 using polynomial regression.

Dynamic IM is estimated using polynomial and local regression methods applied to the NPV moves over simulation time steps across all paths.

Constructor & Destructor Documentation

◆ RegressionDynamicInitialMarginCalculator()

RegressionDynamicInitialMarginCalculator ( 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,
Size  horizonCalendarDays,
Size  regressionOrder,
vector< string >  regressors,
Size  localRegressionEvaluations = 0,
Real  localRegressionBandWidth = 0,
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 expressed as a percentage
horizonCalendarDaysVaR holding period in calendar days
regressionOrderPolynom order of the regression
regressorsRegressors to be used
localRegressionEvaluationsNumber of local regression evaluation windows across all paths, up to number of samples
localRegressionBandWidthLocal regression band width in standard deviations of the regression variable
currentIMActual t0 IM by netting set used to scale the DIM evolution, no scaling if the argument is omitted