Skip to content

Commit

Permalink
Features:
Browse files Browse the repository at this point in the history
Bug Fixes/Clean-up:

Samples:

	- OTC Payer CSA Classical+ #1 (1, 2)
	- OTC Payer CSA Classical+ #2 (3, 4)
	- OTC Payer CSA Classical+ #3 (5, 6)
	- OTC Payer CSA Classical+ #4 (7, 8)
	- OTC Payer CSA Classical+ #5 (9, 10)
	- OTC Payer CSA Classical+ #6 (11, 12)
  • Loading branch information
lakshmiDRIP committed May 23, 2018
1 parent 55441e1 commit bbdecaf
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 20 deletions.
13 changes: 13 additions & 0 deletions ReleaseNotes/05_23_2018.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

Features:

Bug Fixes/Clean-up:

Samples:

- OTC Payer CSA Classical+ #1 (1, 2)
- OTC Payer CSA Classical+ #2 (3, 4)
- OTC Payer CSA Classical+ #3 (5, 6)
- OTC Payer CSA Classical+ #4 (7, 8)
- OTC Payer CSA Classical+ #5 (9, 10)
- OTC Payer CSA Classical+ #6 (11, 12)
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.drip.state.identifier.ForwardLabel;
import org.drip.state.identifier.LatentStateLabel;
import org.drip.state.identifier.OvernightLabel;
import org.drip.xva.gross.BaselExposureDigest;
import org.drip.xva.gross.ExposureAdjustmentAggregator;
import org.drip.xva.gross.ExposureAdjustmentDigest;
import org.drip.xva.gross.MonoPathExposureAdjustment;
Expand All @@ -50,6 +51,7 @@
import org.drip.xva.netting.CollateralGroupPath;
import org.drip.xva.netting.CreditDebtGroupPath;
import org.drip.xva.netting.FundingGroupPath;
import org.drip.xva.settings.StandardizedExposureGeneratorScheme;
import org.drip.xva.strategy.AlbaneseAndersenFundingGroupPath;
import org.drip.xva.strategy.AlbaneseAndersenNettingGroupPath;
import org.drip.xva.vertex.AlbaneseAndersen;
Expand Down Expand Up @@ -546,6 +548,50 @@ private static final MarketVertexGenerator ConstructMarketVertexGenerator (
);
}

private static final void DisplayThinStatistics (
final String annotation,
final UnivariateDiscreteThin univariateDiscreteThin)
throws Exception
{
System.out.println (
annotation + " => " +
FormatUtil.FormatDouble (univariateDiscreteThin.average(), 3, 0, 1.) + " | " +
FormatUtil.FormatDouble (univariateDiscreteThin.minimum(), 3, 0, 1.) + " | " +
FormatUtil.FormatDouble (univariateDiscreteThin.maximum(), 3, 0, 1.) + " | " +
FormatUtil.FormatDouble (univariateDiscreteThin.error(), 3, 0, 1.) + " ||"
);
}

private static final void DisplayBaselMeasures (
final BaselExposureDigest baselExposureDigest)
throws Exception
{
System.out.println (
"\t| Expected Exposure => " +
FormatUtil.FormatDouble (baselExposureDigest.expectedExposure(), 6, 0, 1.) + " ||"
);

System.out.println (
"\t| Expected Positive Exposure => " +
FormatUtil.FormatDouble (baselExposureDigest.expectedPositiveExposure(), 6, 0, 1.) + " ||"
);

System.out.println (
"\t| Effective Expected Exposure => " +
FormatUtil.FormatDouble (baselExposureDigest.effectiveExpectedExposure(), 6, 0, 1.) + " ||"
);

System.out.println (
"\t| Effective Expected Positive Exposure => " +
FormatUtil.FormatDouble (baselExposureDigest.effectiveExpectedPositiveExposure(), 6, 0, 1.) + " ||"
);

System.out.println (
"\t| Exposure At Default => " +
FormatUtil.FormatDouble (baselExposureDigest.exposureAtDefault(), 6, 0, 1.) + " ||"
);
}

public static final void main (
final String[] args)
throws Exception
Expand Down Expand Up @@ -578,10 +624,20 @@ public static final void main (
{0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1.00, 0.00}, // #8 CLIENT FUNDING REPLICATOR
{0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1.00}, // #9 FORWARD NUMERAIRE
};

String fixFloatMaturityTenor = "1Y";
double fixFloatCoupon = 0.02;
double fixFloatNotional = -10.e+06;

double eadMultiplier = 1.;
int timeIntegrand = 365;

StandardizedExposureGeneratorScheme standardizedExposureGeneratorScheme =
new StandardizedExposureGeneratorScheme (
eadMultiplier,
timeIntegrand
);

ForwardLabel forwardLabel = ForwardLabel.Create (
currency,
"3M"
Expand Down Expand Up @@ -774,20 +830,19 @@ public static final void main (

System.out.println ("\t|---------------------------------------||");

EnvManager.TerminateEnv();
}
System.out.println();

private static final void DisplayThinStatistics (
final String annotation,
final UnivariateDiscreteThin univariateDiscreteThin)
throws Exception
{
System.out.println (
annotation + " => " +
FormatUtil.FormatDouble (univariateDiscreteThin.average(), 3, 0, 1.) + " | " +
FormatUtil.FormatDouble (univariateDiscreteThin.minimum(), 3, 0, 1.) + " | " +
FormatUtil.FormatDouble (univariateDiscreteThin.maximum(), 3, 0, 1.) + " | " +
FormatUtil.FormatDouble (univariateDiscreteThin.error(), 3, 0, 1.) + " ||"
);
System.out.println ("\t|-------------------------------------------------||");

System.out.println ("\t| BASEL EXPOSURE MEASURES ||");

System.out.println ("\t|-------------------------------------------------||");

DisplayBaselMeasures (exposureAdjustmentAggregator.baselExposureDigest
(standardizedExposureGeneratorScheme));

System.out.println ("\t|-------------------------------------------------||");

EnvManager.TerminateEnv();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1327,20 +1327,22 @@ public org.drip.xva.gross.BaselExposureDigest baselExposureDigest (
return null;
}

int integrandFinish = vertexDateArray[0] + standardizedExposureGeneratorScheme.timeIntegrand();
int exposureGeneratorTimeIntegrand = standardizedExposureGeneratorScheme.timeIntegrand();

int integrandFinishDate = vertexDateArray[0] + exposureGeneratorTimeIntegrand;

double effectiveExpectedPositiveExposure =
multiSegmentSequenceEffectiveCollateralizedPositiveExposure.toAU().integrate (
vertexDateArray[0],
integrandFinish
);
integrandFinishDate
) / exposureGeneratorTimeIntegrand;

return new BaselExposureDigest (
vertexDateArray[0],
collateralizedPositiveExposure[0],
multiSegmentSequenceCollateralizedPositiveExposure.toAU().integrate (
vertexDateArray[0],
integrandFinish
),
integrandFinishDate
) / exposureGeneratorTimeIntegrand,
effectiveCollateralizedPositiveExposure[vertexCount - 1],
effectiveExpectedPositiveExposure,
effectiveExpectedPositiveExposure * standardizedExposureGeneratorScheme.eadMultiplier()
Expand Down

0 comments on commit bbdecaf

Please sign in to comment.