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

XVA Calculator base class. More...

#include <orea/aggregation/nettedexposurecalculator.hpp>

Public Types

enum  ExposureIndex { EPE , ENE }
 

Public Member Functions

 NettedExposureCalculator (const boost::shared_ptr< Portfolio > &portfolio, const boost::shared_ptr< Market > &market, const boost::shared_ptr< NPVCube > &cube, const string &baseCurrency, const string &configuration, const Real quantile, const CollateralExposureHelper::CalculationType calcType, const bool multiPath, const boost::shared_ptr< NettingSetManager > &nettingSetManager, const map< string, vector< vector< Real >>> &nettingSetDefaultValue, const map< string, vector< vector< Real >>> &nettingSetCloseOutValue, const map< string, vector< vector< Real >>> &nettingSetMporPositiveFlow, const map< string, vector< vector< Real >>> &nettingSetMporNegativeFlow, const boost::shared_ptr< AggregationScenarioData > &scenarioData, const boost::shared_ptr< CubeInterpretation > cubeInterpretation, const bool applyInitialMargin, const boost::shared_ptr< DynamicInitialMarginCalculator > &dimCalculator, const bool fullInitialCollateralisation, const bool marginalAllocation, const Real marginalAllocationLimit, const boost::shared_ptr< NPVCube > &tradeExposureCube, const Size allocatedEpeIndex, const Size allocatedEneIndex, const bool flipViewXVA, const bool withMporStickyDate, const ScenarioGeneratorData::MporCashFlowMode &mporCashFlowMode)
 
const boost::shared_ptr< NPVCube > & exposureCube ()
 
const boost::shared_ptr< NPVCube > & nettedCube ()
 
virtual void build ()
 Compute exposures along all paths and fill result structures.
 
vector< Real > epe (const string &nid)
 
vector< Real > ene (const string &nid)
 
vector< Real > & ee_b (const string &nid)
 
vector< Real > & eee_b (const string &nid)
 
vector< Real > & pfe (const string &nid)
 
vector< Real > & expectedCollateral (const string &nid)
 
vector< Real > & colvaIncrements (const string &nid)
 
vector< Real > & collateralFloorIncrements (const string &nid)
 
Real & epe_b (const string &nid)
 
Real & eepe_b (const string &nid)
 
Real & colva (const string &nid)
 
Real & collateralFloor (const string &nid)
 
const string & counterparty (const string nettingSetId)
 
const map< string, string > & counterpartyMap ()
 
map< string, vector< vector< Real > > > nettingSetCloseOutValue ()
 
map< string, vector< vector< Real > > > nettingSetDefaultValue ()
 
map< string, vector< vector< Real > > > nettingSetMporPositiveFlow ()
 
map< string, vector< vector< Real > > > nettingSetMporNegativeFlow ()
 

Public Attributes

const Size EXPOSURE_CUBE_DEPTH = 3
 

Protected Member Functions

vector< Real > getMeanExposure (const string &tid, ExposureIndex index)
 
boost::shared_ptr< vector< boost::shared_ptr< CollateralAccount > > > collateralPaths (const string &nettingSetId, const Real &nettingSetValueToday, const vector< vector< Real >> &nettingSetValue, const Date &nettingSetMaturity)
 

Protected Attributes

boost::shared_ptr< Portfolioportfolio_
 
boost::shared_ptr< Marketmarket_
 
boost::shared_ptr< NPVCubecube_
 
string baseCurrency_
 
string configuration_
 
Real quantile_
 
CollateralExposureHelper::CalculationType calcType_
 
bool multiPath_
 
const boost::shared_ptr< NettingSetManagernettingSetManager_
 
map< string, vector< vector< Real > > > nettingSetDefaultValue_
 
map< string, vector< vector< Real > > > nettingSetCloseOutValue_
 
map< string, vector< vector< Real > > > nettingSetMporPositiveFlow_
 
map< string, vector< vector< Real > > > nettingSetMporNegativeFlow_
 
const boost::shared_ptr< AggregationScenarioDatascenarioData_
 
boost::shared_ptr< CubeInterpretationcubeInterpretation_
 
const bool applyInitialMargin_
 
const boost::shared_ptr< DynamicInitialMarginCalculatordimCalculator_
 
const bool fullInitialCollateralisation_
 
const bool marginalAllocation_
 
const Real marginalAllocationLimit_
 
boost::shared_ptr< NPVCubetradeExposureCube_
 
const Size allocatedEpeIndex_
 
const Size allocatedEneIndex_
 
const bool flipViewXVA_
 
boost::shared_ptr< NPVCubenettedCube_
 
boost::shared_ptr< NPVCubeexposureCube_
 
map< string, string > counterpartyMap_
 
map< string, std::vector< Real > > ee_b_
 
map< string, std::vector< Real > > eee_b_
 
map< string, std::vector< Real > > pfe_
 
map< string, std::vector< Real > > expectedCollateral_
 
map< string, std::vector< Real > > colvaInc_
 
map< string, std::vector< Real > > eoniaFloorInc_
 
map< string, Real > epe_b_
 
map< string, Real > eepe_b_
 
map< string, Real > colva_
 
map< string, Real > collateralFloor_
 
bool withMporStickyDate_
 
ScenarioGeneratorData::MporCashFlowMode mporCashFlowMode_
 

Detailed Description

XVA Calculator base class.

Derived classes implement a constructor with the relevant additional input data and a build function that performs the XVA calculations for all netting sets and along all paths.