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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Oct 1 00:35:39 CEST 2010


Author: hinohide
Date: 2010-10-01 00:35:39 +0200 (Fri, 01 Oct 2010)
New Revision: 128

Modified:
   pkg/yuima/DESCRIPTION
   pkg/yuima/NEWS
   pkg/yuima/R/cce.R
   pkg/yuima/man/cce.Rd
Log:
cce allows list style argument

Modified: pkg/yuima/DESCRIPTION
===================================================================
--- pkg/yuima/DESCRIPTION	2010-09-28 11:19:34 UTC (rev 127)
+++ pkg/yuima/DESCRIPTION	2010-09-30 22:35:39 UTC (rev 128)
@@ -1,8 +1,8 @@
 Package: yuima
 Type: Package
 Title: The YUIMA Project package (unstable version)
-Version: 0.1.176
-Date: 2010-09-28
+Version: 0.1.177
+Date: 2010-10-01
 Depends: methods, zoo, stats4, utils
 Suggests: cubature, mvtnorm
 Author: YUIMA Project Team.

Modified: pkg/yuima/NEWS
===================================================================
--- pkg/yuima/NEWS	2010-09-28 11:19:34 UTC (rev 127)
+++ pkg/yuima/NEWS	2010-09-30 22:35:39 UTC (rev 128)
@@ -1,3 +1,7 @@
+Changes in Version 0.1.177
+  o cce is now able to accept list style argument.
+
+
 Changes in Version 0.1.14
   o added yuima.cbind function to bind yuima.data object by column.
 

Modified: pkg/yuima/R/cce.R
===================================================================
--- pkg/yuima/R/cce.R	2010-09-28 11:19:34 UTC (rev 127)
+++ pkg/yuima/R/cce.R	2010-09-30 22:35:39 UTC (rev 128)
@@ -8,7 +8,7 @@
 
 setGeneric( "cce", function(x) standardGeneric("cce") )
 
-setMethod("cce", "yuima", function(x) cce(x at data) ) 
+setMethod("cce", "yuima", function(x) cce(x at data) )
 
 setMethod("cce", "yuima.data", function(x) {  
 	
@@ -79,8 +79,25 @@
 		}
 		
 	}
+	return( cmat )            
+})
 
-    sdmat <- diag(sqrt(diag(cmat)))
-    cormat <- solve(sdmat) %*% cmat %*% solve(sdmat)
-	return( list(covmat=cmat,cormat=cormat)  )
+##:: add 2010/09/19 for list data handling
+setMethod("cce", "list", function(x){
+  ##:: init
+  cce.result <- list()
+  
+  ##:: error check and  run cce
+  for( i in 1:length(x) ){
+    if(class(x[[i]])=="yuima" || class(x[[i]])=="yuima.data"){
+      cce.result[[i]] <- cce(x[[i]])
+    }else{
+      stop("Objects in list-class must be yuima-class or yuima.data-class.")
+    }
+  }  
+
+  ##:: return result
+  names(cce.result) <- names(x)
+  return(cce.result)
+  
 })

Modified: pkg/yuima/man/cce.Rd
===================================================================
--- pkg/yuima/man/cce.Rd	2010-09-28 11:19:34 UTC (rev 127)
+++ pkg/yuima/man/cce.Rd	2010-09-30 22:35:39 UTC (rev 128)
@@ -1,6 +1,6 @@
 \name{cce}
 \alias{cce}
-
+\alias{cce,list-method}
 \title{Nonsynchronous Cumulative Covariance Estimator}
 \description{
 This function estimates the covariance between two Ito processes when they are
@@ -53,7 +53,8 @@
 psample<- poisson.random.sampling(yuima, rate = c(0.2,0.3), n = 1000) 
 
 ## cce takes the psample and returns an estimate of the quadratic covariation. 
-cce(psample)$covmat[1, 2] 
+#cce(psample)$covmat[1, 2]
+cce(psample)[1, 2]
 
 ## True value of the quadratic covariation.
 cc.theta <- function(T, sigma1, sigma2, rho) { 



More information about the Yuima-commits mailing list