diff options
Diffstat (limited to 'R/script_calibrate_tranches.R')
| -rw-r--r-- | R/script_calibrate_tranches.R | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/R/script_calibrate_tranches.R b/R/script_calibrate_tranches.R index 2f740248..5dfe59e0 100644 --- a/R/script_calibrate_tranches.R +++ b/R/script_calibrate_tranches.R @@ -43,7 +43,7 @@ bps <- 1e-4 cdsdates <- as.Date(character(0))
for(tenor in paste0(1:5, "y")){
- cdsdates <- c(cdsdates, cdsMaturity(tenor, date=workdate))
+ cdsdates <- c(cdsdates, cdsMaturity(tenor, date=workdate+1))
}
hy21portfolio <- c()
@@ -70,7 +70,7 @@ tranche.upf <- markit.data$Mid tranche.running <- c(0.05, 0.05, 0.05, 0.05)
# get the index ref
hy21$indexref <- markit.data$bidRefPrice[1]/100
-hy21portfolio.tweaked <- tweakcurves(hy21portfolio, hy21)
+hy21portfolio.tweaked <- tweakcurves(hy21portfolio, hy21, workdate)
SurvProb <- SPmatrix(hy21portfolio.tweaked, hy21)
Ngrid <- 2 * nrow(nondefaulted) + 1
@@ -92,7 +92,7 @@ p <- defaultprob rho <- rep(0.45, n.credit)
result <- matrix(0, 4, n.int)
-for(l in 1:100){
+for(l in 1:150){
Rstoch <- array(0, dim=c(n.credit, n.int, ncol(SurvProb)))
for(t in 1:ncol(SurvProb)){
for(i in 1:n.credit){
|
