The code is explained in the article P. Okunev, "A Fast Algorithm for Computing Expected Loan Portfolio Tranche Loss in the Gaussian Factor Model", LBNL-57676, 2005.
Futher refinments of this algorithm are descibed in Okunev, Pavel, "Using Hermite Expansions for Fast and Arbitrarily Accurate Computation of the Expected Loss of a Loan Portfolio Tranche in the Gaussian Factor Model" .
This is a MATLAB code. It's relatively easy to adapt it for VBA.
ATTENTION: This code was tested and works well for portfolios of size 125. The accuracy will decrease for smaller portfolios. Higher accuracy can be achieved using the methos described in Okunev, Pavel, "Using Hermite Expansions for Fast and Arbitrarily Accurate Computation of the Expected Loss of a Loan Portfolio Tranche in the Gaussian Factor Model" .
This implements one factor Gaussian model.
L = exposures,as fraction of total
portfolio, taking into account the recovery rate
Example: loan 1 is 0.01 fraction of the total portfolio, recovery rate is
40% then L(1)=0.01*(1-0.4)
w = loading factors
p = default probabilities
a = attachement point
d = detachment point
N = number of names in the portfolio
loss = expected tranche loss as percentage of the portfolio nominal
expressed in basis points
Copyright by Pavel Okunev 2005
This code is provided as is. The author provides no warranty and assumes no responsibility for any losses due to the use of this code.
You are granted permission to use this code for personal use and for academic research.
This code may not be used for commercial purposes without explicit permission by the author.
Permission for commercial use can be obtained by writing to firstname.lastname@example.org
You may make and distribute a small number of copies of this code if you include this copyright notice with the code.
If you distribute a modified version of this code you must include the copyright notice and conspicuously indicate that the code was modified.
We are thankful to John Weare, LBNL and UC Berkeley, for his assistance with debuging the code.
Please report bugs to: email@example.com
Pavel Okunev (2023). Fast Computation of the Expected Tranche Loss of CDO Credit Portfolio (https://www.mathworks.com/matlabcentral/fileexchange/8945-fast-computation-of-the-expected-tranche-loss-of-cdo-credit-portfolio), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
- AI, Data Science, and Statistics > Statistics and Machine Learning Toolbox > Probability Distributions >
- Computational Finance > Financial Toolbox > Portfolio Optimization and Asset Allocation >
- Computational Finance > Financial Instruments Toolbox > Price Instruments Using Functions > Credit Derivatives and Credit Exposures > Counterparty Credit Risk >
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!