Logo
Reference manual - version orea_version
NettedExposureCalculator Class Reference

XVA Calculator base class. More...

#include <orea/aggregation/nettedexposurecalculator.hpp>

Classes

struct  TimeAveragedExposure
 nettingSetId -> { +- 1/T int_0^T max(+- V(t), 0) dt } before and after collateral More...

Public Types

enum  ExposureIndex { EPE , ENE }

Public Member Functions

 NettedExposureCalculator (const QuantLib::ext::shared_ptr< Portfolio > &portfolio, const QuantLib::ext::shared_ptr< Market > &market, const QuantLib::ext::shared_ptr< NPVCube > &cube, const string &baseCurrency, const string &configuration, const Real quantile, const CollateralExposureHelper::CalculationType calcType, const bool multiPath, const QuantLib::ext::shared_ptr< NettingSetManager > &nettingSetManager, const QuantLib::ext::shared_ptr< CollateralBalances > &collateralBalances, 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 QuantLib::ext::shared_ptr< AggregationScenarioData > &scenarioData, const QuantLib::ext::shared_ptr< CubeInterpretation > cubeInterpretation, const bool applyInitialMargin, const QuantLib::ext::shared_ptr< DynamicInitialMarginCalculator > &dimCalculator, const bool fullInitialCollateralisation, const bool marginalAllocation, const Real marginalAllocationLimit, const QuantLib::ext::shared_ptr< NPVCube > &tradeExposureCube, const Size allocatedEpeIndex, const Size allocatedEneIndex, const bool flipViewXVA, const bool withMporStickyDate, const MporCashFlowMode mporCashFlowMode, const bool firstMporCollateralAdjustment, const bool exposureProfilesUseCloseOutValues=false, const bool useDoublePrecisionCubes=false)
const QuantLib::ext::shared_ptr< NPVCube > & exposureCube ()
const QuantLib::ext::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)
vector< Real > & epe_b_timeWeighted (const string &nid)
vector< Real > & eepe_b_timeWeighted (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 stringcounterparty (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 ()
const std::map< std::string, std::vector< TimeAveragedExposure > > & timeAveragedNettedExposure () const

Public Attributes

const Size EXPOSURE_CUBE_DEPTH = 3

Protected Member Functions

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

Protected Attributes

QuantLib::ext::shared_ptr< Portfolio > portfolio_
QuantLib::ext::shared_ptr< Marketmarket_
QuantLib::ext::shared_ptr< NPVCubecube_
string baseCurrency_
string configuration_
Real quantile_
CollateralExposureHelper::CalculationType calcType_
bool multiPath_
const QuantLib::ext::shared_ptr< NettingSetManager > nettingSetManager_
const QuantLib::ext::shared_ptr< CollateralBalances > collateralBalances_
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 QuantLib::ext::shared_ptr< AggregationScenarioDatascenarioData_
QuantLib::ext::shared_ptr< CubeInterpretationcubeInterpretation_
const bool applyInitialMargin_
const QuantLib::ext::shared_ptr< DynamicInitialMarginCalculatordimCalculator_
const bool fullInitialCollateralisation_
const bool marginalAllocation_
const Real marginalAllocationLimit_
QuantLib::ext::shared_ptr< NPVCubetradeExposureCube_
const Size allocatedEpeIndex_
const Size allocatedEneIndex_
const bool flipViewXVA_
QuantLib::ext::shared_ptr< NPVCubenettedCube_
QuantLib::ext::shared_ptr< NPVCubeexposureCube_
map< string, stringcounterpartyMap_
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, std::vector< Real > > epe_bTimeWeighted_
map< string, std::vector< Real > > eepe_bTimeWeighted_
map< string, Real > epe_b_
map< string, Real > eepe_b_
map< string, Real > colva_
map< string, Real > collateralFloor_
std::map< string, std::vector< TimeAveragedExposure > > timeAveragedNettedExposure_
bool withMporStickyDate_
MporCashFlowMode mporCashFlowMode_
bool firstMporCollateralAdjustment_ = false
bool exposureProfilesUseCloseOutValues_ = false

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.