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.R5
1 files changed, 2 insertions, 3 deletions
diff --git a/R/calibrate_tranches_BC.R b/R/calibrate_tranches_BC.R
index 4cb139eb..5b9d69d0 100644
--- a/R/calibrate_tranches_BC.R
+++ b/R/calibrate_tranches_BC.R
@@ -52,10 +52,11 @@ for(index.name in c("hy19", "hy21"){
rhovec <- c(rhovec, rho)
}
index$rho <- rhovec
+ index$cs$coupons <- dT*index$spreadref
temp <- BCtranche.delta(index, Z, w, Ngrid, tradedate)
deltasmat <- rbind(deltasmat, temp$deltas)
gammasmat <- rbind(gammasmat, temp$gammas)
- index$cs$coupons <- dT*index$spreadref
+
cl <- c()
for(j in 1:(length(index$K)-1)){
cl <- c(cl, BCtranche.pv(index, index$K[j], index$K[j+1], rhovec[j], rhovec[j+1], Z, w, Ngrid)$cl)
@@ -65,5 +66,3 @@ for(index.name in c("hy19", "hy21"){
cat(i, "\n")
}
}
- write.csv(deltasmat, file="delta.csv")
-write.csv(rhomat, file="rho.csv")