WBS Fixed Income Conference 2015 (Paris)

At the 11th WBS Fixed Income Conference Alexander Sokol presented a pre-conference workshop as well as two talks during the main conference program.

Pre-Conference Workshop Day: Retrofitting AAD to Your Existing C++ Library: A Step by Step Guide with TapeScript and QuantLibAdjoint

During the pre-conference workshop day, Alexander Sokol together with Luigi Ballabio, StatPro presented a hands-on workshop on using open source and Adjoint Algorithmic Differentiation (AAD) in quant finance. The workshop covered the following topics:

Introduction to AAD:

  • Forward and reverse mode,
  • Tapeless scalar, tapeless vector, or tape AAD,
  • Operator overloading, source transformation, or hand-coding,
  • Overview of leading C++ libraries for AAD,
  • Simple examples,
  • Where and how to use AAD in quant finance.

Replacement of double by AD double:

  • The challenge of designing drop-in replacement for double in C++98 and C++11,
  • Typical errors arising when trying to replace double by a class with overloaded arithmetic operators,
  • Non-technical summary of C++ strategies for overcoming these challenges,
  • TapeScript as inline wrapper to AD double designed for easier drop-in replacement of double,
  • Implementing or finding AD versions of special functions,
  • Dealing with complex AD numbers in C++,
  • Testing strategy for the correctness of double replacement.

Tape cutting and tape compression:

  • The tape size problem in AAD and key ways of solving it,
  • Lossless and lossy tape compression,
  • AD double array as the second fundamental unit of computing to AD double.

When operator overloading is not enough:

  • The if operator and the need to represent delta function,
  • Implementing AAD for Monte Carlo and American Monte Carlo,
  • Implementing AAD for lattices.

QuantLib + CppAD + TapeScript = QuantLibAdjoint:

  • From observer pattern to immutable objects in QuantLib,
  • Compiling QuantLib with and without adjoint capability,
  • Porting special functions used in QuantLib,
  • Porting complex number arithmetics in QuantLib.

QuantLibAdjoint performance gain examples:

  • Linear instrument sensitivities,
  • Analytical option sensitivities,
  • Curve builders,
  • Vol surfaces,
  • Pricing large portfolios,
  • Monte Carlo risk,
  • Real-time pricing.

While workshop participants were benefiting from the knowledge of C++ and quant library design, it was the presenters intention to make the material accessible and engaging to non-programmers who were interested in learning about AAD.

TapeScript and QuantLibAdjoint are OSI certified open source and will always remain free for commercial use. Download from github.com/compatibl and quantlib.org.

More information at WBS

Conference Presentation Day One: Three Prices of Three Risks: A Real World Measure IR-FX Hybrid Model

A brief summary of the conducted presentation:

  • For large multi-currency portfolios, the evolution of FX rate is frequently the primary risk driver
  • At the long time horizons of interest in limit and certain capital calculations, the FX rate must be modelled jointly with the interest rates
  • The real world drift of the FX rate is determined by market prices of the two interest rate risks, and the idiosyncratic risk of the FX rate.
  • Somewhat counterintuitively, at long time horizons it is the market price of the two IR risks what makes the biggest impact on the real world FX drift.
  • Using Hull-Sokol-White calibration of the market price of risk in IR, we calibrate the real world model of long dated FX.
  • The model is shown to be consistent with a wide range of historical data on FX

The full presentation can be downloaded here.

Conference Presentation Day Two: Open Source implementation of AAD in QuantLib with Tape Compression

A summary of the main points of the presentation:

  • QuantLib is a popular open source library for quant finance
  • Serendipitously, the architects of QuantLib decided to use Real instead of double in all quant math code
  • Real (originally a macro) can be replaced by an inline user define type which wraps the AAD variable
  • This approach permits integration of an operator overloading based AAD framework into QuantLib with minimal changes to QuantLib code
  • Performance and accuracy of greeks in QuantLib with CppAD backend is tested on examples from QuantLib Test Suite
  • We show that further performance improvement can be achieved by tape compression for array and matrix operations
  • An open source, backend-agnostic tape packing and compression format (TapeScript) is proposed.

The presentation can be found here.