aboutsummaryrefslogtreecommitdiffstats
path: root/R
diff options
context:
space:
mode:
Diffstat (limited to 'R')
-rw-r--r--R/build_SC.R15
-rw-r--r--R/tranche_functions.R2
2 files changed, 12 insertions, 5 deletions
diff --git a/R/build_SC.R b/R/build_SC.R
index 157d5b49..631325aa 100644
--- a/R/build_SC.R
+++ b/R/build_SC.R
@@ -196,13 +196,20 @@ for(deal.name in dealnames){
generate_portfolio_helper <- function(cusips){
dealnames <- dealnamefromcusip(cusips)
+ uniqdealnames <- unique(dealnames)
r <- c()
s <- c()
+ for(dealname in uniqdealnames){
+ r <- c(r, paste(toupper(dealname), "COLLAT_INITIAL", sep=","))
+ r <- c(r, paste(toupper(dealname), "COLLAT_REINVEST", sep=","))
+ s <- c(s, rep(paste0(dealname, ".sss"), 2))
+ }
+
for(i in 1:length(cusips)){
- r <- c(r, paste(toupper(dealnames[i]), "COLLAT_INITIAL", sep=","),
- paste(toupper(dealnames[i]), "COLLAT_REINVEST", sep=","))
r <- c(r, cusips[i])
- s <- c(s, rep(paste0(dealnames[i], ".sss"), 3))
+ s <- c(s, paste0(dealnames[i], ".sss"))
}
- return( list(r, s) )
+ result <- data.frame(r,s)
+ write.table(result, file="clipboard", sep="\t", quote=F,
+ row.names=F, col.names=F)
}
diff --git a/R/tranche_functions.R b/R/tranche_functions.R
index 58a08189..9e6e7c74 100644
--- a/R/tranche_functions.R
+++ b/R/tranche_functions.R
@@ -404,7 +404,7 @@ dist.transform <- function(dist.joint){
distDR[t,index,j] <- distDR[t,index,j] + dist.joint[t,i,j]
}else{
distDR[t,Ngrid,j] <- distDR[t,Ngrid,j] +
- dist.joint[t,i,j] * index * 0.005
+ dist.joint[t,i,j]
}
}
}