aboutsummaryrefslogtreecommitdiffstats
path: root/R
diff options
context:
space:
mode:
Diffstat (limited to 'R')
-rw-r--r--R/calibrate_tranches_BC.R4
-rw-r--r--R/thetas-durations.R12
2 files changed, 6 insertions, 10 deletions
diff --git a/R/calibrate_tranches_BC.R b/R/calibrate_tranches_BC.R
index f65a1a49..49c35f85 100644
--- a/R/calibrate_tranches_BC.R
+++ b/R/calibrate_tranches_BC.R
@@ -1,6 +1,6 @@
## parse command line arguments
code.dir <- Sys.getenv("CODE_DIR")
-tranchedata.dir <- fole.path(Sys.getenv("DATA_DIR"), "..", "Tranche_data")
+tranchedata.dir <- file.path(Sys.getenv("DATA_DIR"), "..", "Tranche_data")
library(logging)
basicConfig()
removeHandler('basic.stdout')
@@ -46,7 +46,7 @@ source(file.path(code.dir, "R", "tranche_functions.R"))
for(run in config$runs){
index.name <- run[1]
tenor <- run[2]
- filename <- file.path(thranchedata.dir, "Runs",
+ filename <- file.path(tranchedata.dir, "Runs",
paste(tolower(index.name), tenor, "csv",sep="."))
## if(!file.exists(filename)){
## args$update <- FALSE
diff --git a/R/thetas-durations.R b/R/thetas-durations.R
index 9aeaad20..54e79f8f 100644
--- a/R/thetas-durations.R
+++ b/R/thetas-durations.R
@@ -4,18 +4,14 @@ library(doParallel)
library(dplyr)
library(tidyr)
-root.dir <- if(.Platform$OS.type == "unix"){
- "/home/share/CorpCDOs"
-}else{
- "//WDSENTINEL/share/CorpCDOs"
-}
+code.dir <- Sys.getenv("CODE_DIR")
hostname <- system("hostname", intern=TRUE)
registerDoParallel(if(hostname=="debian") 4 else 8)
-source(file.path(root.dir, "code", "R", "serenitasdb.R"))
-source(file.path(root.dir, "code", "R", "cds_functions_generic.R"))
-source(file.path(root.dir, "code", "R", "yieldcurve.R"))
+source(file.path(code.dir, "R", "serenitasdb.R"))
+source(file.path(code.dir, "R", "cds_functions_generic.R"))
+source(file.path(code.dir, "R", "yieldcurve.R"))
get.indexquotes.table <- function(indextype, series, tenors=c("3yr", "5yr", "7yr"), onlymissing=TRUE){
stmt <- str_c("select date, tenor, closeprice from index_quotes ",