The main goal of quantitative research and derivatives libraries is not valuation but risk: what amounts of what assets we must trade to hedge the market risk or the regulatory adjustment of a derivatives portfolio. It is a major achievement of financial theory to have demonstrated that hedge ratios correspond to differential sensitivities. The goal is therefore to produce fast and accurate differentials of the valuation function. The determination and implementation of the valuation function is merely a step on the way, since, obviously, a function must be defined before it can be differentiated. We dealt with valuation in the previous part. This part is dedicated to differentiation.

Differentials are traditionally computed in finance by finite differences – or bumping: bump market inputs one by one and repeat valuation every time. This procedure may take unreasonable time, since valuation is repeated as many times as we have market inputs. The complexity of the differentiation is linear in the number of differentials. This number is typically large, several thousands for a derivatives book or the xVA of a netting set. It is not viable when the valuation is expensive, as is the case with regulatory calculations, and Monte-Carlo simulations in general. In recent years, the financial industry adopted the much more efficient algorithmic adjoint differentiation (AAD), which computes all sensitivities in constant time.

Despite being vastly superior and ...

Get Modern Computational Finance now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.