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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Apr 30 13:40:36 CEST 2014


Author: iacus
Date: 2014-04-30 13:40:36 +0200 (Wed, 30 Apr 2014)
New Revision: 311

Modified:
   pkg/yuima/DESCRIPTION
   pkg/yuima/R/cce.R
   pkg/yuima/R/llag.R
   pkg/yuima/R/yuima.R
   pkg/yuima/R/yuima.data.R
Log:
fixed cce, llag, ecc

Modified: pkg/yuima/DESCRIPTION
===================================================================
--- pkg/yuima/DESCRIPTION	2014-04-30 04:56:14 UTC (rev 310)
+++ pkg/yuima/DESCRIPTION	2014-04-30 11:40:36 UTC (rev 311)
@@ -1,7 +1,7 @@
 Package: yuima
 Type: Package
 Title: The YUIMA Project package for SDEs
-Version: 1.0.17
+Version: 1.0.18
 Date: 2014-04-30
 Depends: methods, zoo, stats4, utils, expm
 Suggests: cubature, mvtnorm

Modified: pkg/yuima/R/cce.R
===================================================================
--- pkg/yuima/R/cce.R	2014-04-30 04:56:14 UTC (rev 310)
+++ pkg/yuima/R/cce.R	2014-04-30 11:40:36 UTC (rev 311)
@@ -2646,6 +2646,9 @@
 }else{
   cormat <- as.matrix(1)
 }
-
+rownames(cmat) <- names(data)
+colnames(cmat) <- names(data)
+rownames(cormat) <- names(data)
+colnames(cormat) <- names(data)
 return(list(covmat=cmat,cormat=cormat))
 })

Modified: pkg/yuima/R/llag.R
===================================================================
--- pkg/yuima/R/llag.R	2014-04-30 04:56:14 UTC (rev 310)
+++ pkg/yuima/R/llag.R	2014-04-30 11:40:36 UTC (rev 311)
@@ -204,8 +204,14 @@
   }
   
   cormat <- diag(1/sqrt(diag(covmat)))%*%covmat%*%diag(1/sqrt(diag(covmat)))
-  
+  colnames(theta) <- names(zdata)
+  rownames(theta) <- names(zdata)
+
   if(verbose==TRUE){
+    colnames(covmat) <- names(zdata)
+    rownames(covmat) <- names(zdata)
+    colnames(cormat) <- names(zdata)
+    rownames(cormat) <- names(zdata)
     return(list(lagcce=theta,covmat=covmat,cormat=cormat,crosscov=crosscov))
   }else{
     return(theta)
@@ -353,7 +359,6 @@
   
   #  covmat <- lagcce(dat at zoo.data,theta)
   cormat <- diag(1/sqrt(diag(covmat)))%*%covmat%*%diag(1/sqrt(diag(covmat)))
-  
   if(verbose==TRUE){
     return(list(lagcce=theta,covmat=covmat,cormat=cormat))
   }else{

Modified: pkg/yuima/R/yuima.R
===================================================================
--- pkg/yuima/R/yuima.R	2014-04-30 04:56:14 UTC (rev 310)
+++ pkg/yuima/R/yuima.R	2014-04-30 11:40:36 UTC (rev 311)
@@ -352,7 +352,12 @@
         
         delta <- NULL
         for(i in 1:n.series){
-            tmp <- deltat(object at data@zoo.data[[i]])
+            tmp <- length(table(round(diff(time(object at data@zoo.data[[i]]),5))))
+            if(tmp>1){
+             tmp <- NULL
+            } else {
+             tmp <- diff(time(object at data@zoo.data[[i]]))[1]
+            }
             if(is.null(tmp)){
                 delta <- c(delta, NA)
             } else {
@@ -363,7 +368,12 @@
         
         cat(sprintf("\n\nNumber of zoo time series: %d\n", n.series))
         tmp <- data.frame(length=n.length, time.min = t.min, time.max =t.max, delta=delta)
-        rownames(tmp) <- sprintf("Series %d",1:n.series)
+        nm <- names(object at data@zoo.data)
+        if(is.null(nm)){
+         rownames(tmp) <- sprintf("Series %d",1:n.series)
+        } else {
+         rownames(tmp) <- nm
+        }
         print(tmp)
     }
     

Modified: pkg/yuima/R/yuima.data.R
===================================================================
--- pkg/yuima/R/yuima.data.R	2014-04-30 04:56:14 UTC (rev 310)
+++ pkg/yuima/R/yuima.data.R	2014-04-30 11:40:36 UTC (rev 311)
@@ -12,9 +12,10 @@
                .Object at zoo.data <- as.list(as.zoo(.Object at original.data))
 			 }
              if(!is.null(delta)){
+                 delta <- rep(delta, length(.Object at zoo.data))
                  for(i in 1:length(.Object at zoo.data)){
                     n <- length(.Object at zoo.data[[i]])
-                    t <- seq(0, delta*n, length=n)
+                    t <- seq(0, delta[i]*n, length=n)
                     index(.Object at zoo.data[[i]]) <- t
                  }
              }



More information about the Yuima-commits mailing list