Skip to content

Commit

Permalink
update path to risk module
Browse files Browse the repository at this point in the history
  • Loading branch information
jialuechen committed Oct 2, 2024
1 parent f57a297 commit adbe837
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ print(f'Asian Option Price: {price.item()}')

```python
import torch
from torchquantlib.risk.greeks.malliavin import malliavin_greek
from torchquantlib.core.risk.greeks.malliavin import malliavin_greek

option_price = torch.tensor(10.0)
underlying_price = torch.tensor(100.0)
Expand Down Expand Up @@ -175,8 +175,8 @@ for epoch in range(num_epochs):
## Credit Risk Management Example
```python
import torch
from torchquantlib.risk.credit_risk.structural_model import merton_model
from torchquantlib.risk.credit_risk.reduced_form_model import reduced_form_model
from torchquantlib.core.risk.credit_risk.structural_model import merton_model
from torchquantlib.core.risk.credit_risk.reduced_form_model import reduced_form_model

asset_value = torch.tensor(100.0)
debt = torch.tensor(80.0)
Expand Down
4 changes: 2 additions & 2 deletions examples/credit_risk.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import torch
from torchquantlib.risk.credit_risk.structural_model import merton_model
from torchquantlib.risk.credit_risk.reduced_form_model import reduced_form_model
from torchquantlib.core.risk.credit_risk.structural_model import merton_model
from torchquantlib.core.risk.credit_risk.reduced_form_model import reduced_form_model

asset_value = torch.tensor(100.0)
debt = torch.tensor(80.0)
Expand Down
2 changes: 1 addition & 1 deletion examples/malliavin_greeks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import torch
from torchquantlib.risk.greeks.malliavin_greeks import malliavin_greek
from torchquantlib.core.risk.greeks.malliavin_greeks import malliavin_greek

option_price = torch.tensor(10.0)
underlying_price = torch.tensor(100.0)
Expand Down
4 changes: 2 additions & 2 deletions examples/market_risk.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import torch
from torchquantlib.risk.market_risk.var import calculate_var
from torchquantlib.risk.market_risk.expected_shortfall import calculate_es
from torchquantlib.core.risk.market_risk.var import calculate_var
from torchquantlib.core.risk.market_risk.expected_shortfall import calculate_es

returns = torch.tensor([0.01, -0.02, 0.03, -0.01, 0.04, -0.03])
confidence_level = 0.95
Expand Down
8 changes: 4 additions & 4 deletions examples/valuation_adjustment.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import torch
from torchquantlib.risk.valuation_adjustments.cva import calculate_cva
from torchquantlib.risk.valuation_adjustments.dva import calculate_dva
from torchquantlib.risk.valuation_adjustments.mva import calculate_mva
from torchquantlib.risk.valuation_adjustments.fva import calculate_fva
from torchquantlib.core.risk.valuation_adjustments.cva import calculate_cva
from torchquantlib.core.risk.valuation_adjustments.dva import calculate_dva
from torchquantlib.core.risk.valuation_adjustments.mva import calculate_mva
from torchquantlib.core.risk.valuation_adjustments.fva import calculate_fva

exposure = torch.tensor(100.0)
default_prob = torch.tensor(0.02)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_malliavin_greeks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import torch
from torchquantlib.risk.greeks.malliavin_greeks import MalliavinGreeks
from torchquantlib.core.risk.greeks.malliavin_greeks import MalliavinGreeks

def test_malliavin_greek():
option_price = torch.tensor(10.0)
Expand Down

0 comments on commit adbe837

Please sign in to comment.