[Yuima-commits] r53 - in pkg/yuima: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Dec 28 08:55:42 CET 2009


Author: iacus
Date: 2009-12-28 08:55:41 +0100 (Mon, 28 Dec 2009)
New Revision: 53

Modified:
   pkg/yuima/DESCRIPTION
   pkg/yuima/R/subsampling.R
Log:
small changes to subsampling

Modified: pkg/yuima/DESCRIPTION
===================================================================
--- pkg/yuima/DESCRIPTION	2009-12-26 08:34:15 UTC (rev 52)
+++ pkg/yuima/DESCRIPTION	2009-12-28 07:55:41 UTC (rev 53)
@@ -1,8 +1,8 @@
 Package: yuima
 Type: Package
 Title: The YUIMA Project package
-Version: 0.0.82
-Date: 2010-01-01
+Version: 0.0.84
+Date: 2010-12-28
 Depends: methods, zoo, adapt
 Author: YUIMA Project Team.
 Maintainer: Stefano M. Iacus <stefano.iacus at R-project.org>

Modified: pkg/yuima/R/subsampling.R
===================================================================
--- pkg/yuima/R/subsampling.R	2009-12-26 08:34:15 UTC (rev 52)
+++ pkg/yuima/R/subsampling.R	2009-12-28 07:55:41 UTC (rev 53)
@@ -50,8 +50,12 @@
 	 if(is.logical(tmpsamp at random)){
       if(tmpsamp at random)
 		 stop("wrong random sampling specification")
+	  if(length(tmpsamp at delta) < n.data)
+		 tmpsamp at delta <- rep( tmpsamp at delta, n.data)[1:n.data]
       for(i in 1:n.data){
 		  tmpgrid[[i]] <- seq(start(Data[[i]]), end(Data[[i]]), by=tmpsamp at delta[i])
+		  tmpsamp at regular[i] <- TRUE
+		  tmpsamp at random[i] <- FALSE
 	  }
      }
 
@@ -117,13 +121,15 @@
 	  tmpsamp at Initial[i] <- start(Data[[i]])	 
 	  tmpsamp at n[i] <- length(Data[[i]])	 	 
 	 }
+	 
+	 print(str(tmpsamp))
 	 tmpsamp at oindex <- oindex
 	 tmpsamp at grid <- tmpgrid
-	 tmpsamp at regular <- all(sapply(1:n.data, function(x) sum(diff(tmpgrid[[x]]))<1e-3))
-	 if(!tmpsamp at regular)
-	  tmpsamp at delta <- numeric(0)
+	 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)  
 	 obj <- NULL
 	 tmpsamp at interpolation <- interpolation
+print(str(tmpsamp))
 	 x at zoo.data <- Data 		 
 	 obj <- setYuima(data=x, sampling=tmpsamp)
 	 return(obj)



More information about the Yuima-commits mailing list