aboutsummaryrefslogtreecommitdiffstats
path: root/R/tests
diff options
context:
space:
mode:
Diffstat (limited to 'R/tests')
-rw-r--r--R/tests/test_yieldcurve.R6
1 files changed, 3 insertions, 3 deletions
diff --git a/R/tests/test_yieldcurve.R b/R/tests/test_yieldcurve.R
index 2ceb1db6..f5de7a9a 100644
--- a/R/tests/test_yieldcurve.R
+++ b/R/tests/test_yieldcurve.R
@@ -1,5 +1,5 @@
context("Discount Factors")
-root.dir <- "/home/share/CorpCDOs"
+root.dir <- "~/projects"
source(file.path(root.dir, "code", "R", "yieldcurve.R"))
bbg.discounts.usd <- c(0.99848606, 0.99548212, 0.99167201, 0.98772518,
0.98629694, 0.98509013, 0.98389804, 0.98268094,
@@ -14,7 +14,7 @@ sched.params <- list(effectiveDate = tradedate,
calendar = "WeekendsOnly",
businessDayConvention = "Following",
terminationDateConvention = "Following",
- dateGeneration = "CDS")
+ dateGeneration = "CDS2015")
sched <- Schedule(sched.params)
ir_data <- getMarkitIRData(tradedate)
@@ -30,7 +30,7 @@ calendar <- Calendar$new("WeekendsOnly")
dc <- DayCounter$new("Actual365Fixed")
yc <- YieldTermStructure$new("discount", "loglinear", 0, calendar, dc, quotes, legparams)
test_that("matches bloomberg USD discounts",
- expect_equal(yc$discount(sched[-1]), bbg.discounts.usd))
+ expect_equal(yc$discount(sched[-1]), bbg.discounts.usd, tolerance = 1e-4))
bbg.discounts.eur <- c(1.00059368, 1.0009714, 1.00103266, 1.00083284, 1.00125876,
1.00202315, 1.00280512, 1.00358771, 1.0040384, 1.00431052,