aboutsummaryrefslogtreecommitdiffstats
path: root/R/script_calibrate_tranches.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/script_calibrate_tranches.R')
-rw-r--r--R/script_calibrate_tranches.R6
1 files changed, 3 insertions, 3 deletions
diff --git a/R/script_calibrate_tranches.R b/R/script_calibrate_tranches.R
index 8a1830ed..4789db7a 100644
--- a/R/script_calibrate_tranches.R
+++ b/R/script_calibrate_tranches.R
@@ -90,7 +90,7 @@ rho <- rep(0.45, n.credit)
result <- matrix(0, 4, n.int)
for(l in 1:100){
- Rstoch <- array(0, dim=c(n.credit, n.int, ncol(SurvProb)))
+ Rstoch <- array(0, dim=c(n.credit, n.int, ncol(SurvProb)))
for(t in 1:ncol(SurvProb)){
for(i in 1:n.credit){
Rstoch[i,,t] <- stochasticrecovC(recov[i], 0, Z, w.mod, rho, defaultprob[i,t], p[i,t])
@@ -100,8 +100,8 @@ for(l in 1:100){
R <- array(0, dim=c(n.int, Ngrid, ncol(defaultprob)))
for(t in 1:ncol(defaultprob)){
S <- 1 - Rstoch[,,t]
- L[,,t] <- t(lossdistCZ(p[,t], issuerweights, S, Ngrid, 0, rho, Z, w))
- R[,,t] <- t(lossdistCZ(p[,t], issuerweights, 1-S, Ngrid, 0, rho, Z, w))
+ L[,,t] <- t(lossdistCZ(p[,t], issuerweights, S, Ngrid, 0, rho, Z))
+ R[,,t] <- t(lossdistCZ(p[,t], issuerweights, 1-S, Ngrid, 0, rho, Z))
}
for(i in 1:n.int){
result[,i] <- tranche.pvvec(Kmodified, L[i,,], R[i,,], cs)