Skip to content

Commit 33a3ebc

Browse files
committed
Calibration for Heston with jumps
1 parent 28c418b commit 33a3ebc

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

notebooks/_config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ logo: assets/quantflow-light.svg
99
# Force re-execution of notebooks on each build.
1010
# See https://jupyterbook.org/content/execute.html
1111
execute:
12-
execute_notebooks: "off"
13-
#execute_notebooks: force
12+
#execute_notebooks: "off"
13+
execute_notebooks: force
1414

1515
# Define the name of the latex output file for PDF builds
1616
latex:

quantflow/options/calibration.py

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,31 @@ def get_bounds(self) -> Sequence[Bounds] | None:
253253
vol_range = self.implied_vol_range()
254254
vol_lb = 0.5 * vol_range.lb[0]
255255
vol_ub = 1.5 * vol_range.ub[0]
256-
return Bounds(
257-
[vol_lb * vol_lb, vol_lb * vol_lb, 0.0, 0.0, -0.9],
258-
[vol_ub * vol_ub, vol_ub * vol_ub, np.inf, np.inf, 0.0],
259-
)
256+
lower = [
257+
(0.5 * vol_lb) ** 2, # rate
258+
(0.5 * vol_lb) ** 2, # theta
259+
0.001, # kappa - mean reversion speed
260+
0.001, # sigma - vol of vol
261+
-0.9, # correlation
262+
1.0, # jump intensity
263+
(0.01 * vol_lb) ** 2, # jump variance
264+
]
265+
upper = [
266+
(1.5 * vol_ub) ** 2, # rate
267+
(1.5 * vol_ub) ** 2, # theta
268+
np.inf, # kappa
269+
np.inf, # sigma
270+
0.0, # correlation
271+
np.inf, # jump intensity
272+
(0.5 * vol_ub) ** 2, # jump variance
273+
]
274+
try:
275+
self.model.jumps.jumps.asymmetry()
276+
lower.append(-2.0) # jump asymmetry
277+
upper.append(2.0)
278+
except NotImplementedError:
279+
pass
280+
return Bounds(lower, upper)
260281

261282
def get_params(self) -> np.ndarray:
262283
params = [

0 commit comments

Comments
 (0)