diff options
| -rw-r--r-- | R/calibrate_tranches_BC.R | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/R/calibrate_tranches_BC.R b/R/calibrate_tranches_BC.R index ad54df73..6d0844c0 100644 --- a/R/calibrate_tranches_BC.R +++ b/R/calibrate_tranches_BC.R @@ -9,7 +9,7 @@ source(file.path(root.dir, "code", "R", "cds_functions_generic.R")) source(file.path(root.dir, "code", "R", "yieldcurve.R"))
source(file.path(root.dir, "code", "R", "optimization.R"))
source(file.path(root.dir, "code", "R", "calibration.R"))
-load.index("hy21", "index_definitions_bt.yml")
+source(file.path(root.dir, "code", "R", "mlpdb.R"))
library(lossdistrib)
n.int <- 250
@@ -24,6 +24,7 @@ bus.dates <- as.Date(names(which(isBusinessDay(calendar="UnitedStates/Government for(i in seq_along(bus.dates)){
tradedate <- bus.dates[i]
exportYC(tradedate)
+ hy21 <- load.index("hy21", tradedate)
## calibrate HY21
## calibrate the single names curves
set.singlenamesdata(hy21, tradedate)
@@ -36,7 +37,6 @@ for(i in seq_along(bus.dates)){ }
rhovec <- c()
for(j in 1:(length(hy21$K)-1)){
- ##q <- quotes[i-1]
rho <- optimize(f, interval=c(0,1), index=hy21, N=Ngrid, i=j)$minimum
rhovec <- c(rhovec, rho)
}
|
