From 7b8e1b8738a0af6e1eda52147d8d59115cfeeb55 Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Thu, 3 Mar 2016 18:00:01 -0500 Subject: update R part --- R/distrib.R | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'R') diff --git a/R/distrib.R b/R/distrib.R index 47a93a8..c6dc609 100644 --- a/R/distrib.R +++ b/R/distrib.R @@ -277,13 +277,7 @@ lossdist.prepay.joint <- function(dp, pp, w, S, N, defaultflag=FALSE){ lossdistC <- function(p, w, S, N, defaultflag=FALSE){ ## C version of lossdistrib2, roughly 50 times faster .C("lossdistrib", as.double(p), as.integer(length(p)), - as.double(w), as.double(S), as.integer(N), as.logical(defaultflag), q = double(N))$q -} - -lossdistCblas <- function(p, w, S, N, defaultflag=FALSE){ - ## C version of lossdistrib2, roughly 50 times faster - .C("lossdistrib_blas", as.double(p), as.integer(length(p)), - as.double(w), as.double(S), as.integer(N), as.logical(defaultflag), q = double(N))$q + as.double(w), as.double(S), as.integer(N), as.integer(N), as.logical(defaultflag), q = double(N))$q } lossdistCZ <- function(p, w, S, N, defaultflag=FALSE, rho, Z){ @@ -332,12 +326,6 @@ lossdistC.joint <- function(p, w, S, N, defaultflag=FALSE){ as.double(S), as.integer(N), as.logical(defaultflag), q = matrix(0, N, N))$q } -lossdistC.jointblas <- function(p, w, S, N, defaultflag=FALSE){ - ## C version of lossdistrib.joint, roughly 20 times faster - .C("lossdistrib_joint_blas", as.double(p), as.integer(length(p)), as.double(w), - as.double(S), as.integer(N), as.logical(defaultflag), q = matrix(0, N, N))$q -} - lossdistC.jointZ <- function(dp, w, S, N, defaultflag = FALSE, rho, Z, wZ){ ## N is the size of the grid ## dp is of size n.credits @@ -351,9 +339,9 @@ lossdistC.jointZ <- function(dp, w, S, N, defaultflag = FALSE, rho, Z, wZ){ as.double(Z), as.double(wZ), as.integer(length(Z)), q = matrix(0, N, N))$q } -lossdistC.prepay.jointblas <- function(dp, pp, w, S, N, defaultflag=FALSE){ +lossdistC.prepay.joint <- function(dp, pp, w, S, N, defaultflag=FALSE){ ## C version of lossdist.prepay.joint - r <- .C("lossdistrib_prepay_joint_blas", as.double(dp), as.double(pp), as.integer(length(dp)), + r <- .C("lossdistrib_prepay_joint", as.double(dp), as.double(pp), as.integer(length(dp)), as.double(w), as.double(S), as.integer(N), as.logical(defaultflag), q=matrix(0, N, N))$q return(r) } @@ -368,7 +356,7 @@ lossdistC.prepay.jointZ <- function(dp, pp, w, S, N, defaultflag = FALSE, rho, Z ## Z is a vector of length nZ ## w is a vector if length wZ - r <- .C("lossdistrib_prepay_joint_Z", as.double(dp), as.double(pp), as.integer(length(dp)), + r <- .C("lossdistrib_joint_Z", as.double(dp), as.double(pp), as.integer(length(dp)), as.double(w), as.double(S), as.integer(N), as.logical(defaultflag), as.double(rho), as.double(Z), as.double(wZ), as.integer(length(Z)), output = matrix(0,N,N)) return(r$output) -- cgit v1.2.3-70-g09d2