Quant Memo
Advanced

Neural Approximations for Margin and XVA

Using a trained neural network as a fast stand-in for slow nested Monte Carlo pricing, so a bank can estimate margin and valuation adjustments across thousands of future scenarios in the time it used to take for one.

Prerequisites: Credit Valuation Adjustment

Pricing a derivatives portfolio's XVA (credit, funding, and capital valuation adjustments) or its initial margin requires simulating thousands of possible future market paths, and at each future date on each path, repricing the entire portfolio to see its value in that scenario — a simulation nested inside a simulation, like re-solving an entire exam for every possible way a single earlier answer could have gone. Done with standard pricing models, this "nested Monte Carlo" can take hours on a bank's full derivatives book even with heavy hardware.

The neural-approximation approach trains a network once, offline, to learn the mapping from market state (rates, spots, vols at a point in time) directly to portfolio value, using a large batch of full, expensive prices as training labels. Once trained, that network replaces the expensive inner-loop repricing: at each scenario, instead of re-running the full pricer, the bank runs the market state through the trained network, which returns an approximate price in microseconds rather than the seconds a full model would take.

Suppose full repricing of one instrument takes 50 milliseconds and a margin simulation needs 10 million reprices — roughly 139 hours of compute. A trained neural approximator returning each price in 50 microseconds instead cuts that to about 8 minutes, a roughly 1000x speedup, because the expensive work (learning the pricing function) was done once upfront rather than repeated for every scenario.

Training a neural network once on expensive full-pricer outputs, then using it as a near-instant stand-in inside a margin or XVA simulation, turns an infeasible nested Monte Carlo into something that can run in near real time.

Related concepts

Further reading

  • Ruiz & Zeron, Machine Learning for XVA (2019)
ShareTwitterLinkedIn