Main Content

portfolioRisk

Generate portfolio-level risk measurements

Description

[riskMeasures,confidenceIntervals] = portfolioRisk(cdc) returns tables of risk measurements for the portfolio losses. The simulate function must be run before portfolioRisk is used. For more information on using a creditDefaultCopula object, see creditDefaultCopula.

example

[riskMeasures,confidenceIntervals] = portfolioRisk(cdc,Name,Value) adds an optional name-value pair argument for ConfidenceIntervalLevel. The simulate function must be run before portfolioRisk is used.

example

Examples

collapse all

Load saved portfolio data.

load CreditPortfolioData.mat;

Create a 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: []

Set the VaRLevel to 99%.

cdc.VaRLevel = 0.99;

Use the simulate function before running portfolioRisk. Then use portfolioRisk with the creditDefaultCopula object to generate the riskMeasure and ConfidenceIntervals tables.

cdc = simulate(cdc,1e5);
[riskMeasure,confidenceIntervals] = portfolioRisk(cdc,'ConfidenceIntervalLevel',0.9)
riskMeasure=1×4 table
      EL       Std       VaR      CVaR 
    ______    ______    _____    ______

    24.876    23.778    102.4    121.28

confidenceIntervals=1×4 table
           EL                 Std                 VaR                 CVaR      
    ________________    ________________    ________________    ________________

    24.752        25    23.691    23.866    101.35    103.35    120.32    122.24

View a histogram of the portfolio losses.

histogram(cdc.PortfolioLosses);
title('Distribution of Portfolio Losses');

Figure contains an axes object. The axes object with title Distribution of Portfolio Losses contains an object of type histogram.

For further analysis, use the simulate, portfolioRisk, riskContribution, confidenceBands, and getScenarios functions with the creditDefaultCopula object.

Input Arguments

collapse all

creditDefaultCopula object obtained after running the simulate function.

For more information on creditDefaultCopula objects, see creditDefaultCopula.

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: [riskMeasure,confidenceIntervals] = portfolioRisk(cdc,'ConfidenceIntervalLevel',0.9)

Confidence interval level, specified as the comma-separated pair consisting of 'ConfidenceIntervalLevel' and a numeric between 0 and 1. For example, if you specify 0.95, a 95% confidence interval is reported in the output table (riskMeasures).

Data Types: double

Output Arguments

collapse all

Risk measures, returned as a table containing the following columns:

  • EL — Expected loss, the mean of portfolio losses

  • Std — Standard deviation of the losses

  • VaR — Value at risk at the threshold specified by the VaRLevel property of the creditDefaultCopula object

  • CVaR — Conditional VaR at the threshold specified by the VaRLevel property of the creditDefaultCopula object

Confidence intervals, returned as a table of confidence intervals corresponding to the portfolio risk measures reported in the riskMeasures table. Confidence intervals are reported at the level specified by the ConfidenceIntervalLevel parameter.

References

[1] 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.

[2] Gordy, M. “A Comparative Anatomy of Credit Risk Models.” Journal of Banking and Finance. Vol. 24, 2000, pp. 119 – 149.

[3] Gupton, G., Finger, C., and Bhatia, M. “CreditMetrics – Technical Document.” J. P. Morgan, New York, 1997.

[4] Jorion, P. Financial Risk Manager Handbook. 6th Edition. Wiley Finance, 2011.

[5] Löffler, G., and Posch, P. Credit Risk Modeling Using Excel and VBA. Wiley Finance, 2007.

[6] McNeil, A., Frey, R., and Embrechts, P. Quantitative Risk Management: Concepts, Techniques, and Tools. Princeton University Press, 2005.

Version History

Introduced in R2017a