Class CvaApproximator

java.lang.Object
com.quantfinlib.credit.CvaApproximator

public final class CvaApproximator extends Object
UNILATERAL CVA — the price of the counterparty in every derivative you hold: the expected loss from their default before your trades' cash flows finish arriving. The standard discrete approximation the desks carry:
   CVA = LGD * sum_i EE(t_i) * [ Q(t_{i-1}) - Q(t_i) ] * DF(t_i)
 
expected exposure at each bucket, times the probability of defaulting IN that bucket (read off the CreditCurve's survival function), times the discount factor, times loss-given-default. The three ingredients are deliberately separate objects: EXPOSURE comes from your pricing/ simulation stack (this class does not know your portfolio — feed it CounterpartyExposureTracker peaks, a swap's expected-exposure hump, or Monte Carlo EE averages), CREDIT comes from the CDS-bootstrapped curve, DISCOUNT from the YieldCurve.

Approximations, stated: exposure is evaluated at the bucket END and assumed constant across the bucket (O(dt) bias, shrink the grid to shrink it); default and exposure are INDEPENDENT — no wrong-way risk, which UNDERSTATES CVA when exposure grows exactly when the counterparty weakens (the FX-forward-with-an-EM-sovereign classic); unilateral — your own default (DVA) is not netted; LGD is a constant you pass, usually 1 - recovery on the same convention as the curve's bootstrap, but kept separate because the curve's recovery is a quoting convention while CVA's LGD is a modeling choice. Research lane, deterministic.

  • Method Details

    • cva

      public static double cva(double[] expectedExposure, double[] bucketEndYears, CreditCurve counterparty, YieldCurve discount, double lgd)
      Discrete unilateral CVA over the given exposure profile.
      Parameters:
      expectedExposure - EE(t_i) per bucket, ≥ 0 (same currency units as the answer)
      bucketEndYears - bucket end times t_i in years, strictly ascending, all > 0; t_0 = 0 is implicit
      counterparty - the counterparty's bootstrapped credit curve
      discount - risk-free discounting curve
      lgd - loss given default in (0, 1]
      Returns:
      the CVA charge (positive; subtract it from the risk-free PV)