Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

creditMigrationCopula

Simulate and analyze multifactor credit migration rating model

Description

The creditMigrationCopula takes as input a portfolio of credit-sensitive positions with a set of counterparties and performs a copula-based, multifactor simulation of credit rating migrations. Counterparty credit rating migrations and subsequent changes in portfolio value are calculated for each scenario and several risk measurements are reported.

creditMigrationCopula associates each counterparty with a random variable, called a latent variable, which is mapped to credit ratings based on a rating transition matrix. For each scenario, the value of the position with each counterparty is recomputed based on the realized credit rating of the counterparty. These latent variables are simulated by using a multifactor model, where systemic credit fluctuations are modeled with a series of risk factors. These factors can be based on industry sectors (such as financial or aerospace), geographical regions (such as USA or Eurozone), or any other underlying driver of credit risk. Each counterparty is assigned a series of weights which determine their sensitivity to each underlying credit factors.

The inputs to the model are:

  • migrationValues — Values of the counterparty positions for each credit rating.

  • ratings — Current credit rating for each counterparty.

  • transitionMatrix — Matrix of credit rating transition probabilities.

  • LGD — Loss given default (1 − Recovery).

  • Weights — Factor and idiosyncratic model weights

After you create creditMigrationCopula object (see Create creditMigrationCopula and Properties), use the simulate function to simulate credit migration by using the multifactor model. Then, for detailed reports, use the following functions: portfolioRisk, riskContribution, confidenceBands, and getScenarios.

Creation

Syntax

cmc = creditMigrationCopula(migrationValues,ratings,transitionMatrix,LGD,Weights)
cmc = creditMigrationCopula(___,Name,Value)

Description

example

cmc = creditMigrationCopula(migrationValues,ratings,transitionMatrix,LGD,Weights) creates a creditMigrationCopula object. The creditMigrationCopula object has the following properties:

  • Portfolio:

    A table with the following variables:

    • ID — ID to identify each counterparty

    • migrationValues — Values of counterparty positions for each credit rating

    • ratings — Current credit rating for each counterparty

    • LGD — Loss given default

    • Weights — Factor and idiosyncratic weights for counterparties

  • FactorCorrelation:

    Factor correlation matrix, a NumFactors-by-NumFactors matrix that defines the correlation between the risk factors.

  • RatingLabels:

    The set of all possible credit ratings.

  • TransitionMatrix:

    The matrix of probabilities that a counterparty transitions from a starting credit rating to a final credit rating. The rows represent the starting credit ratings and the columns represent the final ratings. The top row holds the probabilities for a counterparty that starts at the highest rating (for example AAA) and the bottom row holds those for a counterparty starting in the default state. The bottom row may be omitted, indicating that a counterparty in default will remain in default. Each row must sum to 1. The order of rows and columns must match the order of credit ratings defined in the RatingLabels parameter. The last column holds the probability of default for each of the ratings. If unspecified, the default rating labels are: "AAA","AA","A","BBB","BB","B","CCC","D".

  • VaRLevel:

    The value-at-risk level, used when reporting VaR and CVaR.

  • PortfolioValues:

    A NumScenarios-by-1 vector of portfolio values. This property is empty until you use the simulate function.

example

cmc = creditMigrationCopula(___,Name,Value) sets Properties using name-value pairs and any of the arguments in the previous syntax. For example, cmc = creditMigrationCopula(migrationValues,ratings,transitionMatrix,LGD,Weights,'VaRLevel',0.99). You can specify multiple name-value pairs.adds optional name-value pair arguments.

Input Arguments

expand all

Values of the counterparty positions for each credit rating, specified as a NumCounterparties-by-NumRatings matrix. Each row holds the possible values of the counterparty position for each credit rating. The last rating must be the default rating. The value for this rating is pre-recovery. The migrationValues input sets the Portfolio property.

Note

The creditMigrationCopula model simulates the changes in portfolio value over a fixed time period (for example, one year). The migrationValues and transitionMatrix must be specific to a particular time period.

Data Types: double

Current credit rating for each counterparty, specified as a NumCounterparties-by-1 vector that represents the initial credit states. The set of all valid credit ratings and their order is defined by using the optional RatingLabels parameter. The ratings input sets the Portfolio property.

If RatingLabels are unspecified, the default rating labels are: "AAA","AA","A","BBB","BB","B","CCC","D".

Data Types: double | string | cell

Credit rating transition probabilities, specified as a NumRatings-by-NumRatings matrix. The matrix contains the probabilities that a counterparty starting at a particular credit rating transitions to every other rating over some fixed time period. Each row holds all the transition probabilities for a particular starting credit rating. The transitionMatrix input sets the TransitionMatrix property.

The top row holds the probabilities for a counterparty that starts at the highest rating (such as AAA). The bottom row holds the probabilities for a counterparty starting in the default state. The bottom row may be omitted, indicating that a counterparty in default will remain in default. Each row must sum to 1.

The order of rows and columns must match the order of credit ratings defined in the RatingLabels parameter. The last column holds the probability of default for each of the ratings. If RatingLabels are unspecified, the default rating labels are: "AAA","AA","A","BBB","BB","B","CCC","D".

Note

The creditMigrationCopula model simulates the changes in portfolio value over a fixed time period (for example, one year). The migrationValues and transitionMatrix must be specific to a particular time period.

Data Types: double

Loss given default, specified as a NumCounterparties-by-1 numeric vector with elements from 0 through 1, representing the fraction of exposure that is lost when a counterparty defaults. LGD is defined as (1 − Recovery). For example, an LGD of 0.6 implies a 40% recovery rate in the event of a default. The LGD input sets the Portfolio property.

LGD can alternatively be specified as a NumCounterparties-by-2 matrix, where the first column holds the LGD mean values and the 2nd column holds the LGD standard deviations. Then, in the case of default, LGD values are drawn randomly from a beta distribution with provided parameters for the defaulting counterparty.

Valid open intervals for LGD mean and standard deviation are:

  • For the first column, the mean values are between 0 and 1.

  • For the second column, the LGD standard deviations are between 0 and sqrt(m*(1-m)).

Data Types: double

Factor and idiosyncratic weights, specified as a NumCounterparties-by-(NumFactors + 1) array. Each row contains the factor weights for a particular counterparty. Each column contains the weights for an underlying risk factor. The last column in Weights contains the idiosyncratic risk weight for each counterparty. The idiosyncratic weight represents the company-specific credit risk. The total of the weights for each counterparty (that is, each row) must sum to 1. The Weights input sets the Portfolio property.

For example, if a counterparty’s creditworthiness was composed of 60% US, 20% European, and 20% idiosyncratic, then the Weights vector is [0.6 0.2 0.2].

Data Types: double

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: cmc = creditMigrationCopula(migrationValues,ratings,transitionMatrix,LGD,Weights,'VaRLevel',0.99)

expand all

User-defined IDs for counterparties, specified as the comma-separated pair consisting of 'ID' and a NumCounterparties-by-1 vector of IDs for each counterparty. ID is used to identify exposures in the Portfolio table and the risk contribution table. ID must be a numeric, a string array, or a cell array of character vectors. The ID name-value pair argument sets the Portfolio property.

If unspecified, ID defaults to a numeric vector (1:NumCounterparties).

Data Types: double | string | cell

Value at risk level (used for reporting VaR and CVaR), specified as the comma-separated pair consisting of 'VaRLevel' and a numeric between 0 and 1. The VaRLevel name-value pair argument sets the VaRLevel property.

Data Types: double

Factor correlation matrix, specified as the comma-separated pair consisting of 'FactorCorrelation' and a NumFactors-by-NumFactors matrix that defines the correlation between the risk factors. The FactorCorrelation name-value pair argument sets the FactorCorrelation property.

If not specified, the factor correlation matrix defaults to an identity matrix, meaning that the factors are not correlated.

Data Types: double

Set of all possible credit ratings, specified as the comma-separated pair consisting of 'RatingLabels' and a NumRatings-by-1 vector, where the first element is the highest credit rating and the last element is the default state. The RatingLabels name-value pair argument sets the RatingLabels property.

Data Types: cell | double | string

Properties

expand all

Details of credit portfolio, specified as a MATLAB® table that contains all the portfolio data that was passed as input into the creditMigrationCopula object.

The Portfolio table has a column for each of the constructor inputs (MigrationValues, Rating, LGD, Weights, and ID). Each row of the table represents one counterparty.

For example:

    ID    MigrationValues    Rating     LGD        Weights   
    __    _______________    ______    ______    ____________

    1     [1x8 double]       "A"       0.6509     0.5     0.5
    2     [1x8 double]       "BBB"     0.8283     0.55    0.45
    3     [1x8 double]       "AA"      0.6041     0.7     0.3
    4     [1x8 double]       "BB"      0.6509     0.55    0.45
    5     [1x8 double]       "BBB"     0.4966     0.75    0.25

Data Types: table

Correlation matrix for credit factors, specified as a NumFactors-by-NumFactors matrix. Specify the correlation matrix by using the optional name-value pair argument 'FactorCorrelation' when you create the creditMigrationCopula object.

Data Types: double

Set of all possible credit ratings, specified using an optional name-value input argument for 'RatingLabels' when you create the creditMigrationCopula object.

Data Types: double | cell | string

Probabilities that a counterparty transitions from a starting credit rating to a final credit rating, specified using the input argument 'transitionMatrix' when you create the creditMigrationCopula object. The rows represent the starting credit ratings and the columns represent the final ratings. The top row corresponds to the highest rating.

The top row holds the probabilities for a counterparty that starts at the highest rating (such as AAA) and the bottom row holds those for a counterparty starting in the default state. The bottom row may be omitted, indicating that a counterparty in default will remain in default. Each row must sum to 1.

The order of rows and columns must match the order of credit ratings defined in the RatingLabels parameter. The last column holds the probability of default for each of the ratings. If RatingLabels are unspecified, the default rating labels are: "AAA","AA","A","BBB","BB","B","CCC","D".

Data Types: double

Value at risk level used when reporting VaR and CVaR, specified using an optional name-value pair argument 'VaRLevel' when you create the creditMigrationCopula object.

Data Types: double

Portfolio values, specified as a 1-by-NumScenarios vector. After creating the creditMigrationCopula object, the PortfolioValues property is empty. After you invoke the simulate function, PortfolioValues is populated with the portfolio values over each scenario.

Data Types: double

Object Functions

simulateSimulate credit migrations using creditMigrationCopula object
portfolioRiskGenerate portfolio-level risk measurements
riskContributionGenerate risk contributions for each counterparty in portfolio
confidenceBandsConfidence interval bands
getScenariosCounterparty scenarios

Examples

expand all

Load the saved portfolio data.

load CreditMigrationData.mat;

Scale the bond prices for portfolio positions for each bond.

migrationValues = migrationPrices .* numBonds;

Create a creditMigrationCopula object with a four-factor model using creditMigrationCopula.

cmc = creditMigrationCopula(migrationValues,ratings,transMat,...
lgd,weights,'FactorCorrelation',factorCorr)
cmc = 

  creditMigrationCopula with properties:

            Portfolio: [250x5 table]
    FactorCorrelation: [4x4 double]
         RatingLabels: [8x1 string]
     TransitionMatrix: [8x8 double]
             VaRLevel: 0.9500
      PortfolioValues: []

Set the VaRLevel to 99%.

 cmc.VaRLevel = 0.99;

Use the simulate function to simulate 100,000 scenarios, and then view portfolio risk measures using the portfolioRisk function.

 cmc = simulate(cmc,1e5)
 portRisk = portfolioRisk(cmc)
cmc = 

  creditMigrationCopula with properties:

            Portfolio: [250x5 table]
    FactorCorrelation: [4x4 double]
         RatingLabels: [8x1 string]
     TransitionMatrix: [8x8 double]
             VaRLevel: 0.9900
      PortfolioValues: [1x100000 double]


portRisk =

  1x4 table

      EL       Std      VaR     CVaR 
    ______    _____    _____    _____

    4573.9    13039    56515    84463

View a histogram of the portfolio values.

h = histogram(cmc.PortfolioValues,125);
title('Distribution of Portfolio Values');

Load the saved portfolio data.

load CreditMigrationData.mat;

Scale the bond prices for portfolio positions for each bond.

migrationValues = migrationPrices .* numBonds;

Create a creditMigrationCopula object with a four-factor model using creditMigrationCopula.

cmc = creditMigrationCopula(migrationValues,ratings,transMat,...
lgd,weights,'FactorCorrelation',factorCorr)
cmc = 

  creditMigrationCopula with properties:

            Portfolio: [250x5 table]
    FactorCorrelation: [4x4 double]
         RatingLabels: [8x1 string]
     TransitionMatrix: [8x8 double]
             VaRLevel: 0.9500
      PortfolioValues: []

Set the VaRLevel to 99%.

 cmc.VaRLevel = 0.99;

Use the simulate function to simulate 100,000 scenarios, and then view portfolio risk measures by using the portfolioRisk function.

 cmc = simulate(cmc,1e5)
 portRisk = portfolioRisk(cmc)
cmc = 

  creditMigrationCopula with properties:

            Portfolio: [250x5 table]
    FactorCorrelation: [4x4 double]
         RatingLabels: [8x1 string]
     TransitionMatrix: [8x8 double]
             VaRLevel: 0.9900
      PortfolioValues: [1x100000 double]


portRisk =

  1x4 table

      EL       Std      VaR     CVaR 
    ______    _____    _____    _____

    4573.9    13039    56515    84463

View a histogram of the portfolio values.

h = histogram(cmc.PortfolioValues,125);
title('Distribution of Portfolio Values');

Overlay the value that the portfolio takes if all counterparties maintained their current credit ratings.

CurrentRatingValue = portRisk.EL + mean(cmc.PortfolioValues);
     hold on
     plot([CurrentRatingValue CurrentRatingValue],[0 max(h.Values)],...
         'LineWidth',2);
     grid on

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.

Introduced in R2017a

Was this topic helpful?