Collateral Modelling

This section contains methods for collateralised exposure calculation.

We follow the approaches in A. Green, XVA, 2016.

DiffFusion.collateral_call_timesFunction
collateral_call_times(
    Δt::ModelTime,
    first_call_time::ModelTime,
    last_call_time::ModelTime,
    )

Calculate margin call times.

Margin frequency is represented as time difference between margin call times, Δt.

first_call_time is the first margin time greater/equal time-0 and last_call_time is the last modelled margin call time.

DiffFusion.market_values_for_csaFunction
market_values_for_csa(
    portfolio::ScenarioCube,
    obs_times::AbstractVector,
    fx_rates::Union{ScenarioCube, Nothing} = nothing
    )

Calculate future market values of a given portfolio in CSA currency. Result is represented as ScenarioCube.

Market values of the portfolio are assumed in numeraire currency from a simulation.

fx_rates are simulated FOR-DOM exchange rates where FOR currency represents the CSA currency and DOM currency represents the numeraire currency of the simulation.

obs_times represent the margin call times for which market values are required. We implement linear interpolation of available market values.

DiffFusion.collateral_values_for_csaFunction
collateral_values_for_csa(
   portfolio::ScenarioCube,
   initial_collateral_balance::ModelValue,
   minimum_transfer_amount::ModelValue,
   threshold_amount::ModelValue,
   independent_amount::ModelValue,
   )

Calculate the collateral balance based on CSA parameters.

portfolio is assumed to be aggregated over legs and represents un-discounted market values in CSA currency.

CSA parameters are all denominated in CSA currency (or base currency).

initial_collateral_balance is the (net-)balance of posted/received collateral at time-0.

minimum_transfer_amount (MTA) is the minimum amount of collateral that is exchanged at a collateral call time. Here, MTA is assumed equal for bank and counterparty.

threshold_amount (TA) represents the maximum exposure of the portfolio below which no collateral is posted. Here, TA is assumed equal for bank and counterparty.

independent_amount represents a (net-)amount of collateral that is posted/received independent of the portfolio market value.

DiffFusion.effective_collateral_valuesFunction
effective_collateral_values(
    obs_times::AbstractVector,
    collateral_balance::ScenarioCube,
    margin_period_of_risk::ModelTime,
    )

Calculate the effective collateral balance per observation times.

The effective effective collateral balance is modelled as an additional ScenarioCube which can be joined with the original portfolio ScenarioCube. The resulting combined ScenarioCube represents the collateralised portfolio.

Portfolio observation times obs_times represent termination times following a potential default.

collateral_balance represent un-discounted market values of the collateral account from bank's perspective in CSA currency. Collateral observation times are margin call times.

margin_period_of_risk (MPR) represents the modelled time between default time τ and observation time t.

We make the following assumptions:

  • No margin flows are paid during MPR.
  • All trade flows are paid during MPR.

The modelled approach refers to the "Classical+" approach in Andersen/Pykhtin/Sokol, 2016.

DiffFusion.collateralised_portfolioFunction
collateralised_portfolio(
    portfolio::ScenarioCube,
    fx_rates::Union{ScenarioCube, Nothing},
    margin_call_times::AbstractVector,
    initial_collateral_balance::ModelValue,
    minimum_transfer_amount::ModelValue,
    threshold_amount::ModelValue,
    independent_amount::ModelValue,
    margin_period_of_risk::ModelTime,
    )

Calculate a collateralised portfolio by joining the effective collateral balance.