aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--R/tranche_functions.R10
1 files changed, 5 insertions, 5 deletions
diff --git a/R/tranche_functions.R b/R/tranche_functions.R
index 9ad62feb..f54a7d05 100644
--- a/R/tranche_functions.R
+++ b/R/tranche_functions.R
@@ -634,9 +634,9 @@ BClossdist <- function(defaultprob, issuerweights, recov, rho, N=length(recov)+1
w <- quadrature$weights
LZ <- matrix(0, N, n.int)
RZ <- matrix(0, N, n.int)
- L <- matrix(0, N, ncol(SurvProb))
- R <- matrix(0, N, ncol(SurvProb))
- for(t in 1:ncol(SurvProb)){
+ L <- matrix(0, N, ncol(defaultprob))
+ R <- matrix(0, N, ncol(defaultprob))
+ for(t in 1:ncol(defaultprob)){
for(i in 1:length(Z)){
g.shocked <- shockprob(defaultprob[,t], rho, Z[i])
S.shocked <- shockseverity(1-recov, 1, Z[i], rho, defaultprob[,t])
@@ -655,8 +655,8 @@ BClossdistC <- function(defaultprob, issuerweights, recov, rho, Z, w,
if(!is.loaded("BClossdist")){
dyn.load(file.path(root.dir, "code", "R", paste0("lossdistrib", .Platform$dynlib.ext)))
}
- L <- matrix(0, N, dim(SurvProb)[2])
- R <- matrix(0, N, dim(SurvProb)[2])
+ L <- matrix(0, N, dim(defaultprob)[2])
+ R <- matrix(0, N, dim(defaultprob)[2])
r <- .C("BClossdist", defaultprob, dim(defaultprob)[1], dim(defaultprob)[2],
as.double(issuerweights), as.double(recov), as.double(Z), as.double(w),
as.integer(n.int), as.double(rho), as.integer(N), as.logical(defaultflag), L=L, R=R)