diff options
| -rw-r--r-- | tranche_functions.R | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tranche_functions.R b/tranche_functions.R index 245c1301..f410081d 100644 --- a/tranche_functions.R +++ b/tranche_functions.R @@ -469,18 +469,18 @@ BClossdist <- function(SurvProb, issuerweights, recov, rho, N=length(recov)+1, }
BClossdistC <- function(SurvProb, issuerweights, recov, rho,
- N=length(issuerweights)+1, T=N, n.int=100){
+ N=length(issuerweights)+1, n.int=100){
if(!is.loaded("BClossdist")){
dyn.load(paste0("lossdistrib", .Platform$dynlib.ext))
}
quadrature <- gauss.quad.prob(n.int, "normal")
Z <- quadrature$nodes
w <- quadrature$weights
- L <- matrix(0, T, dim(SurvProb)[2])
- R <- matrix(0, T, dim(SurvProb)[2])
+ L <- matrix(0, N, dim(SurvProb)[2])
+ R <- matrix(0, N, dim(SurvProb)[2])
r <- .C("BClossdist", SurvProb, as.integer(dim(SurvProb)[1]), as.integer(dim(SurvProb)[2]),
as.double(issuerweights), as.double(recov), as.double(Z), as.double(w),
- as.integer(n.int), as.double(rho), as.integer(N), as.integer(T), L=L, R=R)
+ as.integer(n.int), as.double(rho), as.integer(N), L=L, R=R)
return(list(L=r$L,R=r$R))
}
|
