Load saved portfolio data.
creditDefaultCopula object with a two-factor model.
cdc = creditDefaultCopula(EAD,PD,LGD,Weights2F,'FactorCorrelation',FactorCorr2F)
cdc = creditDefaultCopula with properties: Portfolio: [100x5 table] FactorCorrelation: [2x2 double] VaRLevel: 0.9500 UseParallel: 0 PortfolioLosses: 
VaRLevel to 99%.
cdc.VaRLevel = 0.99;
simulate function before running
getScenarios. Use the
getSenarios function with the
creditDefaultCopula object to generate the
cdc = simulate(cdc,1e5); scenarios = getScenarios(cdc,[2,3]); % expected loss for each scenario mean(scenarios)
ans = 1×2 0.1382 1.1461
scenarioIndices— Specifies which scenarios are returned
Specifies which scenarios are returned, entered as a vector.
scenarios— Counterparty losses
Counterparty losses, returned as
N is the number of elements in
If the number of scenarios requested is large, then the output
scenarios, could be large and
potentially limited by the available machine memory.
 Crouhy, M., Galai, D., and Mark, R. “A Comparative Analysis of Current Credit Risk Models.” Journal of Banking and Finance. Vol. 24, 2000, pp. 59–117.
 Gordy, M. “A Comparative Anatomy of Credit Risk Models.” Journal of Banking and Finance. Vol. 24, 2000, pp. 119–149.
 Gupton, G., Finger, C., and Bhatia, M. “CreditMetrics – Technical Document.” J. P. Morgan, New York, 1997.
 Jorion, P. Financial Risk Manager Handbook. 6th Edition. Wiley Finance, 2011.
 Löffler, G., and Posch, P. Credit Risk Modeling Using Excel and VBA. Wiley Finance, 2007.
 McNeil, A., Frey, R., and Embrechts, P. Quantitative Risk Management: Concepts, Techniques, and Tools. Princeton University Press, 2005.