Skip to content

Commit 0cb7656

Browse files
committed
Reference for the test values added
1 parent 761692e commit 0cb7656

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/tests/testthat/test-SABR.R

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
library(FER)
22

3+
# Table 1 in Antonov & Spector (2012). https://ssrn.com/abstract=2026350
34
test_that("SabrHagan2002 BS Volatility Table 1", {
45
value <- round( FER::SabrHagan2002(
56
strike=seq(0.1, 2, 0.1), spot=1, texp=10, sigma=0.25,
6-
vov=0.3, rho=-0.8, beta=0.3), digits = 4 )
7+
vov=0.3, rho=-0.8, beta=0.3),
8+
digits = 4 )
79
value2 <- c(
810
0.7176, 0.5725, 0.4886, 0.4293, 0.3835,
911
0.3462, 0.3148, 0.2876, 0.2638, 0.2427,
@@ -12,10 +14,12 @@ test_that("SabrHagan2002 BS Volatility Table 1", {
1214
expect_equal(value, value2, tolerance = 1e-5)
1315
})
1416

17+
# Table 13 in Antonov & Spector (2012). https://ssrn.com/abstract=2026350
1518
test_that("SabrHagan2002 BS Volatility Table 13", {
1619
value <- round( FER::SabrHagan2002(
1720
strike=seq(0.1, 2, 0.1), spot=1, texp=20, sigma=0.25,
18-
vov=0.3, rho=-0.5, beta=0.3), digits=4 )
21+
vov=0.3, rho=-0.5, beta=0.3),
22+
digits=4 )
1923
value2 <- c(
2024
0.7603, 0.5973, 0.5078, 0.4463, 0.3997,
2125
0.3626, 0.332, 0.3063, 0.2844, 0.2658,

0 commit comments

Comments
 (0)