Do Geometric Brownian Motion or a SABR model sound familiar? Here’s an interested library:
From the repository:
This library provides high-performance components leveraging the hardware acceleration support and automatic differentiation of TensorFlow. The library will provide TensorFlow support for foundational mathematical methods, mid-level methods, and specific pricing models. The coverage is being expanded over the next few months.
The library is structured along three tiers:
- Foundational methods. Core mathematical methods - optimisation, interpolation, root finders, linear algebra, random and quasi-random number generation, etc.
- Mid-level methods. ODE & PDE solvers, Ito process framework, Diffusion Path Generators, Copula samplers etc.
- Pricing methods and other quant finance specific utilities. Specific Pricing models (e.g., Local Vol (LV), Stochastic Vol (SV), Stochastic Local Vol (SLV), Hull-White (HW)) and their calibration. Rate curve building, payoff descriptions, and schedule generation.
…
If you are not familiar with TensorFlow, an excellent place to get started is with the following self-study introduction to TensorFlow notebooks:
- Introduction to TensorFlow Part 1 - Basics.
- Introduction to TensorFlow Part 2 - Debugging and Control Flow.
- Introduction to TensorFlow Part 3 - Advanced Tensor Manipulation.
Development roadmap
We are working on expanding the coverage of the library. Areas under active development are:
- Ito Processes: Framework for defining Ito processes. Includes methods for sampling paths from a process and for solving the associated backward Kolmogorov equation.
- Implementation of the following specific processes/models:
- Brownian Motion
- Geometric Brownian Motion
- Ornstein-Uhlenbeck
- One-Factor Hull-White model
- Heston model
- Local volatility model.
- Quadratic Local Vol model.
- SABR model
- Copulas: Support for defining and sampling from copulas.
- Model Calibration:
- Dupire local vol calibration.
- SABR model calibration.
- Rate curve fitting: Hagan-West algorithm for yield curve bootstrapping and the Monotone Convex interpolation scheme.
- Support for dates, day-count conventions, holidays, etc.
Examples
See
tf_quant_finance/examples/
for end-to-end examples. It includes tutorial notebooks such as:
- American Option pricing under the Black-Scholes model
- Monte Carlo via Euler Scheme
- Black Scholes: Price and Implied Vol
- Forward and Backward mode gradients in TFF
- Root search using Brent’s method
- Optimization
- Swap Curve Fitting
- Vectorization and XLA compilation
The above links will open Jupyter Notebooks in Colab.
…
Community
- GitHub repository: Report bugs or make feature requests.
- TensorFlow Blog: Stay up to date on content from the TensorFlow team and best articles from the community.
- tf-quant-finance@googlegroups.com: Open mailing list for discussion and questions of this library.
- TensorFlow Probability: This library will leverage methods from TensorFlow Probability (TFP).
More info: