diff options
| -rw-r--r-- | tranche_functions.R | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tranche_functions.R b/tranche_functions.R index 1e400cef..bb74f221 100644 --- a/tranche_functions.R +++ b/tranche_functions.R @@ -644,6 +644,7 @@ MFlossrecovdist <- function(w, Z, rho, defaultprob, defaultprobmod, issuerweight Ngrid=2*length(issuerweights)+1, defaultflag=FALSE){
## computes the loss and recovery distribution using the modified factor distribution
n.credit <- length(issuerweights)
+ n.int <- length(w)
Rstoch <- array(0, dim=c(n.int, n.credit, ncol(defaultprob)))
for(t in 1:ncol(defaultprob)){
for(i in 1:n.credit){
@@ -669,6 +670,7 @@ MFlossrecovdist.prepay <- function(w, Z, rho, defaultprob, defaultprobmod, prepa issuerweights, recov, Ngrid=2*length(issuerweights)+1, defaultflag=FALSE){
## computes the loss and recovery distribution using the modified factor distribution
n.credit <- length(issuerweights)
+ n.int <- length(w)
Rstoch <- array(0, dim=c(n.int, n.credit, ncol(defaultprob)))
for(t in 1:ncol(defaultprob)){
for(i in 1:n.credit){
@@ -699,6 +701,7 @@ MFlossdist.joint <- function(cl, w, Z, rho, defaultprob, defaultprobmod, issuerw ## if we use the persp function, losses is the axes facing us,
## and R is the axis going away from us.
n.credit <- length(issuerweights)
+ n.int <- lenth(w)
Rstoch <- array(0, dim=c(n.int, n.credit, ncol(defaultprob)))
for(t in 1:ncol(defaultprob)){
for(i in 1:n.credit){
@@ -730,6 +733,7 @@ MFlossdist.prepay.joint <- function(cl, w, Z, rho, defaultprob, defaultprobmod, ## if we use the persp function, losses is the axes facing us,
## and R is the axis going away from us.
n.credit <- length(issuerweights)
+ n.int <- length(w)
Rstoch <- array(0, dim=c(n.int, n.credit, ncol(defaultprob)))
for(t in 1:ncol(defaultprob)){
for(i in 1:n.credit){
|
