aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--R/calibrate_tranches_BC.R2
-rw-r--r--R/calibrate_tranches_MF.R8
-rw-r--r--R/tranches_RV_BC.R2
3 files changed, 5 insertions, 7 deletions
diff --git a/R/calibrate_tranches_BC.R b/R/calibrate_tranches_BC.R
index 2f227bbd..bed9a4e3 100644
--- a/R/calibrate_tranches_BC.R
+++ b/R/calibrate_tranches_BC.R
@@ -36,7 +36,7 @@ source(file.path(root.dir, "code", "R", "optimization.R"))
source(file.path(root.dir, "code", "R", "calibration.R"), chdir=TRUE)
source(file.path(root.dir, "code", "R", "serenitasdb.R"))
source(file.path(root.dir, "code", "R", "creditIndex.R"))
-library(lossdistrib)
+source(file.path(root.dir, "code", "R", "tranche_functions.R"))
for(i in seq_along(runs$name)){
index.name <- runs$name[i]
diff --git a/R/calibrate_tranches_MF.R b/R/calibrate_tranches_MF.R
index a95de491..23bef772 100644
--- a/R/calibrate_tranches_MF.R
+++ b/R/calibrate_tranches_MF.R
@@ -1,6 +1,5 @@
#!/usr/bin/Rscript
require(methods)
-library(lossdistrib)
library(logging)
options(warn=2)
args <- commandArgs(trailingOnly=TRUE)
@@ -11,15 +10,14 @@ if(.Platform$OS.type == "unix"){
root.dir <- "//WDSENTINEL/share/CorpCDOs"
}
-code.dir <- Sys.getenv("CODE_DIR")
-if(code.dir==""){
- code.dir<-root.dir
-}
+code.dir <- if(Sys.getenv("CODE_DIR")=="") Sys.getenv("CODE_DIR") else root.dir
+
source(file.path(code.dir, "code", "R", "yieldcurve.R"))
source(file.path(code.dir, "code", "R", "optimization.R"))
source(file.path(code.dir, "code", "R", "calibration.R"), chdir=TRUE)
source(file.path(code.dir, "code", "R", "serenitasdb.R"))
source(file.path(code.dir, "code", "R", "creditIndex.R"))
+source(file.path(code.dir, "code", "R", "tranche_functions.R"))
##figure out the tradedate
if(length(args) >= 1){
diff --git a/R/tranches_RV_BC.R b/R/tranches_RV_BC.R
index a7cd368a..890ac94a 100644
--- a/R/tranches_RV_BC.R
+++ b/R/tranches_RV_BC.R
@@ -40,7 +40,7 @@ source(file.path(root.dir, "code", "R", "optimization.R"))
source(file.path(root.dir, "code", "R", "calibration.R"), chdir=TRUE)
source(file.path(root.dir, "code", "R", "serenitasdb.R"))
source(file.path(root.dir, "code", "R", "creditIndex.R"))
-library(lossdistrib)
+source(file.path(root.dir, "code", "R", "tranche_functions.R"))
for(i in seq_along(runs$name1)){
with(runs,