Skip to content

Commit

Permalink
Features:
Browse files Browse the repository at this point in the history
	- BK Hedge Error Dual Bond (1)
	- BK Semi Replication Dual Bond (2)
	- Gold Plated Two Way CSA (3)
	- Burgard Kjaer One Way CSA (4)
	- Burgard Kjaer Set Off Scheme (5)
	- XVA Dynamics Path Simulator Scheme (6)
	- Path Simulator Position Replicator Scheme (7, 8)
	- Path Simulator Vertex Generation Scheme (9, 10)
	- Albanese Andersen Vertex Generation Scheme (11, 12)
	- Path Simulator Scheme Hedge Error (14)
	- Path Simulator Scheme Close Out (15)
	- Path Simulator Scheme Constructor Annotation (16, 17, 18)
	- Path Simulator Scheme Albanese Andersen (19, 20)
	- Albanese Andersen Unit Position Value (21)
	- Path Simulator Collateral Group Vertex (23)
	- Burgard Kjaer Hedge Error Dual (24)
	- Burgard Kjaer Semi Replication Dual (25)
	- Burgard Kjaer Two Way CSA (26)
	- Burgard Kjaer One Way CSA (27)
	- Burgard Kjaer Two Way CSA (28)
	- Dynamics Adjustment Digest Scheme (31)
	- Path Simulator Adjustment Scheme #1 (32, 33)
	- Dynamics Broken Date Interpolation Scheme (36, 37, 38)
	- Path Simulator Interpolator Scheme #1 (39, 40)
	- Path Simulator Interpolator Scheme #2 (41, 42)
	- Position Value Collateral Balance Array (43, 44)
	- Path Simulator Interpolator Scheme #3 (45, 46)
	- Path Simulator Interpolator Scheme #4 (47, 48)
	- Path Simulator Interpolator Scheme #5 (49, 50)
	- Path Simulator Interpolator Scheme #6 (51, 52)
	- Path Simulator Three Point Brownian (53)
	- Market Vertex Generator Correlation #1 (55, 56)
	- Market Vertex Generator Correlation #2 (57, 58)


Bug Fixes/Clean-up:

Samples:

	- Basel Fix Float Digest #1 (13)
	- Basel Fix Float Digest #2 (22)
	- Albanese Andersen Basel Proxy #1 (29, 30)
	- Albanese Andersen Basel Proxy #2 (34, 35)
	- Albanese Andersen Basel Proxy #3 (54)
  • Loading branch information
lakshmiDRIP committed Jan 16, 2018
1 parent f7f3229 commit 6657195
Show file tree
Hide file tree
Showing 19 changed files with 706 additions and 125 deletions.
47 changes: 47 additions & 0 deletions ReleaseNotes/01_25_2018.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

Features:

- BK Hedge Error Dual Bond (1)
- BK Semi Replication Dual Bond (2)
- Gold Plated Two Way CSA (3)
- Burgard Kjaer One Way CSA (4)
- Burgard Kjaer Set Off Scheme (5)
- XVA Dynamics Path Simulator Scheme (6)
- Path Simulator Position Replicator Scheme (7, 8)
- Path Simulator Vertex Generation Scheme (9, 10)
- Albanese Andersen Vertex Generation Scheme (11, 12)
- Path Simulator Scheme Hedge Error (14)
- Path Simulator Scheme Close Out (15)
- Path Simulator Scheme Constructor Annotation (16, 17, 18)
- Path Simulator Scheme Albanese Andersen (19, 20)
- Albanese Andersen Unit Position Value (21)
- Path Simulator Collateral Group Vertex (23)
- Burgard Kjaer Hedge Error Dual (24)
- Burgard Kjaer Semi Replication Dual (25)
- Burgard Kjaer Two Way CSA (26)
- Burgard Kjaer One Way CSA (27)
- Burgard Kjaer Two Way CSA (28)
- Dynamics Adjustment Digest Scheme (31)
- Path Simulator Adjustment Scheme #1 (32, 33)
- Dynamics Broken Date Interpolation Scheme (36, 37, 38)
- Path Simulator Interpolator Scheme #1 (39, 40)
- Path Simulator Interpolator Scheme #2 (41, 42)
- Position Value Collateral Balance Array (43, 44)
- Path Simulator Interpolator Scheme #3 (45, 46)
- Path Simulator Interpolator Scheme #4 (47, 48)
- Path Simulator Interpolator Scheme #5 (49, 50)
- Path Simulator Interpolator Scheme #6 (51, 52)
- Path Simulator Three Point Brownian (53)
- Market Vertex Generator Correlation #1 (55, 56)
- Market Vertex Generator Correlation #2 (57, 58)


Bug Fixes/Clean-up:

Samples:

- Basel Fix Float Digest #1 (13)
- Basel Fix Float Digest #2 (22)
- Albanese Andersen Basel Proxy #1 (29, 30)
- Albanese Andersen Basel Proxy #2 (34, 35)
- Albanese Andersen Basel Proxy #3 (54)
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
release.scope=patch
release.version=3.27.0-SNAPSHOT
release.version=3.28.0-SNAPSHOT
org.gradle.jvmargs=-Xmx4000m
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,6 @@ public static final void main (
MarketVertexGenerator mvg = new MarketVertexGenerator (
iSpotDate,
aiVertexDate,
aadblCorrelationMatrix,
tc,
deBankHazardRate,
deBankSeniorRecoveryRate,
Expand Down Expand Up @@ -462,7 +461,10 @@ public static final void main (
)
);

MarketVertex[] aMV = mvg.marketVertex (mvInitial);
MarketVertex[] aMV = mvg.marketVertex (
mvInitial,
aadblCorrelationMatrix
);

double dblDerivativeValue = dblTerminalXVADerivativeValue;
double dblDerivativeXVAValue = dblTerminalXVADerivativeValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ public static final void main (
MarketVertexGenerator mvg = new MarketVertexGenerator (
iSpotDate,
aiVertexDate,
aadblCorrelationMatrix,
tc,
deBankHazardRate,
deBankSeniorRecoveryRate,
Expand Down Expand Up @@ -463,7 +462,10 @@ public static final void main (
)
);

MarketVertex[] aMV = mvg.marketVertex (mvInitial);
MarketVertex[] aMV = mvg.marketVertex (
mvInitial,
aadblCorrelationMatrix
);

double dblDerivativeValue = dblTerminalXVADerivativeValue;
double dblDerivativeXVAValue = dblTerminalXVADerivativeValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,6 @@ public static final void main (
MarketVertexGenerator mvg = new MarketVertexGenerator (
iSpotDate,
aiVertexDate,
aadblCorrelationMatrix,
tc,
deBankHazardRate,
deBankSeniorRecoveryRate,
Expand Down Expand Up @@ -461,7 +460,10 @@ public static final void main (
)
);

MarketVertex[] aMV = mvg.marketVertex (mvInitial);
MarketVertex[] aMV = mvg.marketVertex (
mvInitial,
aadblCorrelationMatrix
);

double dblDerivativeValue = dblTerminalXVADerivativeValue;
double dblDerivativeXVAValue = dblTerminalXVADerivativeValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,6 @@ public static final void main (
MarketVertexGenerator mvg = new MarketVertexGenerator (
iSpotDate,
aiVertexDate,
aadblCorrelationMatrix,
tc,
deBankHazardRate,
deBankSeniorRecoveryRate,
Expand Down Expand Up @@ -461,7 +460,10 @@ public static final void main (
)
);

MarketVertex[] aMV = mvg.marketVertex (mvInitial);
MarketVertex[] aMV = mvg.marketVertex (
mvInitial,
aadblCorrelationMatrix
);

double dblDerivativeValue = dblTerminalXVADerivativeValue;
double dblDerivativeXVAValue = dblTerminalXVADerivativeValue;
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/org/drip/sample/burgard2011/XVAExplain.java
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ public static void main (
MarketVertexGenerator mvg = new MarketVertexGenerator (
iSpotDate,
aiVertexDate,
aadblCorrelationMatrix,
tc,
deBankHazardRate,
deBankSeniorRecoveryRate,
Expand Down Expand Up @@ -463,7 +462,10 @@ public static void main (
)
);

MarketVertex[] aMV = mvg.marketVertex (mvInitial);
MarketVertex[] aMV = mvg.marketVertex (
mvInitial,
aadblCorrelationMatrix
);

double dblDerivativeValue = dblTerminalXVADerivativeValue;
double dblDerivativeXVAValue = dblTerminalXVADerivativeValue;
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/org/drip/sample/burgard2011/XVAGreeks.java
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,6 @@ public static void main (
MarketVertexGenerator mvg = new MarketVertexGenerator (
iSpotDate,
aiVertexDate,
aadblCorrelationMatrix,
tc,
deBankHazardRate,
deBankSeniorRecoveryRate,
Expand Down Expand Up @@ -452,7 +451,10 @@ public static void main (
)
);

MarketVertex[] aMV = mvg.marketVertex (mvInitial);
MarketVertex[] aMV = mvg.marketVertex (
mvInitial,
aadblCorrelationMatrix
);

double dblDerivativeValue = dblTerminalXVADerivativeValue;
double dblDerivativeXVAValue = dblTerminalXVADerivativeValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ public static final void main (
MarketVertexGenerator mvg = new MarketVertexGenerator (
iSpotDate,
aiVertexDate,
aadblCorrelationMatrix,
new TradeablesContainer (
tAsset,
tOvernightIndex,
Expand Down Expand Up @@ -327,7 +326,10 @@ public static final void main (
)
);

MarketVertex[] aMV = mvg.marketVertex (mvInitial);
MarketVertex[] aMV = mvg.marketVertex (
mvInitial,
aadblCorrelationMatrix
);

System.out.println();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,6 @@ public static void main (
MarketVertexGenerator mvg = new MarketVertexGenerator (
iSpotDate,
aiVertexDate,
aadblCorrelationMatrix,
tc,
deBankHazardRate,
deBankSeniorRecoveryRate,
Expand Down Expand Up @@ -462,7 +461,10 @@ public static void main (
)
);

MarketVertex[] aMV = mvg.marketVertex (mvInitial);
MarketVertex[] aMV = mvg.marketVertex (
mvInitial,
aadblCorrelationMatrix
);

double dblDerivativeValue = dblTerminalXVADerivativeValue;
double dblDerivativeXVAValue = dblTerminalXVADerivativeValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ public static final void main (
MarketVertexGenerator mvg = new MarketVertexGenerator (
iSpotDate,
aiVertexDate,
aadblCorrelationMatrix,
tc,
deBankHazardRate,
deBankSeniorRecoveryRate,
Expand Down Expand Up @@ -337,7 +336,10 @@ public static final void main (
)
);

MarketVertex[] aMVBase = mvg.marketVertex (mvInitial);
MarketVertex[] aMVBase = mvg.marketVertex (
mvInitial,
aadblCorrelationMatrix
);

MarketVertex[] aMV = new MarketVertex[aMVBase.length];
double dblDerivativeValue = dblTerminalXVADerivativeValue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package org.drip.sample.xvasimulation;
package org.drip.sample.xvafixfloat;

import org.drip.analytics.date.*;
import org.drip.function.definition.R1ToR1;
Expand Down Expand Up @@ -59,8 +59,9 @@
*/

/**
* BaselFixFloatDigest simulates for various Latent States and Exposures for an Fix Float Swap and computes
* the XVA Metrics using the Basel Proxy-Style Fading Swap Volatility. The References are:
* AlbaneseAndersenBaselProxy simulates for various Latent States and Exposures for an Fix Float Swap and
* computes the XVA Metrics using the Basel Proxy-Style Exposure Generator using Albanese Andersen
* Vertexes. The References are:
*
* - Burgard, C., and M. Kjaer (2014): PDE Representations of Derivatives with Bilateral Counter-party Risk
* and Funding Costs, Journal of Credit Risk, 7 (3) 1-19.
Expand All @@ -79,7 +80,7 @@
* @author Lakshmi Krishnamurthy
*/

public class BaselFixFloatDigest
public class AlbaneseAndersenBaselProxy
{

private static final TradeablesContainer GenerateTradeablesContainer (
Expand Down Expand Up @@ -227,19 +228,6 @@ private static final MarketVertexGenerator ConstructMarketVertexGenerator (
spotDate.julian(),
periodTenor,
periodCount,
new double[][] {
{1.00, 0.00, 0.20, 0.15, 0.05, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00}, // #0 ASSET NUMERAIRE
{0.00, 1.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00}, // #1 OVERNIGHT POLICY INDEX NUMERAIRE
{0.20, 0.00, 1.00, 0.13, 0.25, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00}, // #2 COLLATERAL SCHEME NUMERAIRE
{0.15, 0.00, 0.13, 1.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00}, // #3 BANK HAZARD RATE
{0.05, 0.00, 0.25, 0.00, 1.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00}, // #4 BANK SENIOR FUNDING NUMERAIRE
{0.00, 0.00, 0.00, 0.00, 0.00, 1.00, 0.00, 0.00, 0.00, 0.00, 0.00}, // #5 BANK SENIOR RECOVERY RATE
{0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1.00, 0.00, 0.00, 0.00, 0.00}, // #6 BANK SUBORDINATE FUNDING NUMERAIRE
{0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1.00, 0.00, 0.00, 0.00}, // #7 BANK SUBORDINATE RECOVERY RATE
{0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1.00, 0.00, 0.00}, // #8 COUNTER PARTY HAZARD RATE
{0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1.00, 0.00}, // #9 COUNTER PARTY FUNDING NUMERAIRE
{0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1.00} // #10 COUNTER PARTY RECOVERY RATE
},
GenerateTradeablesContainer (
periodTenor,
periodCount,
Expand Down Expand Up @@ -387,6 +375,7 @@ public static final void main (
),
CounterPartyGroupSpecification.Standard ("CPGROUP")
),
PathSimulatorScheme.AlbaneseAndersenVertex(),
new R1ToR1 (null)
{
@Override public double evaluate (
Expand All @@ -413,7 +402,22 @@ public static final void main (
0.030 / (1 - 0.30) // dblCounterPartyFundingSpread
);

ExposureAdjustmentAggregator eaa = fixFloatPathSimulator.simulate (initialMarketVertex);
ExposureAdjustmentAggregator eaa = fixFloatPathSimulator.simulate (
initialMarketVertex,
new double[][] {
{1.00, 0.00, 0.20, 0.15, 0.05, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00}, // #0 ASSET NUMERAIRE
{0.00, 1.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00}, // #1 OVERNIGHT POLICY INDEX NUMERAIRE
{0.20, 0.00, 1.00, 0.13, 0.25, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00}, // #2 COLLATERAL SCHEME NUMERAIRE
{0.15, 0.00, 0.13, 1.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00}, // #3 BANK HAZARD RATE
{0.05, 0.00, 0.25, 0.00, 1.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00}, // #4 BANK SENIOR FUNDING NUMERAIRE
{0.00, 0.00, 0.00, 0.00, 0.00, 1.00, 0.00, 0.00, 0.00, 0.00, 0.00}, // #5 BANK SENIOR RECOVERY RATE
{0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1.00, 0.00, 0.00, 0.00, 0.00}, // #6 BANK SUBORDINATE FUNDING NUMERAIRE
{0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1.00, 0.00, 0.00, 0.00}, // #7 BANK SUBORDINATE RECOVERY RATE
{0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1.00, 0.00, 0.00}, // #8 COUNTER PARTY HAZARD RATE
{0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1.00, 0.00}, // #9 COUNTER PARTY FUNDING NUMERAIRE
{0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1.00} // #10 COUNTER PARTY RECOVERY RATE
}
);

ExposureAdjustmentDigest ead = eaa.digest();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
* @author Lakshmi Krishnamurthy
*/

package org.drip.sample.xvasimulation;
package org.drip.sample.xvafixfloat;
79 changes: 79 additions & 0 deletions src/main/java/org/drip/xva/dynamics/AdjustmentDigestScheme.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@

package org.drip.xva.dynamics;

/*
* -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*/

/*!
* Copyright (C) 2018 Lakshmi Krishnamurthy
*
* This file is part of DRIP, a free-software/open-source library for buy/side financial/trading model
* libraries targeting analysts and developers
* https://lakshmidrip.github.io/DRIP/
*
* DRIP is composed of four main libraries:
*
* - DRIP Fixed Income - https://lakshmidrip.github.io/DRIP-Fixed-Income/
* - DRIP Asset Allocation - https://lakshmidrip.github.io/DRIP-Asset-Allocation/
* - DRIP Numerical Optimizer - https://lakshmidrip.github.io/DRIP-Numerical-Optimizer/
* - DRIP Statistical Learning - https://lakshmidrip.github.io/DRIP-Statistical-Learning/
*
* - DRIP Fixed Income: Library for Instrument/Trading Conventions, Treasury Futures/Options,
* Funding/Forward/Overnight Curves, Multi-Curve Construction/Valuation, Collateral Valuation and XVA
* Metric Generation, Calibration and Hedge Attributions, Statistical Curve Construction, Bond RV
* Metrics, Stochastic Evolution and Option Pricing, Interest Rate Dynamics and Option Pricing, LMM
* Extensions/Calibrations/Greeks, Algorithmic Differentiation, and Asset Backed Models and Analytics.
*
* - DRIP Asset Allocation: Library for model libraries for MPT framework, Black Litterman Strategy
* Incorporator, Holdings Constraint, and Transaction Costs.
*
* - DRIP Numerical Optimizer: Library for Numerical Optimization and Spline Functionality.
*
* - DRIP Statistical Learning: Library for Statistical Evaluation and Machine Learning.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* AdjustmentDigestScheme contains Settings to the Schemes that generate Aggregated Valuation Adjustment
* Metrics. The References are:
*
* - Burgard, C., and M. Kjaer (2014): PDE Representations of Derivatives with Bilateral Counter-party Risk
* and Funding Costs, Journal of Credit Risk, 7 (3) 1-19.
*
* - Burgard, C., and M. Kjaer (2014): In the Balance, Risk, 24 (11) 72-75.
*
* - Albanese, C., and L. Andersen (2014): Accounting for OTC Derivatives: Funding Adjustments and the
* Re-Hypothecation Option, eSSRN, https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2482955.
*
* - Burgard, C., and M. Kjaer (2017): Derivatives Funding, Netting, and Accounting, eSSRN,
* https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2534011.
*
* - Piterbarg, V. (2010): Funding Beyond Discounting: Collateral Agreements and Derivatives Pricing, Risk
* 21 (2) 97-102.
*
* @author Lakshmi Krishnamurthy
*/

public class AdjustmentDigestScheme
{

/**
* Albanese Andersen Metrics Pointer Scheme
*/

public static final int ALBANESE_ANDERSEN_METRICS_POINTER = 1;

}
Loading

0 comments on commit 6657195

Please sign in to comment.