Main Content

risk.validation.matrixWeightedBandwidth

Matrix weighted bandwidth

Since R2026a

    Description

    lowerUpperMWB = risk.validation.matrixWeightedBandwidth(CountMatrix) returns the lower matrix weighted bandwidth (MWB) and upper MWB for the counts in the matrix CountMatrix. You can use the MWBs to analyze customer migrations between rating grades in an ordinal rating grade system.

    example

    Examples

    collapse all

    Calculate the lower and upper weighted bandwidths for the credit rating grade counts in CountMatrix. The rows of CountMatrix correspond to credit rating grades at the start of the observation period, and the columns correspond to grades at the end. The values in CountMatrix are counts for the number of customers who migrated from one rating grade to another.

    Load the matrix.

    load("CountMatrix.mat")
    CountMatrix
    CountMatrix = 5×5
    
        10     8    15     9    10
        11     9    13     9     8
         0    10    10    11    10
         0     0     9    11    11
         0     0     0    11    10
    
    

    The element at position (3,5), for example, indicates that 10 customers migrated from rating grade 3 to rating grade 5.

    Calculate the upper and lower MWBs for CountMatrix.

    lowerUpperMWB = risk.validation.matrixWeightedBandwidth(CountMatrix)
    lowerUpperMWB = 1×2
    
        0.3306    0.6066
    
    

    The output shows that the MWB for migrations to lower credit rating grades is smaller than the MWB for migrations to higher rating grades.

    Input Arguments

    collapse all

    Count matrix, specified as a square matrix of nonnegative values. The elements of the matrix are counts for rating grade migrations. The rating grades can belong to any ordinal rating system. Examples of ordinal rating systems include credit rating grades, loss given default (LGD) rating grades, probability of default (PD) rating grades, and mortgage delinquency states.

    The rows of CountMatrix correspond to the grade at the beginning of the observation period and the columns correspond to the grade at the end. In other words, the element at position i,j represents the number of customers whose grade was i at the start of the observation period and j at then end of the observation period.

    • If all elements of CountMatrix are zero above the main diagonal of the matrix, matrixWeightedBandwidth returns NaN for the upper MWB.

    • If all elements of CountMatrix are zero below the main diagonal of the matrix, matrixWeightedBandwidth returns NaN for the lower MWB.

    • You cannot specify CountMatrix as an empty matrix.

    Data Types: single | double

    Output Arguments

    collapse all

    Matrix weighted bandwidths, returned as a 1-by-2 numeric vector. The first element of lowerUpperMWB contains the lower MWB and the second element contains the upper MWB.

    Each matrix bandwidth is the quotient of a sum of migration magnitudes and a sum of the largest possible migration magnitudes. The magnitude of a migration is the difference between its starting and final ratings. The lower MWB calculates the quotient for the counts below the main diagonal of the matrix specified by CountMatrix. The upper MWB calculates the quotient for the counts above the matrix diagonal.

    Algorithms

    The matrixWeightedBandwidth function calculates the matrix weighted bandwidth according to the formulas in Section 2.5.5.1 of [1].

    References

    [1] European Central Bank, “Instructions for reporting the validation results of internal models.” February, 2019. https://www.bankingsupervision.europa.eu/activities/internal_models/shared/pdf/instructions_validation_reporting_credit_risk.en.pdf.

    Version History

    Introduced in R2026a