[Yuima-commits] r55 - pkg/yuima/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Dec 29 02:32:45 CET 2009


Author: iacus
Date: 2009-12-29 02:32:41 +0100 (Tue, 29 Dec 2009)
New Revision: 55

Modified:
   pkg/yuima/R/subsampling.R
   pkg/yuima/R/yuima.sampling.R
Log:
subsampling fixing

Modified: pkg/yuima/R/subsampling.R
===================================================================
--- pkg/yuima/R/subsampling.R	2009-12-28 07:57:30 UTC (rev 54)
+++ pkg/yuima/R/subsampling.R	2009-12-29 01:32:41 UTC (rev 55)
@@ -125,8 +125,8 @@
 
 	 tmpsamp at oindex <- oindex
 	 tmpsamp at grid <- tmpgrid
-	 tmpsamp at regular <- sapply(1:n.data, function(x) sum(diff(diff(tmpgrid[[x]])))<1e-3)
-	 tmpsamp at delta[which(!tmpsamp at regular)] <- numeric(0)  
+	 tmpsamp at regular <- sapply(1:n.data, function(x) sum(abs(diff(diff(tmpgrid[[x]]))))<1e-3)
+	 tmpsamp at delta <- sapply(1:n.data, function(x) ifelse(tmpsamp at regular[x], diff(tmpgrid[[x]])[1],  numeric(0)))
 	 obj <- NULL
 	 tmpsamp at interpolation <- interpolation
 

Modified: pkg/yuima/R/yuima.sampling.R
===================================================================
--- pkg/yuima/R/yuima.sampling.R	2009-12-28 07:57:30 UTC (rev 54)
+++ pkg/yuima/R/yuima.sampling.R	2009-12-29 01:32:41 UTC (rev 55)
@@ -4,6 +4,9 @@
 # we convert objects to "zoo" internally
 
  
+
+
+
 setMethod("initialize", "yuima.sampling",
            function(.Object, Initial, Terminal, n, delta, grid, random, 
 				 regular, sdelta, sgrid, oindex, interpolation){  
@@ -11,7 +14,8 @@
 				.Object at sgrid <- as.numeric(NULL) 	 
 				.Object at oindex <- as.numeric(NULL) 	 
 				.Object at interpolation <- interpolation 	 
-			   if(length(grid)>0){
+# grid given                 
+				 if(length(grid)>0){
 				   testInitial<-(min(grid)==Initial)
 				   testTerminal<-(max(grid)==Terminal)
 				   testn<-(abs(n-diff(range(grid))/mean(diff(grid))+1)<10^(-10))



More information about the Yuima-commits mailing list