Skip to content

Commit 1a573f4

Browse files
committed
Correcting examples
1 parent 3ec32d2 commit 1a573f4

File tree

3 files changed

+7
-170
lines changed

3 files changed

+7
-170
lines changed

examples/polished_examples/carr_madan_ex.jl

Lines changed: 0 additions & 121 deletions
This file was deleted.

examples/polished_examples/gradient_benchmark.jl

Lines changed: 0 additions & 42 deletions
This file was deleted.

examples/polished_examples/implied_vol.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ using Hedgehog
66
# Inputs
77
reference_date = Date(2025, 1, 1)
88
expiry = Date(2025, 7, 1)
9-
strike = 100.0
10-
spot = 100.0
11-
rate = FlatRateCurve(0.01) # assume this gives df(t)
9+
strike = 1.0
10+
spot = 1.0
11+
rate = 0.01
12+
vol = 0.36
1213

1314
# Build payoff
1415
payoff = VanillaOption(strike, expiry, European(), Call(), Spot())
@@ -18,10 +19,9 @@ market_inputs = BlackScholesInputs(
1819
reference_date,
1920
rate,
2021
spot,
21-
0.2
22+
vol
2223
)
2324

24-
vol = 0.3
2525

2626
# Create the pricing problem
2727
pricing_problem = PricingProblem(payoff, market_inputs)
@@ -31,9 +31,9 @@ market_price = Hedgehog.solve(pricing_problem, BlackScholesAnalytic()).price
3131
calib = CalibrationProblem(
3232
BasketPricingProblem([payoff], market_inputs), # pricing problem container
3333
BlackScholesAnalytic(), # method
34-
[@optic _.market_inputs.sigma], # parameter to calibrate
34+
[VolLens(1,1)], # parameter to calibrate
3535
[market_price], # target price
36-
[vol], # initial guess
36+
[0.05], # initial guess
3737
)
3838

3939
# Solve for implied vol using root finding

0 commit comments

Comments
 (0)