aboutsummaryrefslogtreecommitdiffstats
path: root/R/script_calibrate_tranches.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/script_calibrate_tranches.R')
-rw-r--r--R/script_calibrate_tranches.R4
1 files changed, 2 insertions, 2 deletions
diff --git a/R/script_calibrate_tranches.R b/R/script_calibrate_tranches.R
index a0f0afbf..1970ab8d 100644
--- a/R/script_calibrate_tranches.R
+++ b/R/script_calibrate_tranches.R
@@ -73,11 +73,11 @@ tranche.running <- c(0.05, 0.05, 0.05, 0.05)
# get the index ref
hy21$indexref <- market.data$bidRefPrice[1]/100
hy21portfolio.tweaked <- tweakcurves(hy21portfolio, hy21, tradedate)$portfolio
-SurvProb <- SPmatrix(hy21portfolio.tweaked, hy21)
+cs <- couponSchedule(IMMDate(tradedate), hy21$maturity,"Q", "FIXED", 0.05, 0, tradedate, IMMDate(tradedate, "prev"))
+SurvProb <- SPmatrix(hy21portfolio.tweaked, length(cs$dates))
Ngrid <- 2 * nrow(nondefaulted) + 1
recov <- sapply(hy21portfolio.tweaked, attr, "recovery")
-cs <- couponSchedule(IMMDate(tradedate), hy21$maturity,"Q", "FIXED", 0.05, 0, tradedate, IMMDate(tradedate, "prev"))
acc <- cdsAccrued(tradedate, 0.05)
##calibrate by modifying the factor distribution
bottomup <- 1:3