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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Apr 22 10:25:26 CEST 2014


Author: iacus
Date: 2014-04-22 10:25:26 +0200 (Tue, 22 Apr 2014)
New Revision: 299

Modified:
   pkg/yuima/DESCRIPTION
   pkg/yuima/R/yuima.data.R
   pkg/yuima/man/setData.Rd
Log:
changed setData

Modified: pkg/yuima/DESCRIPTION
===================================================================
--- pkg/yuima/DESCRIPTION	2014-04-18 09:35:20 UTC (rev 298)
+++ pkg/yuima/DESCRIPTION	2014-04-22 08:25:26 UTC (rev 299)
@@ -1,8 +1,8 @@
 Package: yuima
 Type: Package
 Title: The YUIMA Project package for SDEs
-Version: 1.0.9
-Date: 2014-04-18
+Version: 1.0.10
+Date: 2014-04-22
 Depends: methods, zoo, stats4, utils, expm
 Suggests: cubature, mvtnorm
 Author: YUIMA Project Team

Modified: pkg/yuima/R/yuima.data.R
===================================================================
--- pkg/yuima/R/yuima.data.R	2014-04-18 09:35:20 UTC (rev 298)
+++ pkg/yuima/R/yuima.data.R	2014-04-22 08:25:26 UTC (rev 299)
@@ -4,13 +4,20 @@
 
  
 setMethod("initialize", "yuima.data",
-           function(.Object, original.data){
+           function(.Object, original.data, delta=NULL){
              .Object at original.data <- original.data
              if(is.list(original.data) && is.zoo(original.data[[1]])) {
                .Object at zoo.data <- original.data
              } else {
                .Object at zoo.data <- as.list(as.zoo(.Object at original.data))
 			 }
+             if(!is.null(delta)){
+                 for(i in 1:length(.Object at zoo.data)){
+                    n <- length(.Object at zoo.data[[i]])
+                    t <- seq(0, delta*n, length=n)
+                    index(.Object at zoo.data[[i]]) <- t
+                 }
+             }
              return(.Object)
            })
 
@@ -28,8 +35,8 @@
 
 # accessors
 setData <-
-  function(original.data){
-    return(new("yuima.data", original.data=original.data ))
+  function(original.data, delta=NULL){
+    return(new("yuima.data", original.data=original.data, delta=delta ))
   }
 
 

Modified: pkg/yuima/man/setData.Rd
===================================================================
--- pkg/yuima/man/setData.Rd	2014-04-18 09:35:20 UTC (rev 298)
+++ pkg/yuima/man/setData.Rd	2014-04-22 08:25:26 UTC (rev 299)
@@ -26,7 +26,7 @@
 \code{cbind.yuima} bind yuima.data object.
 }
 \usage{
-  setData(original.data)
+  setData(original.data, delta=NULL)
   get.zoo.data(x)
 }
 \arguments{  
@@ -35,6 +35,7 @@
    \code{\link{zoo}}-type. See Details.}
   \item{x}{an object of type \code{\link{yuima.data-class}} or 
   \code{\link{yuima-class}}.}
+  \item{delta}{If there is the need to redefine on the fly the \code{delta} increment of the data to make it consistent to statistical theory. See Details.}
 }
 \details{
 Objects in the  \code{\link{yuima.data-class}} contain two slots:
@@ -75,5 +76,13 @@
 plot(mysde)
 dim(mysde)
 length(mysde)
+
+# changing delta on the fly to 1/252
+mysde2 <- setYuima(data=setData(X, delta=1/252))
+str(get.zoo.data(mysde2))
+plot(mysde2)
+dim(mysde2)
+length(mysde2)
+
 }
 \keyword{ts}



More information about the Yuima-commits mailing list