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.R7
1 files changed, 4 insertions, 3 deletions
diff --git a/R/script_calibrate_tranches.R b/R/script_calibrate_tranches.R
index 12cb51f7..7b095924 100644
--- a/R/script_calibrate_tranches.R
+++ b/R/script_calibrate_tranches.R
@@ -16,7 +16,8 @@ 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")
+source(file.path(root.dir, "code", "R", "mlpdb.R"))
+hy21 <- load.index("hy21")
##figure out the tradedate
if(length(args) >= 1){
@@ -28,8 +29,8 @@ if(length(args) >= 1){
exportYC(tradedate)
## calibrate HY21
## calibrate the single names curves
-set.singlenamesdata(hy21, tradedate)
-set.tranchedata(hy21, tradedate)
+hy21 <- set.singlenamesdata(hy21, tradedate)
+hy21 <- set.tranchedata(hy21, tradedate)
## load tranche data
n.credit <- length(hy21$portfolio)