stochvolmodels 1.1.3__tar.gz → 1.1.4__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 (93) hide show
  1. {stochvolmodels-1.1.3/stochvolmodels.egg-info → stochvolmodels-1.1.4}/PKG-INFO +1 -1
  2. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/pyproject.toml +1 -1
  3. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/examples/run_lognormal_sv_pricer.py +4 -5
  4. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/logsv/logsv_params.py +8 -8
  5. stochvolmodels-1.1.4/stochvolmodels/pricers/rough_logsv/test_kernel_approx.py +15 -0
  6. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4/stochvolmodels.egg-info}/PKG-INFO +1 -1
  7. stochvolmodels-1.1.3/stochvolmodels/pricers/rough_logsv/test_kernel_approx.py +0 -16
  8. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/.gitignore +0 -0
  9. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/LICENSE.txt +0 -0
  10. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/MANIFEST.in +0 -0
  11. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/README.md +0 -0
  12. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/forward_var/calibrate_forward_var.py +0 -0
  13. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/il_hedging/README.md +0 -0
  14. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/il_hedging/logsv_figures.py +0 -0
  15. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/il_hedging/run_logsv_for_il_payoff.py +0 -0
  16. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/inverse_options/README.md +0 -0
  17. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/inverse_options/compare_net_delta.py +0 -0
  18. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/logsv_model_wtih_quadratic_drift/README.md +0 -0
  19. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/logsv_model_wtih_quadratic_drift/article_figures.py +0 -0
  20. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/logsv_model_wtih_quadratic_drift/calibrations.py +0 -0
  21. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/logsv_model_wtih_quadratic_drift/compare_admis_reg.py +0 -0
  22. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/logsv_model_wtih_quadratic_drift/model_fit_to_options_timeseries.py +0 -0
  23. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/logsv_model_wtih_quadratic_drift/moments_vol_qvar.py +0 -0
  24. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/logsv_model_wtih_quadratic_drift/ode_sol_in_time.py +0 -0
  25. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/logsv_model_wtih_quadratic_drift/steady_state_pdf.py +0 -0
  26. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/logsv_model_wtih_quadratic_drift/vol_drift.py +0 -0
  27. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/risk_premia_gmm/check_kernel.py +0 -0
  28. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/risk_premia_gmm/gmm_slides.py +0 -0
  29. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/risk_premia_gmm/plot_gmm.py +0 -0
  30. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/risk_premia_gmm/q_kernel.py +0 -0
  31. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/risk_premia_gmm/run_gmm_fit.py +0 -0
  32. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/sv_for_factor_hjm/README.md +0 -0
  33. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/sv_for_factor_hjm/calibration_fig_5_6_7.py +0 -0
  34. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/sv_for_factor_hjm/calibration_fig_8_9.py +0 -0
  35. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/t_distribution/illustrations.py +0 -0
  36. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/t_distribution/market_data_fit.py +0 -0
  37. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/t_distribution/mc_pricer_with_kernel.py +0 -0
  38. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/volatility_models/README.md +0 -0
  39. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/volatility_models/article_figures.py +0 -0
  40. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/volatility_models/autocorr_fit.py +0 -0
  41. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/volatility_models/load_data.py +0 -0
  42. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/volatility_models/ss_distribution_fit.py +0 -0
  43. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/my_papers/volatility_models/vol_beta.py +0 -0
  44. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/requirements.txt +0 -0
  45. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/setup.cfg +0 -0
  46. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/__init__.py +0 -0
  47. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/data/__init__.py +0 -0
  48. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/data/fetch_option_chain.py +0 -0
  49. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/data/option_chain.py +0 -0
  50. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/data/test_option_chain.py +0 -0
  51. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/examples/quick_run_lognormal_sv_pricer.py +0 -0
  52. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/examples/run_heston.py +0 -0
  53. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/examples/run_heston_sv_pricer.py +0 -0
  54. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/examples/run_pricing_options_on_qvar.py +0 -0
  55. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/__init__.py +0 -0
  56. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/analytic/__init__.py +0 -0
  57. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/analytic/bachelier.py +0 -0
  58. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/analytic/bsm.py +0 -0
  59. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/analytic/tdist.py +0 -0
  60. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/factor_hjm/double_exp_pricer.py +0 -0
  61. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/factor_hjm/factor_hjm_pricer.py +0 -0
  62. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/factor_hjm/rate_affine_expansion.py +0 -0
  63. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/factor_hjm/rate_core.py +0 -0
  64. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/factor_hjm/rate_evaluate.py +0 -0
  65. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/factor_hjm/rate_factor_basis.py +0 -0
  66. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/factor_hjm/rate_logsv_ivols.py +0 -0
  67. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/factor_hjm/rate_logsv_params.py +0 -0
  68. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/factor_hjm/rate_logsv_pricer.py +0 -0
  69. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/gmm_pricer.py +0 -0
  70. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/hawkes_jd_pricer.py +0 -0
  71. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/heston_pricer.py +0 -0
  72. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/logsv/__init__.py +0 -0
  73. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/logsv/affine_expansion.py +0 -0
  74. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/logsv/vol_moments_ode.py +0 -0
  75. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/logsv_pricer.py +0 -0
  76. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/model_pricer.py +0 -0
  77. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/rough_logsv/RoughKernel.py +0 -0
  78. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/rough_logsv/split_simulation.py +0 -0
  79. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/pricers/tdist_pricer.py +0 -0
  80. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/tests/__init__.py +0 -0
  81. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/tests/bsm_mgf_pricer.py +0 -0
  82. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/tests/qv_pricer.py +0 -0
  83. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/utils/__init__.py +0 -0
  84. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/utils/config.py +0 -0
  85. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/utils/funcs.py +0 -0
  86. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/utils/mc_payoffs.py +0 -0
  87. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/utils/mgf_pricer.py +0 -0
  88. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/utils/plots.py +0 -0
  89. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels/utils/var_swap_pricer.py +0 -0
  90. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels.egg-info/SOURCES.txt +0 -0
  91. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels.egg-info/dependency_links.txt +0 -0
  92. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels.egg-info/requires.txt +0 -0
  93. {stochvolmodels-1.1.3 → stochvolmodels-1.1.4}/stochvolmodels.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stochvolmodels
3
- Version: 1.1.3
3
+ Version: 1.1.4
4
4
  Summary: Python implementation of pricing analytics and Monte Carlo simulations for stochastic volatility models including log-normal SV model, Heston
5
5
  Author-email: Artur Sepp <artursepp@gmail.com>
6
6
  Maintainer-email: Artur Sepp <artursepp@gmail.com>, Parviz Rakhmonov <ParvizRZ@gmail.com>
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
7
7
 
8
8
  [project]
9
9
  name = "stochvolmodels"
10
- version = "1.1.3"
10
+ version = "1.1.4"
11
11
  description = "Python implementation of pricing analytics and Monte Carlo simulations for stochastic volatility models including log-normal SV model, Heston"
12
12
  readme = "README.md"
13
13
  license = {file = "LICENSE.txt"}
@@ -144,7 +144,7 @@ def run_local_test(local_test: LocalTests):
144
144
  seed=10)
145
145
  params0 = LogSvParams(sigma0=0.8, theta=1.0, kappa1=2.21, kappa2=0.0, beta=0.15, volvol=2.0)
146
146
  params0.H = 0.3
147
- params0.approximate_kernel(T=btc_option_chain.ttms[-1], N=3)
147
+ params0.approximate_kernel(T=btc_option_chain.ttms[-1])
148
148
 
149
149
  option_prices_ttm, option_std_ttm = sv.rough_logsv_mc_chain_pricer_fixed_randoms(ttms=btc_option_chain.ttms,
150
150
  forwards=btc_option_chain.forwards,
@@ -170,13 +170,12 @@ def run_local_test(local_test: LocalTests):
170
170
  params0 = LogSvParams(sigma0=1.32, theta=0.47, kappa1=9.98, kappa2=2.0, beta=0.45, volvol=0.83)
171
171
  nb_path = 1000000
172
172
  H = 0.4
173
- N = 2
174
173
  seed = 1
175
174
 
176
175
  def rough_vol():
177
176
  params1 = LogSvParams.copy(params0)
178
177
  params1.H = H
179
- params1.approximate_kernel(T=btc_option_chain.ttms[-1], N=N)
178
+ params1.approximate_kernel(T=btc_option_chain.ttms[-1])
180
179
 
181
180
  Z0, Z1, grid_ttms = sv.get_randoms_for_rough_vol_chain_valuation(ttms=btc_option_chain.ttms,
182
181
  nb_path=nb_path,
@@ -250,7 +249,7 @@ def run_local_test(local_test: LocalTests):
250
249
  ax.yaxis.set_major_formatter(mticker.FuncFormatter(lambda z, _: '{:.0%}'.format(z)))
251
250
  ax.xaxis.set_major_formatter(mticker.FuncFormatter(lambda z, _: '{:.2f}'.format(z)))
252
251
  ax.legend()
253
- fig.suptitle(f"Conventional LogSV model vs Rough LogSV, H={H:.2f} via {N}f Markovian approximation\n"
252
+ fig.suptitle(f"Conventional LogSV model vs Rough LogSV, H={H:.2f} via Markovian approximation\n"
254
253
  f"{params0.to_str()}",
255
254
  color = "darkblue", fontsize = 14)
256
255
 
@@ -271,7 +270,7 @@ def run_local_test(local_test: LocalTests):
271
270
  btc_option_chain = sv.get_btc_test_chain_data()
272
271
  params0 = LogSvParams(sigma0=0.8, theta=1.0, kappa1=2.21, kappa2=0.0, beta=0.15, volvol=2.0)
273
272
  params0.H = 0.3
274
- params0.approximate_kernel(T=btc_option_chain.ttms[-1], N=3)
273
+ params0.approximate_kernel(T=btc_option_chain.ttms[-1])
275
274
  btc_calibrated_params = logsv_pricer.calibrate_model_params_to_chain(option_chain=btc_option_chain,
276
275
  params0=params0,
277
276
  model_calibration_type=LogsvModelCalibrationType.PARAMS4,
@@ -33,16 +33,16 @@ class LogSvParams(ModelParams):
33
33
  self.kappa2 = self.kappa1 / self.theta
34
34
  assert 1e-4 < self.H <= 0.5
35
35
 
36
- def approximate_kernel(self, T: float, N: int):
37
- assert 1 <= N <= 5 # not keen to use large N
38
- if self.H >= 0.4:
39
- N = N if N<=2 else 2
40
- self.nodes, self.weights = european_rule(self.H, N, T)
41
- elif N > 1 and self.H<0.49:
42
- self.nodes, self.weights = european_rule(self.H, N, T)
43
- else:
36
+ def approximate_kernel(self, T: float):
37
+ if 0.49 < self.H <= 0.5:
44
38
  self.weights = np.array([1.0])
45
39
  self.nodes = np.array([1e-3])
40
+ return
41
+ elif 0.4 < self.H <= 0.49:
42
+ N = 2
43
+ else:
44
+ N = 3
45
+ self.nodes, self.weights = european_rule(self.H, N, T)
46
46
 
47
47
 
48
48
  def to_dict(self) -> Dict[str, Any]:
@@ -0,0 +1,15 @@
1
+ import numpy as np
2
+ from stochvolmodels import LogSvParams
3
+
4
+ if __name__ == "__main__":
5
+ H = 0.4464700054758044
6
+ N = 2
7
+ T = 1.
8
+
9
+ params0 = LogSvParams(sigma0 = 1.32, theta=0.47, kappa1=4.0, kappa2=2.0, beta=0.45, volvol=0.83)
10
+ for H in np.linspace(0.3, 0.5, 150):
11
+ params0.H = H
12
+ print(f" *** H={H} *** ")
13
+ params0.approximate_kernel(T=T)
14
+ print(params0.weights)
15
+ print(params0.nodes)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stochvolmodels
3
- Version: 1.1.3
3
+ Version: 1.1.4
4
4
  Summary: Python implementation of pricing analytics and Monte Carlo simulations for stochastic volatility models including log-normal SV model, Heston
5
5
  Author-email: Artur Sepp <artursepp@gmail.com>
6
6
  Maintainer-email: Artur Sepp <artursepp@gmail.com>, Parviz Rakhmonov <ParvizRZ@gmail.com>
@@ -1,16 +0,0 @@
1
- import numpy as np
2
- from stochvolmodels import LogSvParams
3
-
4
- if __name__ == "__main__":
5
- H = 0.4464700054758044
6
- N = 2
7
- T = 1.
8
-
9
- params0 = LogSvParams(sigma0 = 1.32, theta=0.47, kappa1=4.0, kappa2=2.0, beta=0.45, volvol=0.83)
10
- for N in [1, 2, 3]:
11
- for H in np.linspace(0.3, 0.49, 150):
12
- params0.H = H
13
- print(f" *** N={N}, H={H} *** ")
14
- params0.approximate_kernel(T=T, N=N)
15
- print(params0.weights)
16
- print(params0.nodes)
File without changes
File without changes