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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jul 8 04:20:11 CEST 2016


Author: kyuta
Date: 2016-07-08 04:20:05 +0200 (Fri, 08 Jul 2016)
New Revision: 453

Modified:
   pkg/yuima/DESCRIPTION
   pkg/yuima/NEWS
   pkg/yuima/R/llag.R
   pkg/yuima/src/cce_functions.c
Log:
fixed some bugs in llag.R and cce_functions.c

Modified: pkg/yuima/DESCRIPTION
===================================================================
--- pkg/yuima/DESCRIPTION	2016-06-16 20:43:21 UTC (rev 452)
+++ pkg/yuima/DESCRIPTION	2016-07-08 02:20:05 UTC (rev 453)
@@ -1,7 +1,7 @@
 Package: yuima
 Type: Package
 Title: The YUIMA Project Package for SDEs
-Version: 1.1.0
+Version: 1.1.1
 Depends: R(>= 2.10.0), methods, zoo, stats4, utils, expm, cubature, mvtnorm
 Author: YUIMA Project Team
 Maintainer: Stefano M. Iacus <stefano.iacus at unimi.it>

Modified: pkg/yuima/NEWS
===================================================================
--- pkg/yuima/NEWS	2016-06-16 20:43:21 UTC (rev 452)
+++ pkg/yuima/NEWS	2016-07-08 02:20:05 UTC (rev 453)
@@ -39,5 +39,6 @@
                   added mllag.R, mllag.Rd (multiple lead-lag detector);
                           spectralcov.R, spectralcov.Rd (spectral covariance estimator)
 2016/01/14: modified rng.R, rng.Rd, adaBayes.Rd, qmle.Rd, setModel.Rd, spectralcov.Rd
-2016/05/26: added rpts and rnts in rng.R and the corresponding c language file
+2016/05/26: added rpts and rnts in rng.R and the corresponding c language file
+2016/07/08: fixed some bugs in llag.R and cce_functions.c
            
\ No newline at end of file

Modified: pkg/yuima/R/llag.R
===================================================================
--- pkg/yuima/R/llag.R	2016-06-16 20:43:21 UTC (rev 452)
+++ pkg/yuima/R/llag.R	2016-07-08 02:20:05 UTC (rev 453)
@@ -210,12 +210,17 @@
                                    ccor, ci, alpha, fisher, bw) {
   
   d <- length(x)
+  d.size <- d*(d-1)/2
   
   # allocate memory
   ser.times <- vector(d, mode="list") # time index in 'x'
   ser.diffX <- vector(d, mode="list") # difference of data
   vol <- double(d)
   
+  # treatment of the grid (2016-07-04: we implement this before the NA treatment)
+  if(missing(grid)) 
+    grid <- make.grid(d, d.size, x, from, to, division)
+  
   # Set the tolerance to avoid numerical erros in comparison
   tol <- 1e-6
   
@@ -239,13 +244,13 @@
   
   theta <- matrix(0,d,d)
   
-  d.size <- d*(d-1)/2
+  #d.size <- d*(d-1)/2
   crosscor <- vector(d.size,mode="list")
   idx <- integer(d.size)
   
   # treatment of the grid
-  if(missing(grid)) 
-    grid <- make.grid(d, d.size, x, from, to, division)
+  #if(missing(grid)) 
+  #  grid <- make.grid(d, d.size, x, from, to, division)
   
   if(is.list(grid)){
     G <- relist(unlist(grid)/tol, grid)

Modified: pkg/yuima/src/cce_functions.c
===================================================================
--- pkg/yuima/src/cce_functions.c	2016-06-16 20:43:21 UTC (rev 452)
+++ pkg/yuima/src/cce_functions.c	2016-07-08 02:20:05 UTC (rev 453)
@@ -372,7 +372,15 @@
         B = (*xvol + *yvol)*value[i];
         C = (*yvol)*(*yvol) + value[i]*value[i];
         
-        s = sqrt(A*C-B*B);
+        /* correct a bug (2016-06-30) */
+        /* s = sqrt(A*C-B*B); */
+        s = A*C-B*B;
+        if(s > 0){
+            s = sqrt(s);
+        }else{
+            s = 0;
+        }
+
         
         value[i] = B/sqrt((A + s)*(C + s));
         



More information about the Yuima-commits mailing list