|
1 | 1 | using FinancialDerivatives
|
2 | 2 | using Test
|
3 | 3 |
|
4 |
| -eu_put = AmericanOption(100.0, 90.0, 0.05, 0.3, 180/365, -1) |
5 |
| -eu_call = AmericanOption(100.0, 90.0, 0.05, 0.3, 180/365, 1) |
| 4 | +eu_put = EuropeanOption(100.0, 90.0, 0.05, 0.3, 180/365, -1) |
| 5 | +eu_call = EuropeanOption(100.0, 90.0, 0.05, 0.3, 180/365, 1) |
6 | 6 |
|
7 | 7 | am_put = AmericanOption(100.0, 90.0, 0.05, 0.3, 180/365, -1)
|
8 | 8 | am_call = AmericanOption(100.0, 90.0, 0.05, 0.3, 180/365, 1)
|
|
43 | 43 |
|
44 | 44 | ird = InterestRateDerivative(0.01875, 0.20, 0.01, 0.012, 180/365)
|
45 | 45 |
|
| 46 | +@testset "Black-Karasinski" begin |
| 47 | + @test isapprox(evaluate(ird, BlackKarasinski(), 2), [0.2, 0.2, 0.2, 0.2], atol=0.25) |
| 48 | +end |
| 49 | + |
46 | 50 | @testset "Brennan-Schwartz" begin
|
47 | 51 | @test isapprox(evaluate(ird, BrennanSchwartz(), 2), [0.2, 0.2, 0.2, 0.2], atol=0.25)
|
48 | 52 | end
|
|
0 commit comments