-
Notifications
You must be signed in to change notification settings - Fork 11
/
tests_diffusion.sh
executable file
·38 lines (33 loc) · 1.28 KB
/
tests_diffusion.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# No-jump and jump-diffusion (Merton, Kou) test cases.
echo "Matlab Closed Form"
echo "[Call, Put] = blsprice(Price, Strike, Rate, Time, Volatility)"
echo "[42.0707, 2.7238] = blsprice(100, 100, 0.05, 10, 0.15)"
./option $1 --payoff call --resolution 2048
./option $1 --payoff call --resolution 8192
./option $1 --payoff call --resolution 32768
./option $1 --payoff put --resolution 2048
./option $1 --payoff put --resolution 8192
./option $1 --payoff put --resolution 32768
echo ""
echo "Matlab American Option (based on lattice implementation)"
echo "Expected Call price: 42.0707"
./option $1 --payoff call --exercise american --resolution 4096 --timesteps 512
./option $1 --payoff call --exercise american --resolution 8192 --timesteps 1024
./option $1 --payoff call --exercise american --resolution 16384 --timesteps 2048
echo "Expected Put price: 7.0639"
./option $1 --payoff put --exercise american --resolution 4096 --timesteps 512
./option $1 --payoff put --exercise american --resolution 8192 --timesteps 1024
./option $1 --payoff put --exercise american --resolution 16384 --timesteps 2048
echo ""
./tests/surkov_c1.sh $1
echo ""
./tests/surkov_c2.sh $1
echo ""
./tests/surkov_c5.sh $1
echo ""
./tests/surkov_c10.sh $1
echo ""
./tests/surkov_22.sh $1
echo ""
./tests/surkov_62.sh $1