aboutsummaryrefslogtreecommitdiffstats
path: root/R
diff options
context:
space:
mode:
Diffstat (limited to 'R')
-rw-r--r--R/intex_deal_functions.R (renamed from R/intex_deals_functions.R)17
1 files changed, 11 insertions, 6 deletions
diff --git a/R/intex_deals_functions.R b/R/intex_deal_functions.R
index 35ee9ee7..5771b279 100644
--- a/R/intex_deals_functions.R
+++ b/R/intex_deal_functions.R
@@ -1,11 +1,11 @@
library(RQuantLib)
library(statmod)
-root = "//WDSENTINEL/share/CorpCDOs/"
-source(file.path(root, "code" "R", "yieldCurve.R"))
-source(file.path(root, "code", "R", "cds_functions_generic.R"))
-source(file.path(root, "code", "R", "etdb.R"))
-source(file.path(root, "code", "R", "tranche_functions.R"))
-load(file.path(root, "code", "R", "bloomberg_data.RData"))
+root.dir <- "//WDSENTINEL/share/CorpCDOs/"
+source(file.path(root.dir, "code" "R", "yieldCurve.R"))
+source(file.path(root.dir, "code", "R", "cds_functions_generic.R"))
+source(file.path(root.dir, "code", "R", "etdb.R"))
+source(file.path(root.dir, "code", "R", "tranche_functions.R"))
+load(file.path(root.dir, "code", "R", "bloomberg_data.RData"))
cdorating <- function(cusip){
return( sub("[0-9]","", dataMtge[dataMtge$CUSIP %in% cusip,]$RTG_MDY_INITIAL ))
@@ -23,6 +23,11 @@ getdealdata <- function(dealnames){
return( dbGetQuery(dbCon, sqlstring) )
}
+listdealnames <- function(){
+ sqlstring <- "select distinct dealname from clo_universe order by dealname"
+ return( dbGetQuery(dbCon, sqlstring))
+}
+
recovery <- function(collateral) {
## return assumed recovery based on assumptions from recovery.assumptions
if(!is.na(collateral$secondlien) && collateral$secondlien){