Modeling Default Correlations

Overview


A mutlitple sector latent variable model is one where each of the loans in a portfolio is designated to belong to a particular group or category (sector) where the loans in a given group all have the same probability of default.

It is assumed that there is a common correlation of default among all the loans, regardless of group.

The method for fitting a multiple sector latent variable credit model detailed here is based on the method of Maximum Likelihood.

See Loffler for a full exposition.

Likelihood Multiple Sectors


The likelihood of the observed defaults at time {% t %} is given by
{% L_t = \displaystyle \int_{- \infty}^{\infty} \Pi_{k=1}^{\infty} \binom{N_{kt}}{D_{kt}} p_k(Z)^{D_{kt}} (1-p_k(Z))^{N_{kt} - D_{kt}} d \Phi(Z) %}
where now the index {% k %} refers to one of the defined sectors.

Then the total likelihood is given by
{% L = \Pi_{t=1}^T \displaystyle \int_{- \infty}^{\infty} \Pi_{k=1}^{\infty} \binom{N_{kt}}{D_{kt}} p_k(Z)^{D_{kt}} (1-p_k(Z))^{N_{kt} - D_{kt}} d \Phi(Z) %}

Numeric Integrand Approximation


We express the integrand above in the following form.
{% exp[\sum_{k} (log(\binom{N_{kt}}{D_{kt}}) + D_{kt} log(p_k(Z)) + (N_{kt} - D_{kt}) log(1-p_k(Z)))] %}
This is done because of numeric issues with calculating the number of combinations for a large number of loans. Here, we have converted the combinations to the logarithm of the number of combinations for which there is a numeric approximation.

Implementation


The data is encoded similar to the case of a single sector. However, each data point will include an array that contains the data for each sector.

This integral can be approximated using the Gauss Hermite Quadrature

The following code shows data for two time periods and two different sectors.


let data = [
	[[1064,0],[321,2]],
	[[1465,2],[589,65]]
];
					
The integrand is now different.


let getIntegrand = function(point, p, w){
	return function(x){
        let sum = 0;
        for(let i=0;i<point.length;i++){
            let Nk = point[i][0];
            let Dk = point[i][1];
            let lnCombinations = ml.lncombin(Nk,Dk);
            sum += lnCombinations;
            let prob = ml.conditionalProbability(x,p[i],w[i]);
            sum += Dk * Math.log(prob);
            sum += (Nk-Dk)*Math.log(1-prob);
        }
        return Math.exp(sum);
	}
}
					
Try it!


let ml = await import('/lib/finance/credit/v1.0.0/maximum-likelihood.mjs');
    
let p = [0.00137, 0.0445];
let w = [0.2668, 0.3271];

let data = [
	[[1064,0],[321,2]],
	[[1465,2],[589,65]],
    [[1617,0],[526,32]],
    [[3398,14],[2528,88]],
];

let result = ml.logLikelihood(data, p, w);
					
Try it!