QuantLib-Risks 1.33.1__cp312-cp312-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- QuantLib_Risks/QuantLib_Risks.exp +0 -0
- QuantLib_Risks/QuantLib_Risks.lib +0 -0
- QuantLib_Risks/QuantLib_Risks.py +35966 -0
- QuantLib_Risks/_QuantLib_Risks.cp312-win_amd64.pyd +4 -0
- QuantLib_Risks/__init__.py +63 -0
- quantlib_risks-1.33.1.dist-info/METADATA +75 -0
- quantlib_risks-1.33.1.dist-info/RECORD +8 -0
- quantlib_risks-1.33.1.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# -*- coding: iso-8859-1 -*-
|
|
2
|
+
"""
|
|
3
|
+
Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl
|
|
4
|
+
Copyright (C) 2024 Xcelerit Computing Limited.
|
|
5
|
+
|
|
6
|
+
This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled
|
|
7
|
+
for risk computation using automatic differentiation. It uses XAD,
|
|
8
|
+
a fast and comprehensive C++ library for automatic differentiation.
|
|
9
|
+
|
|
10
|
+
QuantLib-Risks and XAD are free software: you can redistribute it and/or modify
|
|
11
|
+
it under the terms of the GNU Affero General Public License as published
|
|
12
|
+
by the Free Software Foundation, either version 3 of the License, or
|
|
13
|
+
(at your option) any later version.
|
|
14
|
+
|
|
15
|
+
QuantLib-Risks is distributed in the hope that it will be useful,
|
|
16
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
17
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
18
|
+
GNU Affero General Public License for more details.
|
|
19
|
+
|
|
20
|
+
You should have received a copy of the GNU Affero General Public License
|
|
21
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
22
|
+
|
|
23
|
+
QuantLib is free software: you can redistribute it and/or modify it
|
|
24
|
+
under the terms of the QuantLib license. You should have received a
|
|
25
|
+
copy of the license along with this program; if not, please email
|
|
26
|
+
<quantlib-dev@lists.sf.net>. The license is also available online at
|
|
27
|
+
<http://quantlib.org/license.shtml>.
|
|
28
|
+
|
|
29
|
+
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
30
|
+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
31
|
+
FOR A PARTICULAR PURPOSE. See the license for more details.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
from .QuantLib_Risks import *
|
|
35
|
+
|
|
36
|
+
if XAD_ENABLED:
|
|
37
|
+
from xad_autodiff.adj_1st import Real
|
|
38
|
+
from typing import Union, Tuple, List
|
|
39
|
+
|
|
40
|
+
# as part of the input at the top, we'll have _QuantLib_Risks in scope
|
|
41
|
+
DoubleVector = _QuantLib_Risks.DoubleVector
|
|
42
|
+
DoublePairVector = _QuantLib_Risks.DoublePairVector
|
|
43
|
+
DoubleVectorVector = _QuantLib_Risks.DoubleVectorVector
|
|
44
|
+
|
|
45
|
+
def Concentrating1dMesherPoint(x1: Union[Real, float, int], x2: Union[Real, float, int], v: bool) -> Tuple[Real, Real, bool]:
|
|
46
|
+
return (Real(x1), Real(x2), bool(v))
|
|
47
|
+
|
|
48
|
+
def PairDoubleVector(x1: List[Union[Real, float, int]] = [], x2: List[Union[Real, float, int]] = []) -> Tuple[List[Real], List[Real]]:
|
|
49
|
+
return ([Real(x) for x in x1], [Real(x) for x in x2])
|
|
50
|
+
|
|
51
|
+
if hasattr(_QuantLib_Risks,'__version__'):
|
|
52
|
+
__version__ = _QuantLib_Risks.__version__
|
|
53
|
+
elif hasattr(_QuantLib_Risks.cvar,'__version__'):
|
|
54
|
+
__version__ = _QuantLib_Risks.cvar.__version__
|
|
55
|
+
else:
|
|
56
|
+
print('Could not find __version__ attribute')
|
|
57
|
+
|
|
58
|
+
if hasattr(_QuantLib_Risks,'__hexversion__'):
|
|
59
|
+
__hexversion__ = _QuantLib_Risks.__hexversion__
|
|
60
|
+
elif hasattr(_QuantLib_Risks.cvar,'__hexversion__'):
|
|
61
|
+
__hexversion__ = _QuantLib_Risks.cvar.__hexversion__
|
|
62
|
+
else:
|
|
63
|
+
print('Could not find __hexversion__ attribute')
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: QuantLib-Risks
|
|
3
|
+
Version: 1.33.1
|
|
4
|
+
Summary: Fast risks calculations in QuantLib
|
|
5
|
+
Home-page: https://auto-differentiation.github.io
|
|
6
|
+
License: AGPL-3.0-or-later
|
|
7
|
+
Keywords: automatic-differentiation,derivatives,risk-management,quant-finance,greeks,risks
|
|
8
|
+
Author: Auto Differentiation Dev Team
|
|
9
|
+
Author-email: dev@auto-differentiation.com
|
|
10
|
+
Requires-Python: >=3.8.1,<4.0
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Education
|
|
14
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
15
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
16
|
+
Classifier: Intended Audience :: Science/Research
|
|
17
|
+
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
|
|
18
|
+
Classifier: License :: Other/Proprietary License
|
|
19
|
+
Classifier: Natural Language :: English
|
|
20
|
+
Classifier: Operating System :: MacOS :: MacOS X
|
|
21
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
22
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
23
|
+
Classifier: Programming Language :: Python :: 3
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
27
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
28
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
29
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
30
|
+
Classifier: Topic :: Scientific/Engineering
|
|
31
|
+
Classifier: Topic :: Software Development
|
|
32
|
+
Requires-Dist: xad-autodiff
|
|
33
|
+
Project-URL: Documentation, https://auto-differentiation.github.io/quantlib
|
|
34
|
+
Project-URL: Repository, https://github.com/auto-differentiation/XAD
|
|
35
|
+
Project-URL: download, https://pypi.org/project/QuantLib-Risks/#files
|
|
36
|
+
Project-URL: tracker, https://github.com/auto-differentiation/XAD/issues
|
|
37
|
+
Description-Content-Type: text/markdown
|
|
38
|
+
|
|
39
|
+
This package enables fast risks calculations on the QuantLib Python package.
|
|
40
|
+
It provides the same interface as the [standard QuantLib package](https://pypi.org/project/QuantLib/), and in addition allows to calculate risks (sensitivities) using automatic differentiation via the [XAD automatic differentiation tool](https://auto-differentation.github.io).
|
|
41
|
+
|
|
42
|
+
Useful links:
|
|
43
|
+
|
|
44
|
+
- [QuantLib Documentation](https://www.quantlib.org)
|
|
45
|
+
- [XAD Documentation, incl Python bindings and QuantLib integration](https://auto-differentiation.github.io)
|
|
46
|
+
|
|
47
|
+
## Installation
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
pip install QuantLib-Risks
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Usage Illustration
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
import QuantLib_Risks as ql
|
|
57
|
+
from xad_autodiff.adj_1st import Tape
|
|
58
|
+
|
|
59
|
+
with Tape() as t:
|
|
60
|
+
rate = ql.Real(0.2)
|
|
61
|
+
tape.registerInput(rate)
|
|
62
|
+
|
|
63
|
+
# quantlib pricing code
|
|
64
|
+
...
|
|
65
|
+
npv = option.NPV()
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
tape.registerOutput(npv)
|
|
69
|
+
npv.derivative = 1.0
|
|
70
|
+
tape.computeAdjoints()
|
|
71
|
+
|
|
72
|
+
print(f"price = {npv}")
|
|
73
|
+
print(f"delta = {rate.derivative}")
|
|
74
|
+
```
|
|
75
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
QuantLib_Risks/__init__.py,sha256=ljmO033713TKfPBJXDKIgslDRETjbC_AmZqv0nxdsQk,2868
|
|
2
|
+
QuantLib_Risks/_QuantLib_Risks.cp312-win_amd64.pyd,sha256=yddeHtveWLHp65I6wXQWUEFb-N5w1SHglnqqvzhPSSM,44336640
|
|
3
|
+
QuantLib_Risks/QuantLib_Risks.exp,sha256=8FWBdHVYrqZ4bwbBt124HcsZ3AU3RtCe4NBCIW-osb8,779
|
|
4
|
+
QuantLib_Risks/QuantLib_Risks.lib,sha256=3zYcOSRVVcGTAP3-m_3s77EDC_G0i6OF6lRcG15st4o,2156
|
|
5
|
+
QuantLib_Risks/QuantLib_Risks.py,sha256=6QsoLn2jS2mykYxgn0ZA4lkO6TPDvxhdN2Qs64ndAwc,1918705
|
|
6
|
+
quantlib_risks-1.33.1.dist-info/METADATA,sha256=uAx6IeXoCPa3lTYkvTA9ikj-jcuKlPrt5uZnwPLpSWk,2830
|
|
7
|
+
quantlib_risks-1.33.1.dist-info/WHEEL,sha256=4N0hGcnWMI_Ty6ATf4qJqqSl-UNI-Ln828iTWGIywmU,98
|
|
8
|
+
quantlib_risks-1.33.1.dist-info/RECORD,,
|