Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RelativeXvaExposureAllocator Class Reference

#include <orea/aggregation/exposureallocator.hpp>

+ Inheritance diagram for RelativeXvaExposureAllocator:
+ Collaboration diagram for RelativeXvaExposureAllocator:

Public Member Functions

 RelativeXvaExposureAllocator (const QuantLib::ext::shared_ptr< Portfolio > &portfolio, const QuantLib::ext::shared_ptr< NPVCube > &tradeExposureCube, const QuantLib::ext::shared_ptr< NPVCube > &nettedExposureCube, const QuantLib::ext::shared_ptr< NPVCube > &npvCube, const map< string, Real > &tradeCva, const map< string, Real > &tradeDva, const map< string, Real > &nettingSetSumCva, const map< string, Real > &nettingSetSumDva, const Size allocatedTradeEpeIndex=2, const Size allocatedTradeEneIndex=3, const Size tradeEpeIndex=0, const Size tradeEneIndex=1, const Size nettingSetEpeIndex=0, const Size nettingSetEneIndex=1)
 
- Public Member Functions inherited from ExposureAllocator
 ExposureAllocator (const QuantLib::ext::shared_ptr< Portfolio > &portfolio, const QuantLib::ext::shared_ptr< NPVCube > &tradeExposureCube, const QuantLib::ext::shared_ptr< NPVCube > &nettedExposureCube, const Size allocatedTradeEpeIndex=2, const Size allocatedTradeEneIndex=3, const Size tradeEpeIndex=0, const Size tradeEneIndex=1, const Size nettingSetEpeIndex=1, const Size nettingSetEneIndex=2)
 
virtual ~ExposureAllocator ()
 
const QuantLib::ext::shared_ptr< NPVCube > & exposureCube ()
 
virtual void build ()
 Compute exposures along all paths and fill result structures. More...
 

Protected Member Functions

virtual Real calculateAllocatedEpe (const string &tid, const string &nid, const Date &date, const Size sample) override
 
virtual Real calculateAllocatedEne (const string &tid, const string &nid, const Date &date, const Size sample) override
 
virtual Real calculateAllocatedEpe (const string &tid, const string &nid, const Date &date, const Size sample)=0
 
virtual Real calculateAllocatedEne (const string &tid, const string &nid, const Date &date, const Size sample)=0
 

Protected Attributes

map< string, Real > tradeCva_
 
map< string, Real > tradeDva_
 
map< string, Real > nettingSetSumCva_
 
map< string, Real > nettingSetSumDva_
 
map< string, Real > tradeValueToday_
 
- Protected Attributes inherited from ExposureAllocator
QuantLib::ext::shared_ptr< Portfolioportfolio_
 
QuantLib::ext::shared_ptr< NPVCubetradeExposureCube_
 
QuantLib::ext::shared_ptr< NPVCubenettedExposureCube_
 
Size tradeEpeIndex_
 
Size tradeEneIndex_
 
Size allocatedTradeEpeIndex_
 
Size allocatedTradeEneIndex_
 
Size nettingSetEpeIndex_
 
Size nettingSetEneIndex_
 
map< string, Real > nettingSetValueToday_
 
map< string, Real > nettingSetPositiveValueToday_
 
map< string, Real > nettingSetNegativeValueToday_
 

Additional Inherited Members

- Public Types inherited from ExposureAllocator
enum class  AllocationMethod {
  None , Marginal , RelativeFairValueGross , RelativeFairValueNet ,
  RelativeXVA
}
 

Detailed Description

Definition at line 119 of file exposureallocator.hpp.

Constructor & Destructor Documentation

◆ RelativeXvaExposureAllocator()

RelativeXvaExposureAllocator ( const QuantLib::ext::shared_ptr< Portfolio > &  portfolio,
const QuantLib::ext::shared_ptr< NPVCube > &  tradeExposureCube,
const QuantLib::ext::shared_ptr< NPVCube > &  nettedExposureCube,
const QuantLib::ext::shared_ptr< NPVCube > &  npvCube,
const map< string, Real > &  tradeCva,
const map< string, Real > &  tradeDva,
const map< string, Real > &  nettingSetSumCva,
const map< string, Real > &  nettingSetSumDva,
const Size  allocatedTradeEpeIndex = 2,
const Size  allocatedTradeEneIndex = 3,
const Size  tradeEpeIndex = 0,
const Size  tradeEneIndex = 1,
const Size  nettingSetEpeIndex = 0,
const Size  nettingSetEneIndex = 1 
)

Definition at line 154 of file exposureallocator.cpp.

166 : ExposureAllocator(portfolio, tradeExposureCube, nettedExposureCube,
167 allocatedTradeEpeIndex, allocatedTradeEneIndex,
168 tradeEpeIndex, tradeEneIndex,
169 nettingSetEpeIndex, nettingSetEneIndex),
170 tradeCva_(tradeCva), tradeDva_(tradeDva),
171 nettingSetSumCva_(nettingSetSumCva), nettingSetSumDva_(nettingSetSumDva) {}
ExposureAllocator(const QuantLib::ext::shared_ptr< Portfolio > &portfolio, const QuantLib::ext::shared_ptr< NPVCube > &tradeExposureCube, const QuantLib::ext::shared_ptr< NPVCube > &nettedExposureCube, const Size allocatedTradeEpeIndex=2, const Size allocatedTradeEneIndex=3, const Size tradeEpeIndex=0, const Size tradeEneIndex=1, const Size nettingSetEpeIndex=1, const Size nettingSetEneIndex=2)

Member Function Documentation

◆ calculateAllocatedEpe()

Real calculateAllocatedEpe ( const string &  tid,
const string &  nid,
const Date &  date,
const Size  sample 
)
overrideprotectedvirtual

Implements ExposureAllocator.

Definition at line 173 of file exposureallocator.cpp.

174 {
175 Real netEPE = nettedExposureCube_->get(nid, date, sample, nettingSetEpeIndex_);
176 return netEPE * tradeCva_[tid] / nettingSetSumCva_[nid];
177}
QuantLib::ext::shared_ptr< NPVCube > nettedExposureCube_

◆ calculateAllocatedEne()

Real calculateAllocatedEne ( const string &  tid,
const string &  nid,
const Date &  date,
const Size  sample 
)
overrideprotectedvirtual

Implements ExposureAllocator.

Definition at line 178 of file exposureallocator.cpp.

179 {
180 Real netENE = nettedExposureCube_->get(nid, date, sample, nettingSetEneIndex_);
181 return netENE * tradeDva_[tid] / nettingSetSumDva_[nid];
182}

Member Data Documentation

◆ tradeCva_

map<string, Real> tradeCva_
protected

Definition at line 137 of file exposureallocator.hpp.

◆ tradeDva_

map<string, Real> tradeDva_
protected

Definition at line 138 of file exposureallocator.hpp.

◆ nettingSetSumCva_

map<string, Real> nettingSetSumCva_
protected

Definition at line 139 of file exposureallocator.hpp.

◆ nettingSetSumDva_

map<string, Real> nettingSetSumDva_
protected

Definition at line 140 of file exposureallocator.hpp.

◆ tradeValueToday_

map<string, Real> tradeValueToday_
protected

Definition at line 141 of file exposureallocator.hpp.