aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--R/creditIndex.R9
1 files changed, 5 insertions, 4 deletions
diff --git a/R/creditIndex.R b/R/creditIndex.R
index cbad046d..3d2c8681 100644
--- a/R/creditIndex.R
+++ b/R/creditIndex.R
@@ -1,7 +1,7 @@
-if(.Platform$OS.type == "unix"){
- root.dir <- "/home/share/CorpCDOs"
+root.dir <- if(.Platform$OS.type == "unix"){
+ "/home/share/CorpCDOs"
}else{
- root.dir <- "//WDSENTINEL/share/CorpCDOs"
+ "//WDSENTINEL/share/CorpCDOs"
}
library(lossdistrib)
@@ -16,7 +16,8 @@ creditIndex <- function(name, tenor="5yr", Z=gh$Z, w=gh$w, N=Ngrid) {
r <- list(name=name,
tenor=tenor, type = substr(name, 1, 2),
series=as.integer(substr(name, 3, nchar(name))),
- Z=Z, w=w, N=N, recovery=0.4)
+ Z=Z, w=w, N=N)
+ r$recovery <- if(r$type=="HY") 0.3 else 0.4
return( structure(r, class="creditIndex") )
}