aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build_SC.R10
1 files changed, 5 insertions, 5 deletions
diff --git a/build_SC.R b/build_SC.R
index 5054f863..b2985ffd 100644
--- a/build_SC.R
+++ b/build_SC.R
@@ -1,5 +1,6 @@
source("intex_deals_functions.R")
-
+library("RQuantLib")
+library("parallel")
## duration <- function(creditcurve){
## # computes the duration for a hazard rate curve
## T <- yearFrac(creditcurve@startdate, creditcurve@curve@dates)
@@ -14,7 +15,6 @@ source("intex_deals_functions.R")
## return( - sum(s) )
## }
-
## dealnames <- c("babs072", "symph4", "flags5", "cent11", "wasatl", "oceant2", "acacl071", "limes")
## for(dealname in dealnames){
@@ -130,9 +130,9 @@ Smat <- matrix(S, length(issuerweights), ncol(dp))
dpmod <- MFupdate.prob(Z, w.mod, rho, dp)
ppmod <- MFupdate.prob(-Z, w.mod, rho, pp)
-## cl <- makeCluster(6)
-## clusterExport(cl, list("shockprob", "rho", "Z", "issuerweights", "lossdistribprepayC.joint",
-## "lossrecovdist.joint.term", "lossdistribC.joint", "Ngrid"))
+cl <- makeCluster(6)
+clusterExport(cl, list("shockprob", "rho", "Z", "issuerweights", "lossdistC.prepay.joint",
+ "lossrecovdist.joint.term", "lossdistC.joint", "Ngrid"))
dist <- MFlossrecovdist.prepay(w.mod, Z, rho, dp, dpmod, pp, ppmod, issuerweights, 1-S, Ngrid=201, TRUE)
dist.joint <- MFlossdist.prepay.joint(cl, w.mod, Z, rho, dp, dpmod,
pp, ppmod, issuerweights, 1-S, Ngrid=201, FALSE)