aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--R/calibrate_tranches_BC.R2
-rw-r--r--R/calibration.R4
2 files changed, 3 insertions, 3 deletions
diff --git a/R/calibrate_tranches_BC.R b/R/calibrate_tranches_BC.R
index c0c9bede..b61c39af 100644
--- a/R/calibrate_tranches_BC.R
+++ b/R/calibrate_tranches_BC.R
@@ -108,7 +108,7 @@ for(i in seq_along(runs$name)){
temp <- get.tranchequotes(index$name, index$tenor, tradedate)
quotes[j, 1] <- temp$indexrefprice[1]
quotes[j, 2] <- temp$indexrefspread[1]
- quotes[j, 2+1:n.tranches] <- temp$trancheupfront
+ quotes[j, 2+1:n.tranches] <- temp$trancheupfrontmid
quotes[j, 2+n.tranches+1:n.tranches] <- temp$tranchedelta
}
diff --git a/R/calibration.R b/R/calibration.R
index b8dc9295..98460489 100644
--- a/R/calibration.R
+++ b/R/calibration.R
@@ -76,8 +76,8 @@ set.tranchedata <- function(index, tradedate){
K <- c(0, temp$detach/100)
index$K.orig <- K
index$K <- adjust.attachments(K, index$loss, index$factor)
- index$tranche.upf <- temp$trancheupfront
- index$tranche.running <- temp$trancherunning*1e-4
+ index$tranche.upf <- temp$trancheupfrontmid
+ index$tranche.running <- temp$trancherunningmid*1e-4
## compute dirty protection price
if(length(grep("hy", index$name, ignore.case=TRUE))>0){
index$tranche.quotes <- 1-index$tranche.upf/100-cdsAccrued(tradedate, index$tranche.running)