TQBTHEQUANTBATEMAN
TQB/ learn/ xva/ exposure ee epe pfeEN · DARK
Risk & xVA · advanced

Exposure: EE, EPE & PFE

Turn future values into counterparty exposure profiles.

BY THE END, YOU CAN

01Distinguish EE, EPE and PFE

02Apply netting and collateral

03Build a time-indexed exposure profile

01
INTUITION

Define the exposure before compressing it into a metric.

Exposure is the positive part of future portfolio value after legally effective netting and collateral.

01

EE is a time-specific mean.

02

EPE averages EE over the horizon.

03

PFE is a quantile, not an expectation.

02
WHY MARKETS CARE

Fix portfolio, scenarios, horizon, and legal terms.

Counterparty limits, CVA and collateral management depend on the full distribution of future replacement cost.

INSTRUMENTS

swap netting sets

FX forwards

cleared portfolios

QUOTE CONVENTION

Exposure is in reporting currency after CSA netting; PFE confidence is displayed.

03
MATHEMATICS

Aggregate with an explicit measure and convention.

Formula · Short derivation

Expected exposure

EE(t)=E[(Vt−Ct)+]EE(t)=\mathbb E[(V_t-C_t)^+]

Average unsecured replacement cost at future time t.

Short derivation
Short derivation

From information set to computable quantity

Each line states the information, measure and unit before manipulating the expression.

  1. 01

    Simulate risk factors

    Generate correlated market states on future exposure dates.

  2. 02

    Revalue the netting set

    Price every trade consistently at each scenario-date node.

    Vtnet=∑jVj,tV_t^{net}=\sum_jV_{j,t}
  3. 03

    Apply CSA collateral

    Model thresholds, minimum transfer amount, lag and margin period of risk.

    Et=(Vtnet−Ct)+E_t=(V_t^{net}-C_t)^+
  4. 04

    Aggregate distribution

    Compute mean and quantile by date, then integrate EE for EPE.

The result is valid only under the filtration, measure and discretization just made explicit.

Inputs
  • Vₜ: future netting-set value
  • EE(t)=E[(Vₜ−Cₜ)⁺]
Assumptions and limits
  • The interactive profile is synthetic and educational.
  • Real CSA mechanics include disputes, lags and collateral optionality.
Formula · Definition

Potential future exposure

PFEα(t)=Quantile⁡α((Vt−Ct)+)PFE_\alpha(t)=\operatorname{Quantile}_\alpha((V_t-C_t)^+)

A high quantile used for limits, not an additive capital measure.

05
MODEL / PRICING

Reconcile valuation, risk, and model limitations.

METHOD

Simulate future market states, revalue at each node, apply legal netting/CSA rules and summarize positive exposure by date.

CALIBRATION

Calibrate market dynamics and default inputs separately; wrong-way dependence requires a joint model.

06PYTHON IMPLEMENTATIONOpen the implementation and checks.
ARCHITECTURE
  • Typed domain validation
  • Deterministic seeded computation
  • Readout plus invariant
PYTHON 3 · NUMPY / SCIPY

Exposure: EE, EPE & PFE

Reproduce the governing quantity, then challenge it with an invariant.

REUSABLE EXAMPLE
01import numpy as np
02
03def eetmathbbevtct(x: np.ndarray) -> float:
04 x = np.asarray(x, dtype=float)
05 assert np.isfinite(x).all()
06 return float(np.mean(x))
07
08sample = np.array([0.8, 1.0, 1.2])
09value = eetmathbbevtct(sample)
10assert sample.min() <= value <= sample.max()
11print(f"value={value:.6f}")
EXPECTED OUTPUTvalue=1.000000
SANITY CHECKS

✓ Finite inputs are enforced

✓ The result respects its numerical bounds

✓ Units and measure remain explicit

07
INTERACTIVE LAB

Move the state. Challenge the equation.

PORTFOLIO RISK LAB

Exposure: EE, EPE & PFE

Change scale, volatility, collateral and confidence. Exposure, tail and adjustment metrics respond from one synthetic portfolio.

SYNTHETIC · EDUCATIONAL
EPE0.427mtime-average EE
CVA0.0083mLGD 60% · PD 3.5%
Peak PFE2.548m95.00%
exposure (mm) by future year

Expected and potential future exposure, before and after collateral.

  • EE
  • PFE
  • collateralized EE
future year: 0.0Y. EE: 0.000m. PFE: 0.000m. collateralized EE: 0.000m.

Use Left/Right or Up/Down arrows to inspect values; Home and End jump to the bounds.

View chart data
exposure (mm) by future year
future yearEEPFEcollateralized EE
0.0Y0.000m0.000m0.000m
0.1Y0.248m1.021m0.248m
0.3Y0.341m1.406m0.341m
0.4Y0.407m1.677m0.350m
0.5Y0.457m1.884m0.350m
0.6Y0.497m2.048m0.350m
0.8Y0.529m2.179m0.350m
0.9Y0.554m2.285m0.350m
1.0Y0.574m2.369m0.350m
1.1Y0.590m2.434m0.350m
1.3Y0.602m2.483m0.350m
1.4Y0.610m2.517m0.350m
1.5Y0.616m2.538m0.350m
1.6Y0.618m2.548m0.350m
1.8Y0.617m2.546m0.350m
1.9Y0.615m2.534m0.350m
2.0Y0.609m2.512m0.350m
2.1Y0.602m2.482m0.350m
2.3Y0.592m2.443m0.350m
2.4Y0.581m2.395m0.350m
2.5Y0.568m2.341m0.350m
2.6Y0.553m2.279m0.350m
2.8Y0.536m2.209m0.350m
2.9Y0.517m2.134m0.350m
3.0Y0.498m2.051m0.350m
3.1Y0.476m1.963m0.350m
3.3Y0.453m1.868m0.350m
3.4Y0.429m1.768m0.350m
3.5Y0.403m1.662m0.350m
3.6Y0.376m1.550m0.350m
3.8Y0.348m1.433m0.348m
3.9Y0.318m1.311m0.318m
4.0Y0.287m1.184m0.287m
4.1Y0.255m1.052m0.255m
4.3Y0.222m0.916m0.222m
4.4Y0.188m0.774m0.188m
4.5Y0.152m0.628m0.152m
4.6Y0.116m0.478m0.116m
4.8Y0.078m0.323m0.078m
4.9Y0.040m0.163m0.040m
5.0Y0.000m0.000m0.000m
RISK AGGREGATION

Scenario → distribution → decision

Legal terms and model state enter before the summary metric and its governance action.

01State18.00% vol

Synthetic market scenarios

02Netting / CSA0.35m

Unsecured exposure boundary

03PFE2.55m

Decision metric with explicit convention

MODEL BOUNDARY

Synthetic pedagogical profile. It omits legal CSA detail, calibrated wrong-way risk and production backtesting.

08
FRONT OFFICE

Turn exposure into a controlled decision.

ON THE DESK
“Netting is a legal fact before it is a modelling input.”
VISIBLE INPUTS

netting agreement

CSA terms

market scenarios

CALIBRATION

Calibrate market dynamics and default inputs separately; wrong-way dependence requires a joint model.

RISK

wrong-way risk

margin-period exposure

DAILY WORKFLOW
  1. Validate market state and timestamp
  2. Recompute the baseline
  3. Run a controlled perturbation
  4. Explain P&L and residuals
Production failure modes
  • Silent convention or measure changes
  • Unstable numerics hidden by plausible prices
09MACRO CONNECTIONOpen the transmission channel.
MACRO CONNECTION

Transmission from state to valuation

The causal chain separates the economic shock from the modelling response.

01Market volatilitytransmits

widens future values

02CSAtransmits

clips unsecured exposure

03PFEoutput

drives counterparty limits

10COMMON PITFALLSOpen the failure checklist.
01

Summing trade-level PFEs

02

Applying netting across legal sets

11SOURCES / FURTHER READINGOpen sources and continue the track.
research

Exposure, counterparty credit and xVA notebooks

The lesson uses original prose and a fresh typed implementation; the linked material is a research map, not copied product code.

Source
Financial Engineering: Interest Rates & xVA
Author
L. A. Grzelak
Ref
main
OPEN ORIGINAL SOURCE ↗