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

XVA Calculator base class. More...

#include <orea/aggregation/exposurecalculator.hpp>

Public Types

enum  ExposureIndex { EPE = 0 , ENE , allocatedEPE , allocatedENE }
 

Public Member Functions

 ExposureCalculator (const boost::shared_ptr< Portfolio > &portfolio, const boost::shared_ptr< NPVCube > &cube, const boost::shared_ptr< CubeInterpretation > cubeInterpretation, const boost::shared_ptr< Market > &market, const bool exerciseNextBreak, const string &baseCurrency, const string &configuration, const Real quantile, const CollateralExposureHelper::CalculationType calcType, const bool multiPath, const bool flipViewXVA)
 
virtual void build ()
 Compute exposures along all paths and fill result structures.
 
boost::shared_ptr< Portfolioportfolio ()
 
boost::shared_ptr< NPVCubenpvCube ()
 
boost::shared_ptr< CubeInterpretationcubeInterpretation ()
 
boost::shared_ptr< Marketmarket ()
 
bool exerciseNextBreak ()
 
string baseCurrency ()
 
string configuration ()
 
Real quantile ()
 
CollateralExposureHelper::CalculationType calcType ()
 
bool isRegularCubeStorage ()
 
bool multiPath ()
 
vector< Date > dates ()
 
Date today ()
 
DayCounter dc ()
 
vector< string > nettingSetIds ()
 
map< string, Real > nettingSetValueToday ()
 
map< string, Date > nettingSetMaturity ()
 
vector< Real > times ()
 
const boost::shared_ptr< NPVCube > & exposureCube ()
 
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 ()
 
vector< Real > epe (const string &tid)
 
vector< Real > ene (const string &tid)
 
vector< Real > allocatedEpe (const string &tid)
 
vector< Real > allocatedEne (const string &tid)
 
vector< Real > & ee_b (const string &tid)
 
vector< Real > & eee_b (const string &tid)
 
vector< Real > & pfe (const string &tid)
 
Real & epe_b (const string &tid)
 
Real & eepe_b (const string &tid)
 

Public Attributes

const Size EXPOSURE_CUBE_DEPTH = 4
 

Protected Member Functions

vector< Real > getMeanExposure (const string &tid, ExposureIndex index)
 

Protected Attributes

const boost::shared_ptr< Portfolioportfolio_
 
const boost::shared_ptr< NPVCubecube_
 
const boost::shared_ptr< CubeInterpretationcubeInterpretation_
 
const boost::shared_ptr< Marketmarket_
 
const bool exerciseNextBreak_
 
const string baseCurrency_
 
const string configuration_
 
const Real quantile_
 
const CollateralExposureHelper::CalculationType calcType_
 
const bool multiPath_
 
bool isRegularCubeStorage_
 
vector< Date > dates_
 
const Date today_
 
const DayCounter dc_
 
vector< string > nettingSetIds_
 
map< string, Real > nettingSetValueToday_
 
map< string, Date > nettingSetMaturity_
 
vector< Real > times_
 
boost::shared_ptr< NPVCubeexposureCube_
 
map< string, vector< vector< Real > > > nettingSetDefaultValue_
 
map< string, vector< vector< Real > > > nettingSetCloseOutValue_
 
map< string, vector< vector< Real > > > nettingSetMporPositiveFlow_
 
map< string, vector< vector< Real > > > nettingSetMporNegativeFlow_
 
map< string, std::vector< Real > > ee_b_
 
map< string, std::vector< Real > > eee_b_
 
map< string, std::vector< Real > > pfe_
 
map< string, Real > epe_b_
 
map< string, Real > eepe_b_
 
bool flipViewXVA_
 

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.

Constructor & Destructor Documentation

◆ ExposureCalculator()

ExposureCalculator ( const boost::shared_ptr< Portfolio > &  portfolio,
const boost::shared_ptr< NPVCube > &  cube,
const boost::shared_ptr< CubeInterpretation cubeInterpretation,
const boost::shared_ptr< Market > &  market,
const bool  exerciseNextBreak,
const string &  baseCurrency,
const string &  configuration,
const Real  quantile,
const CollateralExposureHelper::CalculationType  calcType,
const bool  multiPath,
const bool  flipViewXVA 
)
Parameters
portfolioDriving portfolio consistent with the cube below
cubeNPV cube resulting from the Monte Carlo simulation loop
cubeInterpretationInterpreter for cube storage (where to find which data items)
marketMarket data object to access e.g. discounting and funding curves
exerciseNextBreakFlag to indicate exposure termination at the next break date
baseCurrencyExpression currency for all results
configurationMarket configuration to use
quantileQuantile for Potential Future Exposure output
calcTypeCollateral calculation type to be used, see class CollateralExposureHelper
multiPathFlag to indicate exposure evaluation with dynamic credit
flipViewXVAFlag to indicate flipped xva calculation