XVA Calculator base class. More...
#include <orea/aggregation/xvacalculator.hpp>
Public Member Functions | |
ValueAdjustmentCalculator (const QuantLib::ext::shared_ptr< Portfolio > portfolio, const QuantLib::ext::shared_ptr< Market > market, const string &configuration, const string &baseCurrency, const string &dvaName, const string &fvaBorrowingCurve, const string &fvaLendingCurve, const bool applyDynamicInitialMargin, const QuantLib::ext::shared_ptr< DynamicInitialMarginCalculator > dimCalculator, const QuantLib::ext::shared_ptr< NPVCube > tradeExposureCube, const QuantLib::ext::shared_ptr< NPVCube > nettingSetExposureCube, const Size tradeEpeIndex=0, const Size tradeEneIndex=1, const Size nettingSetEpeIndex=1, const Size nettingSetEneIndex=2, const bool flipViewXVA=false, const string &flipViewBorrowingCurvePostfix="_BORROW", const string &flipViewLendingCurvePostfix="_LEND") | |
virtual | ~ValueAdjustmentCalculator () |
virtual void | build () |
Compute cva along all paths and fill result structures. More... | |
virtual const vector< Date > & | dates () |
virtual const Date | asof () |
virtual const Real | calculateCvaIncrement (const string &tid, const string &cid, const Date &d0, const Date &d1, const Real &rr)=0 |
virtual const Real | calculateDvaIncrement (const string &tid, const Date &d0, const Date &d1, const Real &rr)=0 |
virtual const Real | calculateNettingSetCvaIncrement (const string &nid, const string &cid, const Date &d0, const Date &d1, const Real &rr)=0 |
virtual const Real | calculateNettingSetDvaIncrement (const string &nid, const Date &d0, const Date &d1, const Real &rr)=0 |
virtual const Real | calculateFbaIncrement (const string &tid, const string &cid, const string &dvaName, const Date &d0, const Date &d1, const Real &dcf)=0 |
virtual const Real | calculateFcaIncrement (const string &tid, const string &cid, const string &dvaName, const Date &d0, const Date &d1, const Real &dcf)=0 |
virtual const Real | calculateNettingSetFbaIncrement (const string &nid, const string &cid, const string &dvaName, const Date &d0, const Date &d1, const Real &dcf)=0 |
virtual const Real | calculateNettingSetFcaIncrement (const string &nid, const string &cid, const string &dvaName, const Date &d0, const Date &d1, const Real &dcf)=0 |
virtual const Real | calculateNettingSetMvaIncrement (const string &nid, const string &cid, const Date &d0, const Date &d1, const Real &dcf)=0 |
const map< string, Real > & | tradeCva () |
CVA map for all the trades. More... | |
const map< string, Real > & | tradeDva () |
DVA map for all the trades. More... | |
const map< string, Real > & | nettingSetCva () |
CVA map for all the netting sets. More... | |
const map< string, Real > & | nettingSetDva () |
DVA map for all the netting sets. More... | |
const map< string, Real > & | nettingSetSumCva () |
Sum CVA map for all the netting sets. More... | |
const map< string, Real > & | nettingSetSumDva () |
Sum DVA map for all the netting sets. More... | |
const Real & | tradeCva (const string &trade) |
CVA for the specified trade. More... | |
const Real & | tradeDva (const string &trade) |
DVA for the specified trade. More... | |
const Real & | tradeFba (const string &trade) |
FBA for the specified trade. More... | |
const Real & | tradeFba_exOwnSp (const string &trade) |
FBA (excl own survival probability) for the specified trade. More... | |
const Real & | tradeFba_exAllSp (const string &trade) |
FBA (excl all survival probability) for the specified trade. More... | |
const Real & | tradeFca (const string &trade) |
FCA for the specified trade. More... | |
const Real & | tradeFca_exOwnSp (const string &trade) |
FCA (excl own survival probability) for the specified trade. More... | |
const Real & | tradeFca_exAllSp (const string &trade) |
FCA (excl all survival probability) for the specified trade. More... | |
const Real & | tradeMva (const string &trade) |
MVA for the specified trade. More... | |
const Real & | nettingSetSumCva (const string &nettingSet) |
Sum of trades' CVA for the specified netting set. More... | |
const Real & | nettingSetSumDva (const string &nettingSet) |
Sum of trades' DVA for the specified netting set. More... | |
const Real & | nettingSetCva (const string &nettingSet) |
CVA for the specified netting set. More... | |
const Real & | nettingSetDva (const string &nettingSet) |
DVA for the specified netting set. More... | |
const Real & | nettingSetFba (const string &nettingSet) |
FBA for the specified netting set. More... | |
const Real & | nettingSetFba_exOwnSp (const string &nettingSet) |
FBA (excl own survival probability) for the specified netting set. More... | |
const Real & | nettingSetFba_exAllSp (const string &nettingSet) |
FBA (excl all survival probability) for the specified netting set. More... | |
const Real & | nettingSetFca (const string &nettingSet) |
FCA for the specified netting set. More... | |
const Real & | nettingSetFca_exOwnSp (const string &nettingSet) |
FCA (excl own survival probability) for the specified netting set. More... | |
const Real & | nettingSetFca_exAllSp (const string &nettingSet) |
FCA (excl all survival probability) for the specified netting set. More... | |
const Real & | nettingSetMva (const string &nettingSet) |
MVA for the specified netting set. More... | |
Protected Attributes | |
QuantLib::ext::shared_ptr< Portfolio > | portfolio_ |
QuantLib::ext::shared_ptr< Market > | market_ |
string | configuration_ |
string | baseCurrency_ |
string | dvaName_ |
string | fvaBorrowingCurve_ |
string | fvaLendingCurve_ |
bool | applyDynamicInitialMargin_ |
QuantLib::ext::shared_ptr< DynamicInitialMarginCalculator > | dimCalculator_ |
const QuantLib::ext::shared_ptr< NPVCube > | tradeExposureCube_ |
const QuantLib::ext::shared_ptr< NPVCube > | nettingSetExposureCube_ |
Size | tradeEpeIndex_ |
Size | tradeEneIndex_ |
Size | nettingSetEpeIndex_ |
Size | nettingSetEneIndex_ |
bool | flipViewXVA_ |
string | flipViewBorrowingCurvePostfix_ |
string | flipViewLendingCurvePostfix_ |
map< string, string > | nettingSetCpty_ |
map< string, Real > | tradeCva_ |
map< string, Real > | tradeDva_ |
map< string, Real > | tradeFba_ |
map< string, Real > | tradeFba_exOwnSp_ |
map< string, Real > | tradeFba_exAllSp_ |
map< string, Real > | tradeFca_ |
map< string, Real > | tradeFca_exOwnSp_ |
map< string, Real > | tradeFca_exAllSp_ |
map< string, Real > | tradeMva_ |
map< string, Real > | nettingSetSumCva_ |
map< string, Real > | nettingSetSumDva_ |
map< string, Real > | nettingSetCva_ |
map< string, Real > | nettingSetDva_ |
map< string, Real > | nettingSetFba_ |
map< string, Real > | nettingSetFba_exOwnSp_ |
map< string, Real > | nettingSetFba_exAllSp_ |
map< string, Real > | nettingSetFca_ |
map< string, Real > | nettingSetFca_exOwnSp_ |
map< string, Real > | nettingSetFca_exAllSp_ |
map< string, Real > | nettingSetMva_ |
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.
Definition at line 48 of file xvacalculator.hpp.
ValueAdjustmentCalculator | ( | const QuantLib::ext::shared_ptr< Portfolio > | portfolio, |
const QuantLib::ext::shared_ptr< Market > | market, | ||
const string & | configuration, | ||
const string & | baseCurrency, | ||
const string & | dvaName, | ||
const string & | fvaBorrowingCurve, | ||
const string & | fvaLendingCurve, | ||
const bool | applyDynamicInitialMargin, | ||
const QuantLib::ext::shared_ptr< DynamicInitialMarginCalculator > | dimCalculator, | ||
const QuantLib::ext::shared_ptr< NPVCube > | tradeExposureCube, | ||
const QuantLib::ext::shared_ptr< NPVCube > | nettingSetExposureCube, | ||
const Size | tradeEpeIndex = 0 , |
||
const Size | tradeEneIndex = 1 , |
||
const Size | nettingSetEpeIndex = 1 , |
||
const Size | nettingSetEneIndex = 2 , |
||
const bool | flipViewXVA = false , |
||
const string & | flipViewBorrowingCurvePostfix = "_BORROW" , |
||
const string & | flipViewLendingCurvePostfix = "_LEND" |
||
) |
portfolio | Driving portfolio consistent with the cube below |
market | Today's market |
configuration | Market configuration to be used |
baseCurrency | Base currency amounts will be converted to |
dvaName | Own party name for DVA calculations |
fvaBorrowingCurve | FVA borrowing curve |
fvaLendingCurve | FVA lending curve |
applyDynamicInitialMargin | Deactivate initial margin calculation even if active at netting set level |
dimCalculator | Dynamic Initial Margin calculator |
tradeExposureCube | Storage ofdefault NPVs, close-out NPVs, cash flows at trade level |
nettingSetExposureCube | Storage of sensitivity vectors at netting set level |
tradeEpeIndex | Index of the trade EPE storage in the internal exposure cube |
tradeEneIndex | Index of the trade ENE storage in the internal exposure cube |
nettingSetEpeIndex | Index of the netting set EPE storage in the internal exposure cube |
nettingSetEneIndex | Index of the netting set ENE storage in the internal exposure cube |
flipViewXVA | Flag to indicate flipped xva calculation |
flipViewBorrowingCurvePostfix | Postfix for flipView borrowing curve for fva |
flipViewLendingCurvePostfix | Postfix for flipView lending curve for fva |
Definition at line 36 of file xvacalculator.cpp.
|
virtual |
Definition at line 89 of file xvacalculator.hpp.
|
virtual |
Compute cva along all paths and fill result structures.
Definition at line 273 of file xvacalculator.cpp.
|
virtual |
|
virtual |
|
pure virtual |
Implemented in DynamicCreditXvaCalculator, and StaticCreditXvaCalculator.
|
pure virtual |
Implemented in DynamicCreditXvaCalculator, and StaticCreditXvaCalculator.
|
pure virtual |
Implemented in DynamicCreditXvaCalculator, and StaticCreditXvaCalculator.
|
pure virtual |
Implemented in DynamicCreditXvaCalculator, and StaticCreditXvaCalculator.
|
pure virtual |
Implemented in DynamicCreditXvaCalculator, and StaticCreditXvaCalculator.
|
pure virtual |
Implemented in DynamicCreditXvaCalculator, and StaticCreditXvaCalculator.
|
pure virtual |
Implemented in DynamicCreditXvaCalculator, and StaticCreditXvaCalculator.
|
pure virtual |
Implemented in DynamicCreditXvaCalculator, and StaticCreditXvaCalculator.
|
pure virtual |
Implemented in DynamicCreditXvaCalculator, and StaticCreditXvaCalculator.
const map< string, Real > & tradeCva | ( | ) |
CVA map for all the trades.
Definition at line 109 of file xvacalculator.cpp.
const map< string, Real > & tradeDva | ( | ) |
DVA map for all the trades.
Definition at line 113 of file xvacalculator.cpp.
const map< string, Real > & nettingSetCva | ( | ) |
CVA map for all the netting sets.
Definition at line 117 of file xvacalculator.cpp.
const map< string, Real > & nettingSetDva | ( | ) |
DVA map for all the netting sets.
Definition at line 121 of file xvacalculator.cpp.
const map< string, Real > & nettingSetSumCva | ( | ) |
Sum CVA map for all the netting sets.
Definition at line 125 of file xvacalculator.cpp.
const map< string, Real > & nettingSetSumDva | ( | ) |
Sum DVA map for all the netting sets.
Definition at line 129 of file xvacalculator.cpp.
const Real & tradeCva | ( | const string & | trade | ) |
CVA for the specified trade.
Definition at line 133 of file xvacalculator.cpp.
const Real & tradeDva | ( | const string & | trade | ) |
DVA for the specified trade.
Definition at line 140 of file xvacalculator.cpp.
const Real & tradeFba | ( | const string & | trade | ) |
FBA for the specified trade.
Definition at line 147 of file xvacalculator.cpp.
const Real & tradeFba_exOwnSp | ( | const string & | trade | ) |
FBA (excl own survival probability) for the specified trade.
Definition at line 154 of file xvacalculator.cpp.
const Real & tradeFba_exAllSp | ( | const string & | trade | ) |
FBA (excl all survival probability) for the specified trade.
Definition at line 161 of file xvacalculator.cpp.
const Real & tradeFca | ( | const string & | trade | ) |
FCA for the specified trade.
Definition at line 168 of file xvacalculator.cpp.
const Real & tradeFca_exOwnSp | ( | const string & | trade | ) |
FCA (excl own survival probability) for the specified trade.
Definition at line 175 of file xvacalculator.cpp.
const Real & tradeFca_exAllSp | ( | const string & | trade | ) |
FCA (excl all survival probability) for the specified trade.
Definition at line 182 of file xvacalculator.cpp.
const Real & tradeMva | ( | const string & | trade | ) |
MVA for the specified trade.
Definition at line 189 of file xvacalculator.cpp.
const Real & nettingSetSumCva | ( | const string & | nettingSet | ) |
Sum of trades' CVA for the specified netting set.
Definition at line 196 of file xvacalculator.cpp.
const Real & nettingSetSumDva | ( | const string & | nettingSet | ) |
Sum of trades' DVA for the specified netting set.
Definition at line 203 of file xvacalculator.cpp.
const Real & nettingSetCva | ( | const string & | nettingSet | ) |
CVA for the specified netting set.
Definition at line 210 of file xvacalculator.cpp.
const Real & nettingSetDva | ( | const string & | nettingSet | ) |
DVA for the specified netting set.
Definition at line 217 of file xvacalculator.cpp.
const Real & nettingSetFba | ( | const string & | nettingSet | ) |
FBA for the specified netting set.
Definition at line 224 of file xvacalculator.cpp.
const Real & nettingSetFba_exOwnSp | ( | const string & | nettingSet | ) |
FBA (excl own survival probability) for the specified netting set.
Definition at line 231 of file xvacalculator.cpp.
const Real & nettingSetFba_exAllSp | ( | const string & | nettingSet | ) |
FBA (excl all survival probability) for the specified netting set.
Definition at line 238 of file xvacalculator.cpp.
const Real & nettingSetFca | ( | const string & | nettingSet | ) |
FCA for the specified netting set.
Definition at line 245 of file xvacalculator.cpp.
const Real & nettingSetFca_exOwnSp | ( | const string & | nettingSet | ) |
FCA (excl own survival probability) for the specified netting set.
Definition at line 252 of file xvacalculator.cpp.
const Real & nettingSetFca_exAllSp | ( | const string & | nettingSet | ) |
FCA (excl all survival probability) for the specified netting set.
Definition at line 259 of file xvacalculator.cpp.
const Real & nettingSetMva | ( | const string & | nettingSet | ) |
MVA for the specified netting set.
Definition at line 266 of file xvacalculator.cpp.
|
protected |
Definition at line 196 of file xvacalculator.hpp.
|
protected |
Definition at line 197 of file xvacalculator.hpp.
|
protected |
Definition at line 198 of file xvacalculator.hpp.
|
protected |
Definition at line 199 of file xvacalculator.hpp.
|
protected |
Definition at line 200 of file xvacalculator.hpp.
|
protected |
Definition at line 201 of file xvacalculator.hpp.
|
protected |
Definition at line 202 of file xvacalculator.hpp.
|
protected |
Definition at line 203 of file xvacalculator.hpp.
|
protected |
Definition at line 204 of file xvacalculator.hpp.
|
protected |
Definition at line 205 of file xvacalculator.hpp.
|
protected |
Definition at line 206 of file xvacalculator.hpp.
|
protected |
Definition at line 207 of file xvacalculator.hpp.
|
protected |
Definition at line 208 of file xvacalculator.hpp.
|
protected |
Definition at line 209 of file xvacalculator.hpp.
|
protected |
Definition at line 210 of file xvacalculator.hpp.
|
protected |
Definition at line 211 of file xvacalculator.hpp.
|
protected |
Definition at line 212 of file xvacalculator.hpp.
|
protected |
Definition at line 213 of file xvacalculator.hpp.
|
protected |
Definition at line 215 of file xvacalculator.hpp.
|
protected |
Definition at line 217 of file xvacalculator.hpp.
|
protected |
Definition at line 218 of file xvacalculator.hpp.
|
protected |
Definition at line 219 of file xvacalculator.hpp.
|
protected |
Definition at line 220 of file xvacalculator.hpp.
|
protected |
Definition at line 221 of file xvacalculator.hpp.
|
protected |
Definition at line 222 of file xvacalculator.hpp.
|
protected |
Definition at line 223 of file xvacalculator.hpp.
|
protected |
Definition at line 224 of file xvacalculator.hpp.
|
protected |
Definition at line 225 of file xvacalculator.hpp.
|
protected |
Definition at line 228 of file xvacalculator.hpp.
|
protected |
Definition at line 229 of file xvacalculator.hpp.
|
protected |
Definition at line 230 of file xvacalculator.hpp.
|
protected |
Definition at line 231 of file xvacalculator.hpp.
|
protected |
Definition at line 232 of file xvacalculator.hpp.
|
protected |
Definition at line 233 of file xvacalculator.hpp.
|
protected |
Definition at line 234 of file xvacalculator.hpp.
|
protected |
Definition at line 235 of file xvacalculator.hpp.
|
protected |
Definition at line 236 of file xvacalculator.hpp.
|
protected |
Definition at line 237 of file xvacalculator.hpp.
|
protected |
Definition at line 238 of file xvacalculator.hpp.