diff options
| -rw-r--r-- | R/calibrate_tranches_BC.R | 6 | ||||
| -rw-r--r-- | R/creditIndex.R | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/R/calibrate_tranches_BC.R b/R/calibrate_tranches_BC.R index 1796007e..49e231f3 100644 --- a/R/calibrate_tranches_BC.R +++ b/R/calibrate_tranches_BC.R @@ -62,7 +62,9 @@ for(i in seq_along(runs$name)){ ig21 = as.Date("2013-09-26"),
ig23 = as.Date("2014-10-14"),
hy23 = as.Date("2014-10-16"),
- xo22 = as.Date("2014-10-20"))
+ xo22 = as.Date("2014-10-20"),
+ eu9 = as.Date("2014-11-03"),
+ eu21 = as.Date("2014-11-03"))
}
if(begin.date > as.Date(args$until)){
next
@@ -73,7 +75,7 @@ for(i in seq_along(runs$name)){ for(j in seq_along(bus.dates)){
tradedate <- bus.dates[j]
loginfo(paste("calibrating", index.name, tenor, "for", as.character(tradedate)))
- if(substr(index.name,1,2) %in% c("xo", "eu")){
+ if(tolower(substr(index.name,1,2)) %in% c("xo", "eu")){
curr <- "EUR"
}else{
curr <- "USD"
diff --git a/R/creditIndex.R b/R/creditIndex.R index 7b49aa76..8ef15093 100644 --- a/R/creditIndex.R +++ b/R/creditIndex.R @@ -12,7 +12,11 @@ Ngrid <- 201 creditIndex <- function(name, tenor="5yr", Z=gh$Z, w=gh$w, N=Ngrid) { ## constructor for the index object ## FIXME: figure out what to do with the recovery - r <- list(name=name, tenor=tenor, Z=Z, w=w, N=N, recovery=0.4) + name <- toupper(name) + r <- list(name=name, + tenor=tenor, type = substr(name, 1, 2), + series=as.integer(substr(name, 3, nchar(name))), + Z=Z, w=w, N=N, recovery=0.4) return( structure(r, class="creditIndex") ) } |
