[Distr-commits] r930 - branches/distr-2.6/pkg/distr/R pkg/distr/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Feb 18 19:45:32 CET 2014


Author: ruckdeschel
Date: 2014-02-18 19:45:31 +0100 (Tue, 18 Feb 2014)
New Revision: 930

Modified:
   branches/distr-2.6/pkg/distr/R/LatticeDistribution.R
   pkg/distr/R/LatticeDistribution.R
Log:
bug fix in LatticeDistribution.R, bug found by Mikhail.Spivakov at babraham.ac.uk; still checks needed

Modified: branches/distr-2.6/pkg/distr/R/LatticeDistribution.R
===================================================================
--- branches/distr-2.6/pkg/distr/R/LatticeDistribution.R	2013-12-04 11:02:11 UTC (rev 929)
+++ branches/distr-2.6/pkg/distr/R/LatticeDistribution.R	2014-02-18 18:45:31 UTC (rev 930)
@@ -247,15 +247,16 @@
                      e0 <- LatticeDistribution(supp = sup00, prob = pr0, 
                                                lattice = lat, check = FALSE)           
                      if(L.inf){
-                         e0 at lattice <- if(L.lr>0){ 
-                            Lattice(pivot = su12.l, width = wa, Length = Inf) 
+                         wa <- .getCommonWidth(abs(w1),abs(w2), tol=tol0)
+                         e0 at lattice <- if(L.lr>0){
+                            Lattice(pivot = su12.l, width = wa, Length = Inf)
                                 }else{ 
                             Lattice(pivot = su12.r, width = -wa, Length = Inf)}
                      }       
                }
  
             ## step 1 common width
-            wa <- .getCommonWidth(abs(w1),abs(w2),
+              wa <- .getCommonWidth(abs(w1),abs(w2),
                       tol=tol0)
 
 
@@ -269,7 +270,8 @@
             pi1 <- pivot(lat1)
             pi2 <- pivot(lat2)                        
             ### Step 2
-            supp0 <- seq(by = wa, from = min(sup1-pi1, sup2-pi2), to = max(sup1-pi1, sup2-pi2))
+            supp0 <- seq(by = wa, from = min(sup1-pi1, sup2-pi2),
+                                  to = max(sup1-pi1, sup2-pi2))
             s1 <- .inWithTol(supp0,sup1-pi1,tol0)
             s2 <- .inWithTol(supp0,sup2-pi2,tol0)
             d1 <- d2 <- 0*supp0

Modified: pkg/distr/R/LatticeDistribution.R
===================================================================
--- pkg/distr/R/LatticeDistribution.R	2013-12-04 11:02:11 UTC (rev 929)
+++ pkg/distr/R/LatticeDistribution.R	2014-02-18 18:45:31 UTC (rev 930)
@@ -247,15 +247,16 @@
                      e0 <- LatticeDistribution(supp = sup00, prob = pr0, 
                                                lattice = lat, check = FALSE)           
                      if(L.inf){
-                         e0 at lattice <- if(L.lr>0){ 
-                            Lattice(pivot = su12.l, width = wa, Length = Inf) 
+                         wa <- .getCommonWidth(abs(w1),abs(w2), tol=tol0)
+                         e0 at lattice <- if(L.lr>0){
+                            Lattice(pivot = su12.l, width = wa, Length = Inf)
                                 }else{ 
                             Lattice(pivot = su12.r, width = -wa, Length = Inf)}
                      }       
                }
  
             ## step 1 common width
-            wa <- .getCommonWidth(abs(w1),abs(w2),
+              wa <- .getCommonWidth(abs(w1),abs(w2),
                       tol=tol0)
 
 
@@ -269,7 +270,8 @@
             pi1 <- pivot(lat1)
             pi2 <- pivot(lat2)                        
             ### Step 2
-            supp0 <- seq(by = wa, from = min(sup1-pi1, sup2-pi2), to = max(sup1-pi1, sup2-pi2))
+            supp0 <- seq(by = wa, from = min(sup1-pi1, sup2-pi2),
+                                  to = max(sup1-pi1, sup2-pi2))
             s1 <- .inWithTol(supp0,sup1-pi1,tol0)
             s2 <- .inWithTol(supp0,sup2-pi2,tol0)
             d1 <- d2 <- 0*supp0



More information about the Distr-commits mailing list