[Distr-commits] r1267 - in branches/distr-2.8/pkg/distr: R inst

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Aug 10 19:37:37 CEST 2018


Author: ruckdeschel
Date: 2018-08-10 19:37:37 +0200 (Fri, 10 Aug 2018)
New Revision: 1267

Modified:
   branches/distr-2.8/pkg/distr/R/AllInitialize.R
   branches/distr-2.8/pkg/distr/inst/NEWS
Log:
[distr] branch 2.8
+ changed definition of q(DExp(..)) in initialize method in AllInitialize.R 
  from ifelse expressions to index operations  to avoid warnings 


Modified: branches/distr-2.8/pkg/distr/R/AllInitialize.R
===================================================================
--- branches/distr-2.8/pkg/distr/R/AllInitialize.R	2018-08-10 14:04:23 UTC (rev 1266)
+++ branches/distr-2.8/pkg/distr/R/AllInitialize.R	2018-08-10 17:37:37 UTC (rev 1267)
@@ -909,17 +909,12 @@
             body(.Object at q) <- substitute(
                            {  if (log.p) p <- exp(p)
                               if (!lower.tail) p <- 1-p
-                              ifelse( p <= 0.25,          
-                                  -qexp(2*p, rate = rateSub, lower.tail =FALSE),
-                                  ifelse( p <= 0.5,
-                                      -qexp(1-2*p, rate = rateSub),
-                                      ifelse( p <= 0.75   ,
-                                          qexp(2*p - 1, rate = rateSub),
-                                          qexp(2*(1-p), rate = rateSub, 
-                                               lower.tail = FALSE) 
-                                            ) 
-                                         ) 
-                                     )
+                              q0 <- p
+                              q0[p <=0.25] <- -qexp(2*p[p <=0.25], rate = rateSub, lower.tail =FALSE)
+                              q0[p>0.25&p<=.50] <- -qexp(1-2*p[p>0.25&p<=.50], rate = rateSub)
+                              q0[p>0.5&p<=.75] <- qexp(2*p[p>0.5&p<=.75] - 1, rate = rateSub)
+                              q0[p>0.75] <- qexp(2*(1-p[p>0.75]), rate = rateSub, lower.tail = FALSE)
+                              return(q0)
                            }, list(rateSub = rate)
                                           )
             .Object at .withSim   <- FALSE

Modified: branches/distr-2.8/pkg/distr/inst/NEWS
===================================================================
--- branches/distr-2.8/pkg/distr/inst/NEWS	2018-08-10 14:04:23 UTC (rev 1266)
+++ branches/distr-2.8/pkg/distr/inst/NEWS	2018-08-10 17:37:37 UTC (rev 1267)
@@ -26,7 +26,9 @@
   "true" support (not the possibly truncated one in slot support) is infinite (more precisely
   it is of length 2 -- first coordinate if the lower bound of the support is finite, second if 
   the upper bound is finite)
-
++ changed definition of q(DExp(..)) in initialize method in AllInitialize.R 
+  from ifelse expressions to index operations  to avoid warnings 
+  
 ##############
 v 2.7
 ##############



More information about the Distr-commits mailing list