aboutsummaryrefslogtreecommitdiffstats
path: root/R/calibrate_tranches_BC.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/calibrate_tranches_BC.R')
-rw-r--r--R/calibrate_tranches_BC.R6
1 files changed, 5 insertions, 1 deletions
diff --git a/R/calibrate_tranches_BC.R b/R/calibrate_tranches_BC.R
index 697ad998..c0c9bede 100644
--- a/R/calibrate_tranches_BC.R
+++ b/R/calibrate_tranches_BC.R
@@ -62,7 +62,7 @@ options(stringsAsFactors = FALSE)
source(file.path(root.dir, "code", "R", "yieldcurve.R"))
source(file.path(root.dir, "code", "R", "optimization.R"))
source(file.path(root.dir, "code", "R", "calibration.R"), chdir=TRUE)
-source(file.path(root.dir, "code", "R", "mlpdb.R"))
+source(file.path(root.dir, "code", "R", "serenitasdb.R"))
library(lossdistrib)
n.int <- 250
@@ -90,6 +90,9 @@ for(i in seq_along(runs$name)){
if(index.name=="ig19"){
alldates <- alldates[alldates!=as.Date("2013-11-29")] ##people are lazy the day after Thanksgiving
}
+ if(index.name=="hy21" & tenor =="3yr"){
+ ##alldates <- alldates[alldates!=as.Date("2013-11-29")] ##people are lazy the day after Thanksgiving
+ }
bus.dates <- as.Date(names(which(isBusinessDay(calendar="UnitedStates/GovernmentBond", alldates))))
##check if we have all the quotes and save them
@@ -100,6 +103,7 @@ for(i in seq_along(runs$name)){
quotes <- matrix(0, length(bus.dates), 2+2*n.tranches)
for(j in seq_along(bus.dates)){
tradedate <- bus.dates[j]
+ print (tradedate)
index <- load.index(index.name, tradedate, tenor, Z, w, Ngrid)
temp <- get.tranchequotes(index$name, index$tenor, tradedate)
quotes[j, 1] <- temp$indexrefprice[1]