Skip to content

Commit

Permalink
Merge pull request #22 from rkapl123/fca_fba_enhancements
Browse files Browse the repository at this point in the history
Fca fba SP enhancements
  • Loading branch information
QuaternionRisk committed Jan 17, 2019
2 parents 8071c30 + 8136d36 commit 4ac5dc7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
9 changes: 0 additions & 9 deletions OREAnalytics/orea/aggregation/postprocess.cpp
Expand Up @@ -748,8 +748,6 @@ void PostProcess::updateStandAloneXVA() {
nettingSetFBA_[nettingSetId] = 0.0;
nettingSetFCA_[nettingSetId] = 0.0;
nettingSetMVA_[nettingSetId] = 0.0;
nettingSetKVACCR_[nettingSetId] = 0.0;

for (Size j = 0; j < dates; ++j) {
Date d0 = j == 0 ? today : cube_->dates()[j - 1];
Date d1 = cube_->dates()[j];
Expand Down Expand Up @@ -785,7 +783,6 @@ void PostProcess::updateStandAloneXVA() {
Real kvaCCRIncrement = kvaRC * kvaCapitalDiscount * ActualActual().yearFraction(d0, d1);
nettingSetKVACCR_[nettingSetId] += kvaCCRIncrement;


// FIXME: Subtract the spread received on posted IM in MVA calculation
if (applyMVA) {
Real mvaIncrement = cvaS0 * dvaS0 * borrowingSpreadDcf * edim[j];
Expand Down Expand Up @@ -1205,12 +1202,6 @@ Real PostProcess::nettingSetFCA(const string& nettingSetId) {
}


Real PostProcess::nettingSetKVACCR(const string& nettingSetId) {
QL_REQUIRE(nettingSetKVACCR_.find(nettingSetId) != nettingSetKVACCR_.end(),
"NettingSetId " << nettingSetId << " not found in nettingSet KVACCR map");
return nettingSetKVACCR_[nettingSetId];
}

Real PostProcess::allocatedTradeCVA(const string& allocatedTradeId) {
QL_REQUIRE(allocatedTradeCVA_.find(allocatedTradeId) != allocatedTradeCVA_.end(),
"AllocatedTradeId " << allocatedTradeId << " not found in allocatedTrade CVA map");
Expand Down
11 changes: 10 additions & 1 deletion OREAnalytics/orea/aggregation/postprocess.hpp
Expand Up @@ -221,6 +221,14 @@ class PostProcess {
Real nettingSetFBA(const string& nettingSetId);
//! Return netting set FCA
Real nettingSetFCA(const string& nettingSetId);
//! Return netting set FBA excluding own survival probability
Real nettingSetFBA_exOwnSP(const string& nettingSetId);
//! Return netting set FCA excluding own survival probability
Real nettingSetFCA_exOwnSP(const string& nettingSetId);
//! Return netting set FBA excluding both survival probabilities
Real nettingSetFBA_exAllSP(const string& nettingSetId);
//! Return netting set FCA excluding both survival probabilities
Real nettingSetFCA_exAllSP(const string& nettingSetId);
//! Return netting set KVA
Real nettingSetKVACCR(const string& nettingSetId);

Expand Down Expand Up @@ -284,8 +292,9 @@ class PostProcess {
map<string, Real> allocatedTradeCVA_, allocatedTradeDVA_;
map<string, Real> nettingSetCVA_, nettingSetDVA_, nettingSetMVA_;
map<string, Real> nettingSetCOLVA_, nettingSetCollateralFloor_;
map<string, Real> nettingSetFCA_, nettingSetFBA_, nettingSetFCA_exOwnSP_, nettingSetFBA_exOwnSP_, nettingSetFCA_exAllSP_, nettingSetFBA_exAllSP_;
map<string, Real> nettingSetFCA_, nettingSetFBA_;
map<string, Real> effMatNumer_, effMatDenom_, nettingSetKVACCR_;
map<string, Real> effMatNumer_, effMatDenom_, nettingSetKVACCR_;

boost::shared_ptr<NPVCube> nettedCube_;
boost::shared_ptr<NPVCube> dimCube_;
Expand Down
1 change: 1 addition & 0 deletions OREAnalytics/orea/app/oreapp.cpp
Expand Up @@ -871,6 +871,7 @@ void OREApp::runPostProcessor() {
portfolio_, netting, market_, marketConfiguration, cube_, scenarioData_, analytics, baseCurrency,
allocationMethod, marginalAllocationLimit, quantile, calculationType, dvaName, fvaBorrowingCurve,
fvaLendingCurve, dimQuantile, dimHorizonCalendarDays, dimRegressionOrder, dimRegressors,
dimLocalRegressionEvaluations, dimLocalRegressionBandwidth, dimScaling, fullInitialCollateralisation);
dimLocalRegressionEvaluations, dimLocalRegressionBandwidth, dimScaling, fullInitialCollateralisation,
kvaCapitalDiscountRate, kvaAlpha, kvaRegAdjustment, kvaCapitalHurdle);

Expand Down

0 comments on commit 4ac5dc7

Please sign in to comment.