stochvolmodels 1.0.23__tar.gz → 1.0.24__tar.gz

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.
Files changed (49) hide show
  1. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/PKG-INFO +2 -3
  2. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/pyproject.toml +1 -1
  3. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/pricers/gmm_pricer.py +2 -2
  4. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/pricers/model_pricer.py +3 -4
  5. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/pricers/tdist_pricer.py +2 -2
  6. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/utils/plots.py +8 -1
  7. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/LICENSE.txt +0 -0
  8. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/README.md +0 -0
  9. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/__init__.py +0 -0
  10. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/data/__init__.py +0 -0
  11. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/data/fetch_option_chain.py +0 -0
  12. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/data/option_chain.py +0 -0
  13. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/data/test_option_chain.py +0 -0
  14. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/examples/quick_run_lognormal_sv_pricer.py +0 -0
  15. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/examples/run_gmm_fit.py +0 -0
  16. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/examples/run_heston.py +0 -0
  17. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/examples/run_heston_sv_pricer.py +0 -0
  18. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/examples/run_lognormal_sv_pricer.py +0 -0
  19. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/examples/run_pricing_options_on_qvar.py +0 -0
  20. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/pricers/__init__.py +0 -0
  21. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/pricers/analytic/__init__.py +0 -0
  22. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/pricers/analytic/bachelier.py +0 -0
  23. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/pricers/analytic/bsm.py +0 -0
  24. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/pricers/analytic/tdist.py +0 -0
  25. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/pricers/factor_hjm/double_exp_pricer.py +0 -0
  26. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/pricers/factor_hjm/factor_hjm_pricer.py +0 -0
  27. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/pricers/factor_hjm/rate_affine_expansion.py +0 -0
  28. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/pricers/factor_hjm/rate_core.py +0 -0
  29. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/pricers/factor_hjm/rate_evaluate.py +0 -0
  30. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/pricers/factor_hjm/rate_factor_basis.py +0 -0
  31. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/pricers/factor_hjm/rate_logsv_ivols.py +0 -0
  32. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/pricers/factor_hjm/rate_logsv_params.py +0 -0
  33. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/pricers/factor_hjm/rate_logsv_pricer.py +0 -0
  34. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/pricers/hawkes_jd_pricer.py +0 -0
  35. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/pricers/heston_pricer.py +0 -0
  36. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/pricers/logsv/__init__.py +0 -0
  37. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/pricers/logsv/affine_expansion.py +0 -0
  38. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/pricers/logsv/logsv_params.py +0 -0
  39. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/pricers/logsv/vol_moments_ode.py +0 -0
  40. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/pricers/logsv_pricer.py +0 -0
  41. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/tests/__init__.py +0 -0
  42. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/tests/bsm_mgf_pricer.py +0 -0
  43. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/tests/qv_pricer.py +0 -0
  44. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/utils/__init__.py +0 -0
  45. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/utils/config.py +0 -0
  46. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/utils/funcs.py +0 -0
  47. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/utils/mc_payoffs.py +0 -0
  48. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/utils/mgf_pricer.py +0 -0
  49. {stochvolmodels-1.0.23 → stochvolmodels-1.0.24}/stochvolmodels/utils/var_swap_pricer.py +0 -0
@@ -1,8 +1,7 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: stochvolmodels
3
- Version: 1.0.23
3
+ Version: 1.0.24
4
4
  Summary: Implementation of stochastic volatility models for option pricing
5
- Home-page: https://github.com/ArturSepp/StochVolModels
6
5
  License: LICENSE.txt
7
6
  Keywords: volatility,options,Black-Scholes,Heston,Monte-Carlo
8
7
  Author: Artur Sepp
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "stochvolmodels"
3
- version = "1.0.23"
3
+ version = "1.0.24"
4
4
  description = "Implementation of stochastic volatility models for option pricing"
5
5
  license = "LICENSE.txt"
6
6
  authors = ["Artur Sepp <artursepp@gmail.com>"]
@@ -320,7 +320,7 @@ class UnitTests(Enum):
320
320
  def run_unit_test(unit_test: UnitTests):
321
321
 
322
322
  import seaborn as sns
323
- import qis as qis
323
+ from stochvolmodels.utils import plots as plot
324
324
  from stochvolmodels.data.test_option_chain import get_btc_test_chain_data
325
325
 
326
326
  if unit_test == UnitTests.CALIBRATOR:
@@ -330,7 +330,7 @@ def run_unit_test(unit_test: UnitTests):
330
330
 
331
331
  with sns.axes_style('darkgrid'):
332
332
  fig, axs = plt.subplots(2, 2, figsize=(14, 12), tight_layout=True)
333
- axs = qis.to_flat_list(axs)
333
+ axs = plot.to_flat_list(axs)
334
334
 
335
335
  for idx, (key, params) in enumerate(fit_params.items()):
336
336
  print(f"{key}: {params}")
@@ -19,7 +19,6 @@ from abc import ABC, abstractmethod
19
19
  from scipy import stats
20
20
  from dataclasses import dataclass, asdict
21
21
  from typing import Tuple, Optional, Dict
22
- import qis as qis
23
22
 
24
23
  from stochvolmodels.utils.config import VariableType
25
24
  from stochvolmodels.data.option_chain import OptionChain, OptionSlice
@@ -346,7 +345,7 @@ class ModelPricer(ABC):
346
345
  fig, axs = plt.subplots(1, 3, figsize=figsize, tight_layout=True)
347
346
  elif num_slices == 4:
348
347
  fig, axs = plt.subplots(2, 2, figsize=figsize, tight_layout=True)
349
- axs = qis.to_flat_list(axs)
348
+ axs = plot.to_flat_list(axs)
350
349
  else:
351
350
  raise NotImplementedError
352
351
  else:
@@ -425,7 +424,7 @@ class ModelPricer(ABC):
425
424
  fig, axs = plt.subplots(1, 3, figsize=figsize, tight_layout=True)
426
425
  elif num_slices == 4:
427
426
  fig, axs = plt.subplots(2, 2, figsize=figsize, tight_layout=True)
428
- axs = qis.to_flat_list(axs)
427
+ axs = plot.to_flat_list(axs)
429
428
  else:
430
429
  raise NotImplementedError
431
430
 
@@ -521,7 +520,7 @@ class ModelPricer(ABC):
521
520
  fig, axs = plt.subplots(1, 3, figsize=figsize, tight_layout=True)
522
521
  elif num_slices == 4:
523
522
  fig, axs = plt.subplots(2, 2, figsize=figsize, tight_layout=True)
524
- axs = qis.to_flat_list(axs)
523
+ axs = plot.to_flat_list(axs)
525
524
  else:
526
525
  raise NotImplementedError
527
526
 
@@ -168,7 +168,7 @@ class UnitTests(Enum):
168
168
  def run_unit_test(unit_test: UnitTests):
169
169
 
170
170
  import seaborn as sns
171
- import qis as qis
171
+ from stochvolmodels.utils import plots as plot
172
172
  import stochvolmodels.data.test_option_chain as chains
173
173
 
174
174
  if unit_test == UnitTests.CALIBRATOR:
@@ -181,7 +181,7 @@ def run_unit_test(unit_test: UnitTests):
181
181
 
182
182
  with sns.axes_style('darkgrid'):
183
183
  fig, axs = plt.subplots(2, 2, figsize=(14, 12), tight_layout=True)
184
- axs = qis.to_flat_list(axs)
184
+ axs = plot.to_flat_list(axs)
185
185
 
186
186
  for idx, (key, params) in enumerate(fit_params.items()):
187
187
  print(f"{key}: {params}")
@@ -447,4 +447,11 @@ def align_y_limits_axs(axs: List[plt.Subplot],
447
447
  if is_invisible_ys:
448
448
  for idx, ax in enumerate(axs):
449
449
  if idx > 0:
450
- ax.axes.get_yaxis().set_visible(False)
450
+ ax.axes.get_yaxis().set_visible(False)
451
+
452
+ def to_flat_list(items: Iterable) -> List[Any]:
453
+ if isinstance(items, Iterable):
454
+ flat_list = [item for item in flatten(items)]
455
+ else:
456
+ flat_list = [items]
457
+ return flat_list