Skip to content

Commit

Permalink
Calibration for Heston with jumps
Browse files Browse the repository at this point in the history
  • Loading branch information
lsbardel committed Jan 14, 2025
1 parent 28c418b commit 33a3ebc
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
4 changes: 2 additions & 2 deletions notebooks/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ logo: assets/quantflow-light.svg
# Force re-execution of notebooks on each build.
# See https://jupyterbook.org/content/execute.html
execute:
execute_notebooks: "off"
#execute_notebooks: force
#execute_notebooks: "off"
execute_notebooks: force

# Define the name of the latex output file for PDF builds
latex:
Expand Down
29 changes: 25 additions & 4 deletions quantflow/options/calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,31 @@ def get_bounds(self) -> Sequence[Bounds] | None:
vol_range = self.implied_vol_range()
vol_lb = 0.5 * vol_range.lb[0]
vol_ub = 1.5 * vol_range.ub[0]
return Bounds(
[vol_lb * vol_lb, vol_lb * vol_lb, 0.0, 0.0, -0.9],
[vol_ub * vol_ub, vol_ub * vol_ub, np.inf, np.inf, 0.0],
)
lower = [
(0.5 * vol_lb) ** 2, # rate
(0.5 * vol_lb) ** 2, # theta
0.001, # kappa - mean reversion speed
0.001, # sigma - vol of vol
-0.9, # correlation
1.0, # jump intensity
(0.01 * vol_lb) ** 2, # jump variance
]
upper = [
(1.5 * vol_ub) ** 2, # rate
(1.5 * vol_ub) ** 2, # theta
np.inf, # kappa
np.inf, # sigma
0.0, # correlation
np.inf, # jump intensity
(0.5 * vol_ub) ** 2, # jump variance
]
try:
self.model.jumps.jumps.asymmetry()
lower.append(-2.0) # jump asymmetry
upper.append(2.0)
except NotImplementedError:
pass
return Bounds(lower, upper)

def get_params(self) -> np.ndarray:
params = [
Expand Down

0 comments on commit 33a3ebc

Please sign in to comment.