abaquant.credit.copula

Import path: abaquant.credit.copula

Domain: Credit-risk analytics and fundamentals-derived credit proxies.

Purpose

Gaussian-copula simulation for credit portfolios.

When to use it

Use this package for transition matrices, spread-based valuation, CDS/CDO building blocks, copula simulation, tail risk, and accounting-based credit diagnostics.

Public objects

  • function: thresholds_per_bond — Convert one issuer rating-transition row into latent Gaussian thresholds.

  • function: gaussian_copula_simulation — Simulate destination ratings and portfolio values under a Gaussian copula.

Detailed reference

Gaussian-copula simulation for credit portfolios.

Purpose

The module maps latent Gaussian factors through rating-transition thresholds and simulates portfolio values.

Conventions

Correlation matrices must be square and compatible with the issuer order. The seed controls reproducibility.

References

[ 1 ] Li, D. X. (2000), “On Default Correlation: A Copula Function Approach”.

abaquant.credit.copula.gaussian_copula_simulation(bonds_data, trans_mat, corr_mat, n_sims=50_000, seed=42)

Simulate destination ratings and portfolio values under a Gaussian copula.

Parameters:
  • bonds_data (list) – Issuer or bond input records in the package credit-risk schema.

  • trans_mat (np.ndarray) – Credit-rating transition matrix ordered by the package rating states.

  • corr_mat (np.ndarray) – Issuer correlation matrix ordered consistently with bonds_data.

  • n_sims (int, default=50000) – Number of Gaussian-copula simulations.

  • seed (int, default=42) – Optional pseudo-random seed for reproducible simulation.

Returns:

Result of the gaussian copula simulation calculation.

Return type:

np.ndarray

abaquant.credit.copula.thresholds_per_bond(rating_idx, trans_mat)

Convert one issuer rating-transition row into latent Gaussian thresholds.

Parameters:
  • rating_idx (int) – Index of the initial credit-rating state.

  • trans_mat (np.ndarray) – Credit-rating transition matrix ordered by the package rating states.

Returns:

Numeric array ordered consistently with the supplied strikes, time grid, assets, or state labels.

Return type:

numpy.ndarray