Logo
Reference manual - version orea_version
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 QuantLib::ext::shared_ptr< Portfolio > &portfolio, const QuantLib::ext::shared_ptr< NPVCube > &cube, const QuantLib::ext::shared_ptr< CubeInterpretation > cubeInterpretation, const QuantLib::ext::shared_ptr< AggregationScenarioData > &aggregationScenarioData, const QuantLib::ext::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, const bool exposureProfilesUseCloseOutValues_=false, bool continueOnError=false, bool useDoublePrecisionCubes=false)
virtual void build ()
 Compute exposures along all paths and fill result structures.
QuantLib::ext::shared_ptr< Portfolio > portfolio ()
QuantLib::ext::shared_ptr< NPVCubenpvCube ()
QuantLib::ext::shared_ptr< CubeInterpretationcubeInterpretation ()
QuantLib::ext::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< stringnettingSetIds ()
map< string, Real > nettingSetValueToday ()
map< string, Date > nettingSetMaturity ()
vector< Real > times ()
const QuantLib::ext::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)
vector< Real > & epe_b_timeWeighted (const string &tid)
vector< Real > & eepe_b_timeWeighted (const string &tid)

Public Attributes

const Size EXPOSURE_CUBE_DEPTH = 4

Protected Member Functions

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

Protected Attributes

QuantLib::ext::shared_ptr< Portfolio > portfolio_
QuantLib::ext::shared_ptr< NPVCubecube_
QuantLib::ext::shared_ptr< CubeInterpretationcubeInterpretation_
QuantLib::ext::shared_ptr< AggregationScenarioDataaggregationScenarioData_
QuantLib::ext::shared_ptr< Marketmarket_
bool exerciseNextBreak_
string baseCurrency_
string configuration_
Real quantile_
CollateralExposureHelper::CalculationType calcType_
bool multiPath_
bool isRegularCubeStorage_
vector< Date > dates_
const Date today_
const DayCounter dc_
vector< stringnettingSetIds_
map< string, Real > nettingSetValueToday_
map< string, Date > nettingSetMaturity_
vector< Real > times_
QuantLib::ext::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_
map< string, std::vector< Real > > epe_bTimeWeighted_
map< string, std::vector< Real > > eepe_bTimeWeighted_
bool flipViewXVA_
bool exposureProfilesUseCloseOutValues_ = false
bool continueOnError_

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 QuantLib::ext::shared_ptr< Portfolio > & portfolio,
const QuantLib::ext::shared_ptr< NPVCube > & cube,
const QuantLib::ext::shared_ptr< CubeInterpretation > cubeInterpretation,
const QuantLib::ext::shared_ptr< AggregationScenarioData > & aggregationScenarioData,
const QuantLib::ext::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,
const bool exposureProfilesUseCloseOutValues_ = false,
bool continueOnError = false,
bool useDoublePrecisionCubes = false )
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)
aggregationScenarioDataAggregation scenario data resulting from Monte Carlo simulation loop
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
continueOnErrorContinue with the calculation if possible when there is an error
useDoublePrecisionCubesuse double precision cube