aboutsummaryrefslogtreecommitdiffstats
path: root/R/build_scenarios.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/build_scenarios.R')
-rw-r--r--R/build_scenarios.R5
1 files changed, 4 insertions, 1 deletions
diff --git a/R/build_scenarios.R b/R/build_scenarios.R
index 1e5b4ee1..c8d98e12 100644
--- a/R/build_scenarios.R
+++ b/R/build_scenarios.R
@@ -1,5 +1,7 @@
library(doParallel)
library(yaml)
+library(lossdistrib)
+
hostname <- system("hostname", intern=TRUE)
if(hostname=="debian"){
registerDoParallel(8)
@@ -24,7 +26,7 @@ if(length(args) >= 1){
if(length(args) >=2){
argslist <- strsplit(args[-1], ",")
dealnames <- unlist(lapply(argslist, function(x)x[1]))
- reinvflags <- as.logical(unlist(lapply(argslist, function(x)x[2])))
+ reinvflags <- as.logical(as.numeric(unlist(lapply(argslist, function(x)x[2]))))
}else{
data <- read.table(file.path(root.dir, "scripts", "deals_to_price.txt"),
colClasses=c("character", "logical"))
@@ -37,6 +39,7 @@ source(file.path(root.dir, "code", "R", "intex_deal_functions.R"))
source(file.path(root.dir, "code", "R", "etdb.R"))
source(file.path(root.dir, "code", "R", "cds_functions_generic.R"))
source(file.path(root.dir, "code", "R", "cds_utils.R"))
+source(file.path(root.dir, "code", "R", "yieldcurve.R"))
load.index("hy21")
calibration.date <- addBusDay(tradedate, -1)