Docs / nablatensor-quant / com.nablatensor.credit

final class

PortfolioLossDistribution

The portfolio loss distribution under the one-factor Gaussian copula, by the Andersen-Sidenius-Basu recursion: conditional on the systemic factor the per-name default indicators are independent, so the number of defaults is a Poisson-binomial whose distribution is built by convolving one name in at a time; the unconditional distribution is a Gauss-Hermite integral over the factor.

This build assumes a homogeneous loss given default so losses fall on an integer grid of "one defaulted name". Heterogeneous notionals or recoveries are a bucketed extension of the same recursion.

Methods

static PortfolioLossDistribution homogeneous(double pd, int names, double rho, double lgd, int nodes)
pd
unconditional default probability per name to the horizon (same for every name)
names
pool size
rho
copula correlation
lgd
loss given default, as a fraction of one name's notional
nodes
Gauss-Hermite nodes for the factor integral (e.g. 64)
double probabilityOfDefaults(int k)

P(k names defaulted).

double expectedLoss()

Expected fractional portfolio loss.

double expectedTrancheLoss(double attach, double detach)

Expected loss of the tranche [attach, detach] (as fractions of the portfolio), i.e. E[ min(max(L - attach, 0), detach - attach) ].