[Distr-commits] r1356 - in branches/distr-2.9/pkg/distr: R inst

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Feb 1 10:06:07 CET 2020


Author: ruckdeschel
Date: 2020-02-01 10:06:07 +0100 (Sat, 01 Feb 2020)
New Revision: 1356

Modified:
   branches/distr-2.9/pkg/distr/R/internalUtils_LCD.R
   branches/distr-2.9/pkg/distr/inst/NEWS
Log:
[distr] branch 2.9: 
 triggered by an email by Santhosh V <Santhosh.V at se.com>, we added a patch to be more careful when producing slot q for compound and mixing distributions


Modified: branches/distr-2.9/pkg/distr/R/internalUtils_LCD.R
===================================================================
--- branches/distr-2.9/pkg/distr/R/internalUtils_LCD.R	2020-01-19 20:57:52 UTC (rev 1355)
+++ branches/distr-2.9/pkg/distr/R/internalUtils_LCD.R	2020-02-01 09:06:07 UTC (rev 1356)
@@ -201,14 +201,27 @@
     qL1 <- as.vector(unlist(lapply(mixDistr, function(x)
                          do.call(x at q,list(p = getdistrOption("TruncQuantile"),
                                  lower.tail = TRUE)))))
-    qL  <- min(qL0); ql <- min(qL1)
 
+## start patch 20200131 : in the last line added na.rm=TRUE
+    qL1[!is.finite(qL1)] <- NA
+    if(all(is.na(qL1))) qL1[1] <- Inf
+    if(all(is.na(qL))) qL[1] <- Inf
+    qL  <- min(qL0, na.rm = TRUE); ql <- min(qL1, na.rm = TRUE)
+## end patch 20200131
+
     qU0 <- as.vector(unlist(lapply(mixDistr, function(x)
                          do.call(x at q,list(p = 0, lower.tail = FALSE)))))
     qU1 <- as.vector(unlist(lapply(mixDistr, function(x)
                          do.call(x at q,list(p = getdistrOption("TruncQuantile"),
                                  lower.tail = FALSE)))))
-    qU  <- max(qU0); qu <- max(qU1)
+
+## start patch 20200131 : in the last line added na.rm=TRUE
+    qU1[!is.finite(qU1)] <- NA
+    if(all(is.na(qU1))) qU1[1] <- -Inf
+    if(all(is.na(qU))) qU[1] <- -Inf
+    qU  <- max(qU0, na.rm = TRUE); qu <- max(qU1, na.rm = TRUE)
+## end patch 20200131
+
     return(list(qL = qL, ql = ql, qU = qU, qu = qu))
     }
 

Modified: branches/distr-2.9/pkg/distr/inst/NEWS
===================================================================
--- branches/distr-2.9/pkg/distr/inst/NEWS	2020-01-19 20:57:52 UTC (rev 1355)
+++ branches/distr-2.9/pkg/distr/inst/NEWS	2020-02-01 09:06:07 UTC (rev 1356)
@@ -17,6 +17,8 @@
   detected by Elio Campitelli <elio.campitelli at cima.fcen.uba.ar>
 
 under the hood:
++ triggered by an email by Santhosh V <Santhosh.V at se.com>, we added a patch to be more careful when producing
+  slot q for compound and mixing distributions
 
 ##############
 v 2.8



More information about the Distr-commits mailing list