Credit tranche loss function (source code)

= Credit tranche loss function
{title2=$\ell_{A,D}(L)=\min((L-A)^+,D-A)$}

For aggregate monetary loss $L$ and monetary attachment/exhaustion levels $A<D$, this is the loss allocated to the tranche. It is zero until attachment, rises with losses between $A$ and $D$, and is capped at $D-A$. Expected tranche losses and surviving tranche notional determine protection and premium legs. For basket products whose payoff occurs at a first <default>, the joint default-time distribution matters as well as the final loss distribution.