model_clo_insight.engines.defaults module

Default Pooling Analytics

run_defaults(obligors, loans, transaction_data, settings, methodology_params)

CLO Insight Pool Default Monte Simulation

This is the Monte Carlo Simulation engine for the Pool Default analysis. The inputs to this method are all custom classes, and must be constructed earlier in pre-processing. The simulation is a multi-factor model, where each obligor’s random shock is a linear combination of:

  • Global Shock

  • Industry shock

  • Region Shock

  • Idiosyncratic Shock

The coefficients are computed from the asset correlation assumptions within meth_params. In practice, the correlation assumptions for inter- and intra- region are the same, which results in a zero for the coefficient of regional shock. To optimize this engine for speed, all random numbers are drawn inside Numpy earlier, and matrix arithmetic is used to perform the computations.

Algorithm Steps

    1. Pre-compute factor coefficients from correlation parameters \(a + b\)

    1. Setup random number generator

    1. Simulate \(n_{trials}\) independent random normal Global Shocks \(n_{trials} = a + b\)

    1. Compute lookup arrays

    1. Simulate \(n_{trials}\) x \(n_{obligors}\) independent random normal Idiosyncratic Shocks \(n_{trials} = a * b\)

    1. Simulate \(n_{trials}\) x \(n_{industries}\) independent random normal Industry Shocks

    1. Calculate \(n_{trials}\) x \(n_{obligors}\) correlated random normal variables based on linear combination of the Shocks

    1. Calculate default timing per obligor per trial by looking up the simulated shock variable to the obligor’s normalized PD curve

Parameters
Returns

ttd_matrix (\(n_{trials}\) x \(n_{obligors}\) matrix of simulated default times) and global_shocks (\(n_{trials}\) Global Shock values)

Return type

tuple of numpy.ndarray

Notes

  • Dictionaries cannot be used inside of Numpy’s vectorized code, so positional lookups need to be determined prior to the simulation