Skip to content

Commit

Permalink
Features:
Browse files Browse the repository at this point in the history
	- Pykhtin (2009) Local Volatility Floor (1)
	- Local Volatility Generation Control Constructor (2, 3)
	- Pykhtin (2009) Empirical Ceiling Factor (4)
	- Local Volatility Smoothing Floor Bias (5)
	- Local Volatility Generation Control Standard (6, 7, 8)
	- Local Volatility Generation Control Incorporation (9)
	- Local Volatility Generation Control #1 (11, 12)
	- Local Volatility Generation Control #2 (13, 14)
	- Local Volatility Generation Control #3 (15, 16)
	- Local Volatility Generation Control #4 (17, 18)
	- Local Volatility Generation Control #5 (19, 20)
	- Vertex Realization Volatility Function Shell (21)
	- Vertex Realization Local Volatility #1 (22, 23)
	- Vertex Realization Local Volatility #2 (24, 25)
	- Vertex Realization Local Volatility #3 (26, 27)
	- Vertex Realization Local Volatility #4 (28, 29)
	- Vertex Realization Local Volatility #5 (34)
	- Vertex Realization Local Volatility #6 (37, 38)
	- Vertex Realization Local Volatility #7 (54, 55)
	- Vertex Realization Local Volatility #8 (56, 57)


Bug Fixes/Clean-up:

Samples:

	- Pykhtin Raw Regression Metrics #1 (10)
	- Pykhtin Raw Regression Metrics #2 (30, 31)
	- Pykhtin Raw Regression Metrics #3 (32, 33)
	- Pykhtin Raw Regression Metrics #4 (35, 36)
	- Pykhtin 2009 Local Volatility Regressor (39)
	- Bullet Conditional Exposure Regression #1 (40, 41)
	- Bullet Conditional Exposure Regression #2 (42, 43)
	- Bullet Conditional Exposure Regression #3 (44, 45)
	- Bullet Conditional Exposure Regression #4 (46, 47)
	- Bullet Conditional Exposure Regression #5 (48, 49)
	- Bullet Conditional Exposure Regression #6 (50, 51)
	- Bullet Conditional Exposure Regression #7 (52, 53)
	- Bullet Conditional Exposure Regression #8 (54, 55)
	- Bullet Conditional Exposure Regression #9 (56, 57)
	- Bullet Conditional Exposure Regression #10 (58, 59)
	- Bullet Conditional Exposure Regression #11 (60, 61)
	- Bullet Conditional Exposure Regression #12 (62, 33)
	- Bullet Conditional Exposure Regression #13 (64, 65)
  • Loading branch information
lakshmiDRIP committed Jun 5, 2018
1 parent ce1fc05 commit 6b737e4
Show file tree
Hide file tree
Showing 8 changed files with 476 additions and 68 deletions.
Binary file added Docs/Internal/XVA/XVAAnalytics_v3.53.pdf
Binary file not shown.
47 changes: 47 additions & 0 deletions ReleaseNotes/06_05_2018.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

Features:

- Pykhtin (2009) Local Volatility Floor (1)
- Local Volatility Generation Control Constructor (2, 3)
- Pykhtin (2009) Empirical Ceiling Factor (4)
- Local Volatility Smoothing Floor Bias (5)
- Local Volatility Generation Control Standard (6, 7, 8)
- Local Volatility Generation Control Incorporation (9)
- Local Volatility Generation Control #1 (11, 12)
- Local Volatility Generation Control #2 (13, 14)
- Local Volatility Generation Control #3 (15, 16)
- Local Volatility Generation Control #4 (17, 18)
- Local Volatility Generation Control #5 (19, 20)
- Vertex Realization Volatility Function Shell (21)
- Vertex Realization Local Volatility #1 (22, 23)
- Vertex Realization Local Volatility #2 (24, 25)
- Vertex Realization Local Volatility #3 (26, 27)
- Vertex Realization Local Volatility #4 (28, 29)
- Vertex Realization Local Volatility #5 (34)
- Vertex Realization Local Volatility #6 (37, 38)
- Vertex Realization Local Volatility #7 (54, 55)
- Vertex Realization Local Volatility #8 (56, 57)


Bug Fixes/Clean-up:

Samples:

- Pykhtin Raw Regression Metrics #1 (10)
- Pykhtin Raw Regression Metrics #2 (30, 31)
- Pykhtin Raw Regression Metrics #3 (32, 33)
- Pykhtin Raw Regression Metrics #4 (35, 36)
- Pykhtin 2009 Local Volatility Regressor (39)
- Bullet Conditional Exposure Regression #1 (40, 41)
- Bullet Conditional Exposure Regression #2 (42, 43)
- Bullet Conditional Exposure Regression #3 (44, 45)
- Bullet Conditional Exposure Regression #4 (46, 47)
- Bullet Conditional Exposure Regression #5 (48, 49)
- Bullet Conditional Exposure Regression #6 (50, 51)
- Bullet Conditional Exposure Regression #7 (52, 53)
- Bullet Conditional Exposure Regression #8 (54, 55)
- Bullet Conditional Exposure Regression #9 (56, 57)
- Bullet Conditional Exposure Regression #10 (58, 59)
- Bullet Conditional Exposure Regression #11 (60, 61)
- Bullet Conditional Exposure Regression #12 (62, 33)
- Bullet Conditional Exposure Regression #13 (64, 65)
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,151 @@

public class LocalVolatilityGenerationControl
{

/**
* The Pyhktin (2009) Empirical Floor
*/

public static final int PYKHTIN_2009_EMPIRICAL_FLOOR = 20;

/**
* The Pyhktin (2009) Empirical Ceiling Factor
*/

public static final double PYKHTIN_2009_EMPIRICAL_CEILING_FACTOR = 0.05;

/**
* The Local Volatility Smooth Floor Bias
*/

public static final double LOCAL_VOLATILITY_SMOOTHING_FLOOR_BIAS = 0.90;

private double[] _uniformCPDArray = null;
private int _localVolatilityIndexShift = -1;
private double[] _impliedBrownianVariateArray = null;
private org.drip.spline.params.SegmentCustomBuilderControl[] _segmentCustomBuilderControlArray = null;

/**
* Construct a Standard Instance of LocalVolatilityGenerationControl
*
* @param ensembleSize Size of the Distribution Ensemble
*
* @return Standard Instance of LocalVolatilityGenerationControl
*/

public static final LocalVolatilityGenerationControl Standard (
final int ensembleSize)
{
if (PYKHTIN_2009_EMPIRICAL_FLOOR > ensembleSize)
{
return null;
}

double[] uniformCPDArray = new double[ensembleSize];
double[] impliedBrownianVariateArray = new double[ensembleSize];
int localVolatilityIndexShift = (int) (LOCAL_VOLATILITY_SMOOTHING_FLOOR_BIAS *
PYKHTIN_2009_EMPIRICAL_FLOOR + (1 - LOCAL_VOLATILITY_SMOOTHING_FLOOR_BIAS) * ensembleSize);

if (PYKHTIN_2009_EMPIRICAL_FLOOR > localVolatilityIndexShift)
{
return null;
}

for (int realizationCoordinate = 0;
realizationCoordinate < ensembleSize;
++realizationCoordinate)
{
try
{
impliedBrownianVariateArray[realizationCoordinate] =
org.drip.measure.gaussian.NormalQuadrature.InverseCDF
(uniformCPDArray[realizationCoordinate] = (((double) realizationCoordinate) + 0.5) /
((double) ensembleSize));
}
catch (java.lang.Exception e)
{
e.printStackTrace();

return null;
}
}

try
{
org.drip.spline.params.SegmentCustomBuilderControl[] segmentCustomBuilderControlArray = new
org.drip.spline.params.SegmentCustomBuilderControl[ensembleSize - 1];
org.drip.spline.params.SegmentCustomBuilderControl segmentCustomBuilderControl = new
org.drip.spline.params.SegmentCustomBuilderControl (
org.drip.spline.stretch.MultiSegmentSequenceBuilder.BASIS_SPLINE_POLYNOMIAL,
new org.drip.spline.basis.PolynomialFunctionSetParams (2),
org.drip.spline.params.SegmentInelasticDesignControl.Create (
0,
2
),
new org.drip.spline.params.ResponseScalingShapeControl (
true,
new org.drip.function.r1tor1.QuadraticRationalShapeControl (0.)
),
null
);

for (int realizationCoordinate = 0;
realizationCoordinate < ensembleSize - 1;
++realizationCoordinate)
{
segmentCustomBuilderControlArray[realizationCoordinate] = segmentCustomBuilderControl;
}

return new LocalVolatilityGenerationControl (
localVolatilityIndexShift,
uniformCPDArray,
impliedBrownianVariateArray,
segmentCustomBuilderControlArray
);
}
catch (java.lang.Exception e)
{
e.printStackTrace();
}

return null;
}

/**
* LocalVolatilityGenerationControl Constructor
*
* @param localVolatilityIndexShift The Local Volatility Index Shift
* @param uniformCPDArray The Uniform Cumulative Probability Density Array
* @param impliedBrownianVariateArray The Implied Brownian Variate Array
* @param segmentCustomBuilderControlArray Array of Segment Builder Control
*
* @throws java.lang.Exception Thrown if the Inputs are Invalid
*/

public LocalVolatilityGenerationControl (
final int localVolatilityIndexShift,
final double[] uniformCPDArray,
final double[] impliedBrownianVariateArray,
final org.drip.spline.params.SegmentCustomBuilderControl[] segmentCustomBuilderControlArray)
throws java.lang.Exception
{
if (0 >= (_localVolatilityIndexShift = localVolatilityIndexShift) ||
null == (_uniformCPDArray = uniformCPDArray) ||
null == (_impliedBrownianVariateArray = impliedBrownianVariateArray) ||
null == (_segmentCustomBuilderControlArray = segmentCustomBuilderControlArray))
{
throw new java.lang.Exception ("LocalVolatilityGenerationControl Constructor => Invalid Inputs");
}

int uniformCPDArraySize = _uniformCPDArray.length;

if (0 == uniformCPDArraySize ||
uniformCPDArraySize != _impliedBrownianVariateArray.length ||
uniformCPDArraySize != _segmentCustomBuilderControlArray.length + 1)
{
throw new java.lang.Exception ("LocalVolatilityGenerationControl Constructor => Invalid Inputs");
}
}

/**
* Retrieve the Local Volatility Index Shift
Expand All @@ -82,4 +226,37 @@ public int localVolatilityIndexShift()
{
return _localVolatilityIndexShift;
}

/**
* Retrieve the Uniform Cumulative Probability Density Array
*
* @return The Uniform Cumulative Probability Density Array
*/

public double[] uniformCPDArray()
{
return _uniformCPDArray;
}

/**
* Retrieve the Implied Brownian Variate Array
*
* @return The Implied Brownian Variate Array
*/

public double[] impliedBrownianVariateArray()
{
return _impliedBrownianVariateArray;
}

/**
* Retrieve the Custom Segment Builder Control Array
*
* @return The Custom Segment Builder Control Array
*/

public org.drip.spline.params.SegmentCustomBuilderControl[] segmentCustomBuilderControlArray()
{
return _segmentCustomBuilderControlArray;
}
}
Loading

0 comments on commit 6b737e4

Please sign in to comment.