diff options
Diffstat (limited to 'R')
| -rw-r--r-- | R/distrib.R | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/R/distrib.R b/R/distrib.R index 8b10394..277b324 100644 --- a/R/distrib.R +++ b/R/distrib.R @@ -294,10 +294,12 @@ lossdistCZ <- function(p, w, S, N, defaultflag=FALSE, rho, Z){ q = matrix(0, N, length(Z)))$q
}
-lossdistC.truncated <- function(p, w, S, N, T=N){
- ## C version of lossdistrib2, roughly 50 times faster
+lossdistC.truncated <- function(p, w, S, N, T=N, defaultflag=FALSE){
+ ## truncated version of lossdistrib
+ ## q[i] is 0 for i>=T
.C("lossdistrib_truncated", as.double(p), as.integer(length(p)),
- as.double(w), as.double(S), as.integer(N), as.integer(T), q = double(T))$q
+ as.double(w), as.double(S), as.integer(N), as.integer(T), as.logical(defaultflag),
+ q = double(N))$q
}
recovdistC <- function(dp, pp, w, S, N){
|
