aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--R/VaR.R6
1 files changed, 3 insertions, 3 deletions
diff --git a/R/VaR.R b/R/VaR.R
index a329abd7..90914b81 100644
--- a/R/VaR.R
+++ b/R/VaR.R
@@ -17,11 +17,11 @@ source(file.path(root.dir, "code", "R", "creditIndex.R"))
source(file.path(root.dir, "code", "R", "tranche_functions.R"))
#we load the index we want to shock
-tradedate <- addBusDays(Sys.Date(), -1)
+tradedate <- addBusDay(Sys.Date(), -1)
index <- load.index("hy19", "5yr", tradedate)
-rho <- get.skews('HY', 23, '5yr')
-colnames(rho) <- c("15 Corr", "25 Corr", "35 Corr")
+rho <- get.skews('HY23', '5yr')
+colnames(rho) <- c("date", "15 Corr", "25 Corr", "35 Corr")
skew.shocks <- apply(log(-log(rho)), 2, diff)
pvshocks1 <- BCtranche.VaR(index, skew.shocks)