From 83666005f6de09bc91f9c5fc7da2f7fc5509f3cc Mon Sep 17 00:00:00 2001 From: Auto Differentiation Dev Team <107129969+auto-differentiation-dev@users.noreply.github.com> Date: Tue, 26 Mar 2024 09:57:07 +0000 Subject: [PATCH 1/4] updated naming of QuantLib-Risks --- docs/quantlib/python.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/quantlib/python.md b/docs/quantlib/python.md index 91b2282b..b2b208b7 100644 --- a/docs/quantlib/python.md +++ b/docs/quantlib/python.md @@ -1,14 +1,14 @@ --- description: >- - quantlib-risks enables high performance risk evaluations with QuantLib Python bindings + QuantLib-Risks enables high performance risk evaluations with QuantLib Python bindings using XAD automatic differentiation. --- -# Python QuantLib Integration: quantlib-risks +# Python QuantLib Integration: QuantLib-Risks -The Python package [quantlib-risks](https://pypi.org/project/quantlib-risks), a fork of the QuantLib Python bindings, is now available on PyPI. This version integrates automatic differentiation capabilities through its dependency on [XAD's Python bindings](../python.md). This integration significantly boosts the efficiency of performing high-performance risk assessments within QuantLib from Python. +The Python package [QuantLib-Risks](https://pypi.org/project/QuantLib-Risks), a fork of the QuantLib Python bindings, is now available on PyPI. This version integrates automatic differentiation capabilities through its dependency on [XAD's Python bindings](../python.md). This integration significantly boosts the efficiency of performing high-performance risk assessments within QuantLib from Python. -The key advantage brought by quantlib-risks is its ability to expediently ascertain how the pricing of derivatives is influenced by various input variables, notably market quotes. +The key advantage brought by QuantLib-Risks is its ability to expediently ascertain how the pricing of derivatives is influenced by various input variables, notably market quotes. The user interface mimics the official [QuantLib Python package](https://pypi.org/project/QuantLib), with the addition of replacing it's `Real` type with `xad-autodiff.adj_1st.Real`, which can be tracked on an adjoint automatic differentiation tape and derivatives can be calculated [xad-autodiff](../python.md). @@ -16,20 +16,20 @@ can be calculated [xad-autodiff](../python.md). ## Performance -To gauge the performance impact of calculating sensitivities, we leverage the [multi-curve bootstrapping example](https://github.com/auto-differentiation/quantlib-risks/blob/v1.33/Python/examples/multicurve-bootstrapping.py). This setup incorporates a wide array of quotes to construct a term structure for swap pricing. It prices a forward-starting 5-year swap, set to commence 15 months into the future, with a calculation of 69 sensitivities covering all market quotes used in curve construction and select swap parameters like nominal, fixed rate, and spread. +To gauge the performance impact of calculating sensitivities, we leverage the [multi-curve bootstrapping example](https://github.com/auto-differentiation/QuantLib-Risks/blob/v1.33/Python/examples/multicurve-bootstrapping.py). This setup incorporates a wide array of quotes to construct a term structure for swap pricing. It prices a forward-starting 5-year swap, set to commence 15 months into the future, with a calculation of 69 sensitivities covering all market quotes used in curve construction and select swap parameters like nominal, fixed rate, and spread. -Performance metrics are drawn from averaging execution times over 20 runs for stability. Initial benchmarks using the standard QuantLib package clock in at 198ms for pricing alone. Switching to `quantlib-risks` for simultaneous pricing and sensitivity analysis results in an execution time of 370ms, demonstrating that *all sensitivities can be obtained within approximately 1.87x of the original pricing time*. +Performance metrics are drawn from averaging execution times over 20 runs for stability. Initial benchmarks using the standard QuantLib package clock in at 198ms for pricing alone. Switching to `QuantLib-Risks` for simultaneous pricing and sensitivity analysis results in an execution time of 370ms, demonstrating that *all sensitivities can be obtained within approximately 1.87x of the original pricing time*. -Comparatively, a traditional bump-and-reval approach for sensitivities would necessitate 70 pricer code executions (one for valuation and one for each variable bump), translating to 70x the pure pricing time. *Thus, `quantlib-risks` achieves a 37.4x speed advantage over bump and reval*. +Comparatively, a traditional bump-and-reval approach for sensitivities would necessitate 70 pricer code executions (one for valuation and one for each variable bump), translating to 70x the pure pricing time. *Thus, `QuantLib-Risks` achieves a 37.4x speed advantage over bump and reval*. Summary of performance benchmarks: -| Sensitivities | Valuation (QuantLib) | AAD (quantlib-risks) | Bumping (estimate) | AAD vs Valuation | Bumping vs AAD | +| Sensitivities | Valuation (QuantLib) | AAD (QuantLib-Risks) | Bumping (estimate) | AAD vs Valuation | Bumping vs AAD | |---:|---:|---:|---:|---:|---:| | 69 | 198ms | 370ms | 13,860ms | 1.87x | 37.4x | Benchmark configuration details include: -- `QuantLib` and `quantlib-risks` version: 1.33 +- `QuantLib` and `QuantLib-Risks` version: 1.33 - `xad-autodiff` version: 1.5.0 - Operating on Ubuntu 22.04 with GCC 11.4.0 - Hardware specs include 128GB RAM and an Intel(R) Xeon(R) W-2295 CPU @ 3.00GHz. @@ -38,13 +38,13 @@ Benchmark configuration details include: ## Installation ``` -pip install quantlib-risks +pip install QuantLib-Risks ``` ## Usage Illustration ```python -import quantlib_risks as ql +import QuantLib_Risks as ql from xad_autodiff.adj_1st import Tape with Tape() as t: From 6c0433263e3356847a4cc830517fe0ce71eeaed6 Mon Sep 17 00:00:00 2001 From: Auto Differentiation Dev Team <107129969+auto-differentiation-dev@users.noreply.github.com> Date: Tue, 26 Mar 2024 14:59:16 +0000 Subject: [PATCH 2/4] Update version number for benchmark config --- docs/quantlib/python.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/quantlib/python.md b/docs/quantlib/python.md index b2b208b7..8e0ed211 100644 --- a/docs/quantlib/python.md +++ b/docs/quantlib/python.md @@ -29,7 +29,8 @@ Summary of performance benchmarks: | 69 | 198ms | 370ms | 13,860ms | 1.87x | 37.4x | Benchmark configuration details include: -- `QuantLib` and `QuantLib-Risks` version: 1.33 +- `QuantLib` version: 1.33 +- `QuantLib-Risks` version: 1.33.1 - `xad-autodiff` version: 1.5.0 - Operating on Ubuntu 22.04 with GCC 11.4.0 - Hardware specs include 128GB RAM and an Intel(R) Xeon(R) W-2295 CPU @ 3.00GHz. From eec277f73c1a253909bbfd6310f3f0baa865025e Mon Sep 17 00:00:00 2001 From: Auto Differentiation Dev Team <107129969+auto-differentiation-dev@users.noreply.github.com> Date: Thu, 28 Mar 2024 16:43:42 +0000 Subject: [PATCH 3/4] Version numbers update --- docs/quantlib/python.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/quantlib/python.md b/docs/quantlib/python.md index 8e0ed211..96de530d 100644 --- a/docs/quantlib/python.md +++ b/docs/quantlib/python.md @@ -16,7 +16,7 @@ can be calculated [xad-autodiff](../python.md). ## Performance -To gauge the performance impact of calculating sensitivities, we leverage the [multi-curve bootstrapping example](https://github.com/auto-differentiation/QuantLib-Risks/blob/v1.33/Python/examples/multicurve-bootstrapping.py). This setup incorporates a wide array of quotes to construct a term structure for swap pricing. It prices a forward-starting 5-year swap, set to commence 15 months into the future, with a calculation of 69 sensitivities covering all market quotes used in curve construction and select swap parameters like nominal, fixed rate, and spread. +To gauge the performance impact of calculating sensitivities, we leverage the [multi-curve bootstrapping example](https://github.com/auto-differentiation/QuantLib-Risks/blob/master/Python/examples/multicurve-bootstrapping.py). This setup incorporates a wide array of quotes to construct a term structure for swap pricing. It prices a forward-starting 5-year swap, set to commence 15 months into the future, with a calculation of 69 sensitivities covering all market quotes used in curve construction and select swap parameters like nominal, fixed rate, and spread. Performance metrics are drawn from averaging execution times over 20 runs for stability. Initial benchmarks using the standard QuantLib package clock in at 198ms for pricing alone. Switching to `QuantLib-Risks` for simultaneous pricing and sensitivity analysis results in an execution time of 370ms, demonstrating that *all sensitivities can be obtained within approximately 1.87x of the original pricing time*. @@ -30,8 +30,8 @@ Summary of performance benchmarks: Benchmark configuration details include: - `QuantLib` version: 1.33 -- `QuantLib-Risks` version: 1.33.1 -- `xad-autodiff` version: 1.5.0 +- `QuantLib-Risks` version: 1.33.2 +- `xad-autodiff` version: 1.5.1 - Operating on Ubuntu 22.04 with GCC 11.4.0 - Hardware specs include 128GB RAM and an Intel(R) Xeon(R) W-2295 CPU @ 3.00GHz. From 334742ee2ce9d4dd22afc887f8bc0b0ec52dfae3 Mon Sep 17 00:00:00 2001 From: Auto Differentiation Dev Team <107129969+auto-differentiation-dev@users.noreply.github.com> Date: Thu, 28 Mar 2024 17:32:23 +0000 Subject: [PATCH 4/4] Fixes branch naming - master -> main --- docs/quantlib/python.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/quantlib/python.md b/docs/quantlib/python.md index 96de530d..1c090578 100644 --- a/docs/quantlib/python.md +++ b/docs/quantlib/python.md @@ -16,7 +16,7 @@ can be calculated [xad-autodiff](../python.md). ## Performance -To gauge the performance impact of calculating sensitivities, we leverage the [multi-curve bootstrapping example](https://github.com/auto-differentiation/QuantLib-Risks/blob/master/Python/examples/multicurve-bootstrapping.py). This setup incorporates a wide array of quotes to construct a term structure for swap pricing. It prices a forward-starting 5-year swap, set to commence 15 months into the future, with a calculation of 69 sensitivities covering all market quotes used in curve construction and select swap parameters like nominal, fixed rate, and spread. +To gauge the performance impact of calculating sensitivities, we leverage the [multi-curve bootstrapping example](https://github.com/auto-differentiation/QuantLib-Risks/blob/main/Python/examples/multicurve-bootstrapping.py). This setup incorporates a wide array of quotes to construct a term structure for swap pricing. It prices a forward-starting 5-year swap, set to commence 15 months into the future, with a calculation of 69 sensitivities covering all market quotes used in curve construction and select swap parameters like nominal, fixed rate, and spread. Performance metrics are drawn from averaging execution times over 20 runs for stability. Initial benchmarks using the standard QuantLib package clock in at 198ms for pricing alone. Switching to `QuantLib-Risks` for simultaneous pricing and sensitivity analysis results in an execution time of 370ms, demonstrating that *all sensitivities can be obtained within approximately 1.87x of the original pricing time*.