Skip to content

Commit

Permalink
rename models
Browse files Browse the repository at this point in the history
  • Loading branch information
jialuechen committed Oct 6, 2024
1 parent fb30b13 commit 1fe9c3e
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 32 deletions.
2 changes: 1 addition & 1 deletion examples/heston_volatility.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import torch
from torchquantlib.models.stochastic_volatility.heston_model import HestonModel
from torchquantlib.models.stochastic_volatility.heston import HestonModel

spot = torch.tensor(100.0)
strike = torch.tensor(105.0)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_stochastic_volatility.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import torch
from torchquantlib.models.stochastic_volatility.heston_model import HestonModel
from torchquantlib.models.stochastic_volatility.heston import HestonModel

def test_heston_model():
spot = torch.tensor(100.0)
Expand Down
3 changes: 2 additions & 1 deletion torchquantlib/calibration/sabr_calibration.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import torch
from torch import Tensor
from torchquantlib.models.stochastic_volatility import sabr
from scipy.optimize import minimize

def sabr_loss(params, market_vols, strikes, expiries):
alpha, beta, rho, nu = params
model = SABRModel(strikes, expiries, alpha, beta, rho, nu)
model = sabr(strikes, expiries, alpha, beta, rho, nu)
model_vols = model.price_option('call')
loss = torch.sum((market_vols - model_vols) ** 2)
return loss
Expand Down
16 changes: 0 additions & 16 deletions torchquantlib/utils/data_preprocessing.py

This file was deleted.

13 changes: 0 additions & 13 deletions torchquantlib/utils/interpolation.py

This file was deleted.

0 comments on commit 1fe9c3e

Please sign in to comment.