Skip to content

Commit

Permalink
Features:
Browse files Browse the repository at this point in the history
	- Margin Plus Trade Payment Regression (1)
	- Trade Regression Path Coordinator Shell (2)
	- Variation Margin Trade Payment Generator (3)
	- Vertex Generating Coordinate Market Path (4)
	- Trade Regression Path Coordinator Constructor (5, 6, 7)
	- Sparse Variation Margin Estimate #1 (8, 9)
	- Sparse Variation Margin Estimate #2 (10, 11, 12)
	- Dense Exposure Date Trade Payment (13, 14)
	- Adjusted Variation Margin Vertex Shell (15)
	- Adjusted Variation Margin Vertex Before (16)
	- Adjusted Variation Margin Vertex After (17, 18)
	- Variation Margin Vertex Constructor Annotation (19, 20, 21)
	- Andersen Pykhtin Sokol Path Shell (22)
	- Andersen Pykhtin Sokol Path Trade (23)
	- Path Variation Margin Exposure Trajectory (24)
	- Andersen Pykhtin Sokol Path Constructor (26, 27, 28)
	- Andersen Pykhtin Sokol Path #1 (29, 30)
	- Andersen Pykhtin Sokol Path #2 (31, 32)
	- Andersen Pykhtin Sokol Path #3 (33, 34)
	- Andersen Pykhtin Sokol Path #4 (35, 36)
	- Andersen Pykhtin Sokol Path #5 (37, 38)
	- Andersen Pykhtin Sokol Path #6 (39, 40)


Bug Fixes/Clean-up:

	- Variation Margin Estimate Vertex Switch (25)
	- Andersen Pykhtin Sokol 2017 VM (41)
	- Period Cumulative Trade Payment Fix (43, 44, 45)
	- Variation Margin Vertex Estimate Addition (52)


Samples:

	- Path Trade Flow Adjustment Shell (42)
	- Path Trade Flow Adjustment #1 (46, 47)
	- Path Trade Flow Adjustment #2 (48, 49)
	- Path Trade Flow Adjustment #3 (50, 51)
	- Path Trade Flow Adjustment #4 (53, 54)
	- Path Trade Flow Adjustment #5 (55, 56)
	- Path Trade Flow Adjustment #6 (57, 58)
	- Path Trade Flow Adjustment #7 (59, 60)
  • Loading branch information
lakshmiDRIP committed Jun 16, 2018
1 parent cbb8571 commit 664d31e
Show file tree
Hide file tree
Showing 8 changed files with 1,316 additions and 0 deletions.
45 changes: 45 additions & 0 deletions ReleaseNotes/06_11_2018.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

Features:

- Margin Plus Trade Payment Regression (1)
- Trade Regression Path Coordinator Shell (2)
- Variation Margin Trade Payment Generator (3)
- Vertex Generating Coordinate Market Path (4)
- Trade Regression Path Coordinator Constructor (5, 6, 7)
- Sparse Variation Margin Estimate #1 (8, 9)
- Sparse Variation Margin Estimate #2 (10, 11, 12)
- Dense Exposure Date Trade Payment (13, 14)
- Adjusted Variation Margin Vertex Shell (15)
- Adjusted Variation Margin Vertex Before (16)
- Adjusted Variation Margin Vertex After (17, 18)
- Variation Margin Vertex Constructor Annotation (19, 20, 21)
- Andersen Pykhtin Sokol Path Shell (22)
- Andersen Pykhtin Sokol Path Trade (23)
- Path Variation Margin Exposure Trajectory (24)
- Andersen Pykhtin Sokol Path Constructor (26, 27, 28)
- Andersen Pykhtin Sokol Path #1 (29, 30)
- Andersen Pykhtin Sokol Path #2 (31, 32)
- Andersen Pykhtin Sokol Path #3 (33, 34)
- Andersen Pykhtin Sokol Path #4 (35, 36)
- Andersen Pykhtin Sokol Path #5 (37, 38)
- Andersen Pykhtin Sokol Path #6 (39, 40)


Bug Fixes/Clean-up:

- Variation Margin Estimate Vertex Switch (25)
- Andersen Pykhtin Sokol 2017 VM (41)
- Period Cumulative Trade Payment Fix (43, 44, 45)
- Variation Margin Vertex Estimate Addition (52)


Samples:

- Path Trade Flow Adjustment Shell (42)
- Path Trade Flow Adjustment #1 (46, 47)
- Path Trade Flow Adjustment #2 (48, 49)
- Path Trade Flow Adjustment #3 (50, 51)
- Path Trade Flow Adjustment #4 (53, 54)
- Path Trade Flow Adjustment #5 (55, 56)
- Path Trade Flow Adjustment #6 (57, 58)
- Path Trade Flow Adjustment #7 (59, 60)
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@

package org.drip.exposure.regressiontrade;

/*
* -*- 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.
*/

/**
* AndersenPykhtinSokolPath holds the holds the Sparse Path Adjusted/Unadjusted Exposures along with Dense
* Trade Payments. Adjustments are applied in accordance with the ANdersen, Pykhtin, and Sokol (2017a)
* Regression Scheme. The References are:
*
* - Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Re-thinking Margin Period of Risk,
* https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2902737, eSSRN.
*
* - Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Credit Exposure in the Presence of Initial Margin,
* https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2806156, eSSRN.
*
* - 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.
*
* - Pykhtin, M. (2009): Modeling Counter-party Credit Exposure in the Presence of Margin Agreements,
* http://www.risk-europe.com/protected/michael-pykhtin.pdf.
*
* @author Lakshmi Krishnamurthy
*/

public class AndersenPykhtinSokolPath
{
private org.drip.exposure.mpor.TradePayment[] _denseTradePaymentArray = null;

private java.util.Map<java.lang.Integer, org.drip.exposure.regressiontrade.VariationMarginEstimateVertex>
_variationMarginEstimateTrajectory = new java.util.TreeMap<java.lang.Integer,
org.drip.exposure.regressiontrade.VariationMarginEstimateVertex>();

/**
* AndersenPykhtinSokolPath Constructor
*
* @param denseTradePaymentArray The Dense Trade Payment Array
*
* @throws java.lang.Exception Thrown if the Inputs are Invalid
*/

public AndersenPykhtinSokolPath (
final org.drip.exposure.mpor.TradePayment[] denseTradePaymentArray)
throws java.lang.Exception
{
if (null == (_denseTradePaymentArray = denseTradePaymentArray) ||
0 == _denseTradePaymentArray.length)
{
throw new java.lang.Exception ("AndersenPykhtinSokolPath Constructor => Invalid Inputs");
}
}

/**
* Add the Variation Margin Estimate corresponding to the Vertex
*
* @param vertexDate The Vertex Date
* @param unadjustedVariationMarginEstimate The Unadjusted Variation Margin Estimate
* @param adjustedVariationMarginEstimate The Adjusted Variation Margin Estimate
*
* @return TRUE - The Variation Margin Estimate successfully added to the Vertex
*/

public boolean addVariationMarginEstimateVertex (
final int vertexDate,
final double unadjustedVariationMarginEstimate,
final double adjustedVariationMarginEstimate)
{
try
{
_variationMarginEstimateTrajectory.put (
vertexDate,
new org.drip.exposure.regressiontrade.VariationMarginEstimateVertex (
unadjustedVariationMarginEstimate,
adjustedVariationMarginEstimate
)
);

return true;
}
catch (java.lang.Exception e)
{
e.printStackTrace();
}

return false;
}

/**
* Retrieve the Path-wise Variation Margin Estimate Trajectory
*
* @return The Path-wise Variation Margin Estimate Trajectory
*/

public java.util.Map<java.lang.Integer, org.drip.exposure.regressiontrade.VariationMarginEstimateVertex>
variationMarginEstimateTrajectory()
{
return _variationMarginEstimateTrajectory;
}

/**
* Retrieve the Path-wise Dense Trade Payment Array
*
* @return The Path-wise Dense Trade Payment Array
*/

public org.drip.exposure.mpor.TradePayment[] denseTradePaymentArray()
{
return _denseTradePaymentArray;
}
}
Loading

0 comments on commit 664d31e

Please sign in to comment.