ISDA SIMM (Standard Initial Margin Model) calculates initial margin requirements for non-cleared derivatives. Optimizing margin (through trade allocation, netting, and hedging) requires sensitivities of the SIMM margin with respect to portfolio risk factors. These gradients drive the optimization algorithms that minimize margin costs.
Three Approaches Compared
This application note benchmarks three approaches to computing SIMM margin gradients:
NumPy Finite Differences: The baseline approach. Bump each risk factor, recompute SIMM, estimate the gradient. Scales linearly with the number of risk factors (hundreds to thousands for a realistic portfolio). Simple but slow.
PyTorch Autograd: Record the SIMM calculation as a PyTorch computation graph, then use reverse-mode AD for gradients. Provides exact derivatives but carries the overhead of PyTorch’s general-purpose tape and dynamic graph management.
AADC: Record the SIMM calculation once, JIT-compile to native code, evaluate with adjoint mode. Provides exact derivatives through a compiled kernel with minimal overhead.
Results
AADC computes exact SIMM margin gradients orders of magnitude faster than NumPy finite differences and significantly faster than PyTorch. The advantage grows with portfolio complexity: more risk factors mean more finite-difference bumps, while AADC’s adjoint cost remains nearly constant regardless of the number of sensitivities.
For margin optimization workflows that run intraday (rebalancing margin as trades are added or market conditions change), the speed difference determines whether optimization is feasible in real time or requires overnight batch processing.
Read the full application note (PDF)
Published by MatLogica. Implemented using AADC, a commercial adjoint AD compiler (matlogica.com).