[Pomp-commits] r385 - in pkg: . R man src tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Oct 18 17:58:27 CEST 2010


Author: kingaa
Date: 2010-10-18 17:58:27 +0200 (Mon, 18 Oct 2010)
New Revision: 385

Modified:
   pkg/DESCRIPTION
   pkg/R/basic-probes.R
   pkg/man/basic-probes.Rd
   pkg/src/probe_acf.c
   pkg/src/probe_ccf.c
   pkg/tests/ou2-probe.R
   pkg/tests/ou2-probe.Rout.save
   pkg/tests/ricker-probe.R
   pkg/tests/ricker-probe.Rout.save
Log:

- change interface to 'probe.acf': now any positive lags can be specified
- rearrange 'probe_acf.c' and 'probe_ccf.c' cosmetically


Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2010-10-18 13:36:48 UTC (rev 384)
+++ pkg/DESCRIPTION	2010-10-18 15:58:27 UTC (rev 385)
@@ -1,8 +1,8 @@
 Package: pomp
 Type: Package
 Title: Statistical inference for partially observed Markov processes
-Version: 0.34-2
-Date: 2010-10-10
+Version: 0.34-3
+Date: 2010-10-18
 Author: Aaron A. King, Edward L. Ionides, Carles Breto, Steve Ellner, Bruce Kendall, Helen Wearing, 
 	Matthew J. Ferrari, Michael Lavine, Daniel C. Reuman
 Maintainer: Aaron A. King <kingaa at umich.edu>

Modified: pkg/R/basic-probes.R
===================================================================
--- pkg/R/basic-probes.R	2010-10-18 13:36:48 UTC (rev 384)
+++ pkg/R/basic-probes.R	2010-10-18 15:58:27 UTC (rev 385)
@@ -108,14 +108,18 @@
   }
 }
 
-probe.acf <- function (var, lag.max, type = c("covariance", "correlation"), transform = identity) {
+probe.acf <- function (var, lags, type = c("covariance", "correlation"), transform = identity) {
   type <- match.arg(type)
   transform <- match.fun(transform)
   corr <- type=="correlation"
+  if (corr && any(lags==0)) {
+    warning("useless zero lag discarded in ",sQuote("probe.acf"))
+    lags <- lags[lags!=0]
+  }
   function (y) .Call(
                      probe_acf,
                      x=transform(y[var,,drop=FALSE]),
-                     lag_max=lag.max,
+                     lags=lags,
                      corr=corr
                      )
 }

Modified: pkg/man/basic-probes.Rd
===================================================================
--- pkg/man/basic-probes.Rd	2010-10-18 13:36:48 UTC (rev 384)
+++ pkg/man/basic-probes.Rd	2010-10-18 15:58:27 UTC (rev 385)
@@ -22,7 +22,7 @@
 probe.sd(var, transform = identity, na.rm = TRUE)
 probe.marginal(var, ref, order = 3, diff = 1, transform = identity)
 probe.nlar(var, lags, powers, transform = identity)
-probe.acf(var, lag.max, type = c("covariance", "correlation"),
+probe.acf(var, lags, type = c("covariance", "correlation"),
           transform = identity)
 probe.ccf(vars, lags, transform = identity)
 probe.period(var, kernel.width, transform = identity)
@@ -48,9 +48,6 @@
   \item{prob}{
     a single probability; the quantile to compute: see \code{\link{quantile}}.
   }
-  \item{lag.max}{
-    The maximum lag at which the ACF is computed.
-  }
   \item{lags}{
     In \code{probe.ccf}, a vector of lags between time series.
     Positive lags correspond to \code{x} advanced relative to \code{y};
@@ -112,8 +109,8 @@
     }
     \item{\code{probe.acf}}{
       returns a function that,
-      if \code{type=="covariance"}, computes the autocovariance function of variable \code{var} at lags 0 through \code{lag.max};
-      if \code{type=="correlation"}, computes the autocorrelation function of variable \code{var} at lags 1 through \code{lag.max}.
+      if \code{type=="covariance"}, computes the autocovariance function of variable \code{var} at lags \code{lags};
+      if \code{type=="correlation"}, computes the autocorrelation function of variable \code{var} at lags \code{lags}.
     }
     \item{\code{probe.cov}, \code{probe.cor}}{
       return functions that compute the covariance and correlation, respectively, between the two variables named in \code{vars} at relative lag \code{lag}.}

Modified: pkg/src/probe_acf.c
===================================================================
--- pkg/src/probe_acf.c	2010-10-18 13:36:48 UTC (rev 384)
+++ pkg/src/probe_acf.c	2010-10-18 15:58:27 UTC (rev 385)
@@ -3,67 +3,14 @@
 #include "pomp_internal.h"
 #include <stdio.h>
 
-static void pomp_acf (double *acf, double *x, int n, int nvars, int maxlag, int correlation);
-
-SEXP probe_acf (SEXP x, SEXP lag_max, SEXP corr) {
-  int nprotect = 0;
-  SEXP acf, acf_names, cacf;
-  SEXP X, X_names;
-  int maxlag, correlation, nvars, n;
-  int j, k, l;
-  double *p, *p1;
-  char tmp[BUFSIZ], *nm;
-
-  maxlag = *(INTEGER(AS_INTEGER(lag_max)));    // maximum lag
-  correlation = *(INTEGER(AS_INTEGER(corr))); // correlation, or covariance?
-
-  nvars = INTEGER(GET_DIM(x))[0]; 	// nvars = # of variables
-  n = INTEGER(GET_DIM(x))[1];		// n = # of observations
-
-  PROTECT(X = duplicate(AS_NUMERIC(x))); nprotect++; 
-  PROTECT(X_names = GET_ROWNAMES(GET_DIMNAMES(x))); nprotect++;
-   
-  PROTECT(acf = NEW_NUMERIC((maxlag+1)*nvars)); nprotect++;
-
-  pomp_acf(REAL(acf),REAL(X),n,nvars,maxlag,correlation);
-  
-  if (correlation) {
-    PROTECT(cacf = NEW_NUMERIC(maxlag*nvars)); nprotect++;
-    PROTECT(acf_names = NEW_STRING(maxlag*nvars)); nprotect++;
-    for (j = 0, l = 0, p = REAL(cacf), p1 = REAL(acf)+1; j < nvars; j++, p1++) {
-      for (k = 1; k <= maxlag; k++, p++, p1++, l++) {
-	*p = *p1;		// copy correlations from acf into cacf
-	nm = (char *) CHARACTER_DATA(STRING_ELT(X_names,j));
-	snprintf(tmp,BUFSIZ,"acf.%d.%s",k,nm);
-	SET_STRING_ELT(acf_names,l,mkChar(tmp));
-      }
-    }
-    SET_NAMES(cacf,acf_names);
-  } else {
-    PROTECT(acf_names = NEW_STRING((maxlag+1)*nvars)); nprotect++;
-    for (j = 0, l = 0; j < nvars; j++) {
-      for (k = 0; k <= maxlag; k++, l++) {
-	nm = (char *) CHARACTER_DATA(STRING_ELT(X_names,j));
-	snprintf(tmp,BUFSIZ,"acf.%d.%s",k,nm);
-	SET_STRING_ELT(acf_names,l,mkChar(tmp));
-      }
-    }
-    SET_NAMES(acf,acf_names);
-  }
-
-  UNPROTECT(nprotect);
-  if (correlation) return(cacf); 
-  else return(acf);
-}
-
 // vectorized routine for ACF calculation
 // thanks to Simon N. Wood for the original version of this code
 // modifications due to AAK
 // note that the behavior of this ACF is slightly different from that of R's 'acf' function
 // we first center the series and then compute means of products
-static void pomp_acf (double *acf, double *x, int n, int nvars, int maxlag, int correlation) {
+static void pomp_acf (double *acf, double *x, int n, int nvars, int *lags, int nlag) {
   double xx, *p, *p0, *p1, *p2;
-  int j, k, lag, ct;
+  int i, j, k, lag, ct;
 
   // first center each row
   for (j = 0, p = x; j < nvars; j++, p++) {
@@ -81,7 +28,8 @@
 
   // compute covariances
   for (j = 0, p0 = x, p = acf; j < nvars; j++, p0++) { // loop over series
-    for (lag = 0; lag <= maxlag; lag++, p++) { // loop over lags
+    for (i = 0; i < nlag; i++, p++) { // loop over lags
+      lag = lags[i];		      // i-th lag
       for (k = 0, ct = 0, xx = 0, p1 = p0, p2 = p0+lag*nvars; k < n-lag; k++, p1 += nvars, p2 += nvars)
   	if (R_FINITE(*p1) && R_FINITE(*p2)) {
   	  xx += (*p1)*(*p2);
@@ -91,10 +39,52 @@
     }
   }
   
-  // convert to correlations if desired
-  if (correlation) 
-    for (j = 0, p = acf; j < nvars; j++, p += maxlag+1)
-      for (lag = 0, p0 = p, xx = *p; lag <= maxlag; lag++, p0++) 
-	*p0 /= xx;
+}
 
+SEXP probe_acf (SEXP x, SEXP lags, SEXP corr) {
+  int nprotect = 0;
+  SEXP ans, ans_names;
+  SEXP X, X_names, cov;
+  int nlag, correlation, nvars, n;
+  int j, k, l;
+  double *p, *p1;
+  int *lag;
+  char tmp[BUFSIZ], *nm;
+
+  PROTECT(lags = AS_INTEGER(lags)); nprotect++;
+  nlag = LENGTH(lags);			      // number of lags
+  lag = INTEGER(lags);
+  correlation = *(INTEGER(AS_INTEGER(corr))); // correlation, or covariance?
+
+  nvars = INTEGER(GET_DIM(x))[0]; 	// nvars = # of variables
+  n = INTEGER(GET_DIM(x))[1];		// n = # of observations
+
+  PROTECT(X = duplicate(AS_NUMERIC(x))); nprotect++; 
+  PROTECT(X_names = GET_ROWNAMES(GET_DIMNAMES(x))); nprotect++;
+   
+  PROTECT(ans = NEW_NUMERIC(nlag*nvars)); nprotect++;
+
+  pomp_acf(REAL(ans),REAL(X),n,nvars,lag,nlag);
+
+  if (correlation) {
+    l = 0;
+    PROTECT(cov = NEW_NUMERIC(nvars)); nprotect++;
+    pomp_acf(REAL(cov),REAL(X),n,nvars,&l,1); // compute lag-0 covariance
+    for (j = 0, p = REAL(ans), p1 = REAL(cov); j < nvars; j++, p1++)
+      for (k = 0; k < nlag; k++, p++)
+	*p /= *p1;
+  }
+  
+  PROTECT(ans_names = NEW_STRING(nlag*nvars)); nprotect++;
+  for (j = 0, l = 0; j < nvars; j++) {
+    for (k = 0; k < nlag; k++, l++) {
+      nm = (char *) CHARACTER_DATA(STRING_ELT(X_names,j));
+      snprintf(tmp,BUFSIZ,"acf.%d.%s",lag[k],nm);
+      SET_STRING_ELT(ans_names,l,mkChar(tmp));
+    }
+  }
+  SET_NAMES(ans,ans_names);
+
+  UNPROTECT(nprotect);
+  return ans;
 }

Modified: pkg/src/probe_ccf.c
===================================================================
--- pkg/src/probe_ccf.c	2010-10-18 13:36:48 UTC (rev 384)
+++ pkg/src/probe_ccf.c	2010-10-18 15:58:27 UTC (rev 385)
@@ -3,41 +3,6 @@
 #include "pomp_internal.h"
 #include <stdio.h>
 
-static void pomp_ccf_compute (double *ccf, double *x, double *y, int n, int *lags, int nlag);
-
-SEXP probe_ccf (SEXP x, SEXP y, SEXP lags) {
-  int nprotect = 0;
-  SEXP ccf, ccf_names;
-  SEXP X, Y;
-  int nlag, n;
-  int k;
-  char tmp[BUFSIZ], *nm;
-  
-  nlag = LENGTH(lags);
-  PROTECT(lags = AS_INTEGER(lags)); nprotect++;
-
-  n = LENGTH(x);		// n = # of observations
-  if (n != LENGTH(y))
-    error("'x' and 'y' must have equal lengths");
-
-  PROTECT(X = duplicate(AS_NUMERIC(x))); nprotect++; 
-  PROTECT(Y = duplicate(AS_NUMERIC(y))); nprotect++; 
-   
-  PROTECT(ccf = NEW_NUMERIC(nlag)); nprotect++;
-
-  pomp_ccf_compute(REAL(ccf),REAL(X),REAL(Y),n,INTEGER(lags),nlag);
-  
-  PROTECT(ccf_names = NEW_STRING(nlag)); nprotect++;
-  for (k = 0; k < nlag; k++) {
-    snprintf(tmp,BUFSIZ,"ccf.%d",INTEGER(lags)[k]);
-    SET_STRING_ELT(ccf_names,k,mkChar(tmp));
-  }
-  SET_NAMES(ccf,ccf_names);
-
-  UNPROTECT(nprotect);
-  return ccf;
-}
-
 // vectorized routine for CCF calculation
 // we first center the series and then compute means of products
 static void pomp_ccf_compute (double *ccf, double *x, double *y, int n, int *lags, int nlag) {
@@ -89,3 +54,37 @@
   }
   
 }
+
+SEXP probe_ccf (SEXP x, SEXP y, SEXP lags) {
+  int nprotect = 0;
+  SEXP ccf, ccf_names;
+  SEXP X, Y;
+  int nlag, n;
+  int k;
+  char tmp[BUFSIZ], *nm;
+  
+  nlag = LENGTH(lags);
+  PROTECT(lags = AS_INTEGER(lags)); nprotect++;
+
+  n = LENGTH(x);		// n = # of observations
+  if (n != LENGTH(y))
+    error("'x' and 'y' must have equal lengths");
+
+  PROTECT(X = duplicate(AS_NUMERIC(x))); nprotect++; 
+  PROTECT(Y = duplicate(AS_NUMERIC(y))); nprotect++; 
+   
+  PROTECT(ccf = NEW_NUMERIC(nlag)); nprotect++;
+
+  pomp_ccf_compute(REAL(ccf),REAL(X),REAL(Y),n,INTEGER(lags),nlag);
+  
+  PROTECT(ccf_names = NEW_STRING(nlag)); nprotect++;
+  for (k = 0; k < nlag; k++) {
+    snprintf(tmp,BUFSIZ,"ccf.%d",INTEGER(lags)[k]);
+    SET_STRING_ELT(ccf_names,k,mkChar(tmp));
+  }
+  SET_NAMES(ccf,ccf_names);
+
+  UNPROTECT(nprotect);
+  return ccf;
+}
+

Modified: pkg/tests/ou2-probe.R
===================================================================
--- pkg/tests/ou2-probe.R	2010-10-18 13:36:48 UTC (rev 384)
+++ pkg/tests/ou2-probe.R	2010-10-18 15:58:27 UTC (rev 385)
@@ -39,8 +39,8 @@
 pm.ou2 <- probe(
                 ou2,
                 probes=list(
-                  y1acf=probe.acf(var="y1",lag.max=2,type="corr"),
-                  y2acf=probe.acf(var=c("y2"),lag.max=2),
+                  y1acf=probe.acf(var="y1",lags=c(0,1,2),type="corr"),
+                  y2acf=probe.acf(var=c("y2"),lags=c(0,1,2)),
                   y12ccf=probe.ccf(var=c("y2","y1"),lags=c(3,8))
                   ),
                 nsim=500
@@ -52,7 +52,7 @@
             ou2,
             probes=list(
               y1=probe.quantile(var="y1",prob=seq(0.1,0.9,by=0.1)),
-              probe.acf(var=c("y1","y2"),lag.max=4,transform=identity),
+              probe.acf(var=c("y1","y2"),lags=c(0,1,4,7),transform=identity),
               pd=probe.period(var="y1",kernel.width=3)
               ),
             nsim=200
@@ -67,7 +67,7 @@
 pb <- probe(
             po,
             probes=list(
-              probe.acf(var=c("y1","y2"),lag.max=1,type="cor"),
+              probe.acf(var=c("y1","y2"),lags=c(0,1),type="cor"),
               probe.nlar("y1",lags=1,powers=1),
               probe.nlar("y2",lags=1,powers=1)
               ),
@@ -86,7 +86,7 @@
 pb <- probe(
             po,
             probes=list(
-              probe.acf(var=c("y1"),lag.max=2,type="cov"),
+              probe.acf(var=c("y1"),lags=c(0,1,2),type="cov"),
               probe.ccf(vars=c("y1","y1"),lags=c(0,1,2))
               ),
             nsim=1000,

Modified: pkg/tests/ou2-probe.Rout.save
===================================================================
--- pkg/tests/ou2-probe.Rout.save	2010-10-18 13:36:48 UTC (rev 384)
+++ pkg/tests/ou2-probe.Rout.save	2010-10-18 15:58:27 UTC (rev 385)
@@ -86,12 +86,15 @@
 > pm.ou2 <- probe(
 +                 ou2,
 +                 probes=list(
-+                   y1acf=probe.acf(var="y1",lag.max=2,type="corr"),
-+                   y2acf=probe.acf(var=c("y2"),lag.max=2),
++                   y1acf=probe.acf(var="y1",lags=c(0,1,2),type="corr"),
++                   y2acf=probe.acf(var=c("y2"),lags=c(0,1,2)),
 +                   y12ccf=probe.ccf(var=c("y2","y1"),lags=c(3,8))
 +                   ),
 +                 nsim=500
 +                 )
+Warning message:
+In probe.acf(var = "y1", lags = c(0, 1, 2), type = "corr") :
+  useless zero lag discarded in 'probe.acf'
 >                 
 > summary(pm.ou2)
 $coef
@@ -118,7 +121,7 @@
 +             ou2,
 +             probes=list(
 +               y1=probe.quantile(var="y1",prob=seq(0.1,0.9,by=0.1)),
-+               probe.acf(var=c("y1","y2"),lag.max=4,transform=identity),
++               probe.acf(var=c("y1","y2"),lags=c(0,1,4,7),transform=identity),
 +               pd=probe.period(var="y1",kernel.width=3)
 +               ),
 +             nsim=200
@@ -134,18 +137,18 @@
 $quantiles
   y1.10%   y1.20%   y1.30%   y1.40%   y1.50%   y1.60%   y1.70%   y1.80% 
    0.755    0.760    0.800    0.620    0.355    0.125    0.025    0.010 
-  y1.90% acf.0.y1 acf.1.y1 acf.2.y1 acf.3.y1 acf.4.y1 acf.0.y2 acf.1.y2 
-   0.005    0.020    0.035    0.025    0.100    0.835    0.060    0.070 
-acf.2.y2 acf.3.y2 acf.4.y2       pd 
-   0.070    0.090    0.430    0.060 
+  y1.90% acf.0.y1 acf.1.y1 acf.4.y1 acf.7.y1 acf.0.y2 acf.1.y2 acf.4.y2 
+   0.005    0.020    0.035    0.835    0.840    0.060    0.070    0.430 
+acf.7.y2       pd 
+   0.870    0.060 
 
 $pvals
     y1.10%     y1.20%     y1.30%     y1.40%     y1.50%     y1.60%     y1.70% 
 0.49751244 0.48756219 0.40796020 0.76616915 0.71641791 0.25870647 0.05970149 
-    y1.80%     y1.90%   acf.0.y1   acf.1.y1   acf.2.y1   acf.3.y1   acf.4.y1 
-0.02985075 0.01990050 0.04975124 0.07960199 0.05970149 0.20895522 0.33830846 
-  acf.0.y2   acf.1.y2   acf.2.y2   acf.3.y2   acf.4.y2         pd 
-0.12935323 0.14925373 0.14925373 0.18905473 0.86567164 0.12935323 
+    y1.80%     y1.90%   acf.0.y1   acf.1.y1   acf.4.y1   acf.7.y1   acf.0.y2 
+0.02985075 0.01990050 0.04975124 0.07960199 0.33830846 0.32835821 0.12935323 
+  acf.1.y2   acf.4.y2   acf.7.y2         pd 
+0.14925373 0.86567164 0.26865672 0.12935323 
 
 > 
 > po <- ou2
@@ -156,13 +159,16 @@
 > pb <- probe(
 +             po,
 +             probes=list(
-+               probe.acf(var=c("y1","y2"),lag.max=1,type="cor"),
++               probe.acf(var=c("y1","y2"),lags=c(0,1),type="cor"),
 +               probe.nlar("y1",lags=1,powers=1),
 +               probe.nlar("y2",lags=1,powers=1)
 +               ),
 +             nsim=1000,
 +             seed=1066L
 +             )
+Warning message:
+In probe.acf(var = c("y1", "y2"), lags = c(0, 1), type = "cor") :
+  useless zero lag discarded in 'probe.acf'
 > x <- as.data.frame(po)
 > x <- sweep(x,2,mean(x))
 > y1 <- head(x$y1,-1)
@@ -176,7 +182,7 @@
 > pb <- probe(
 +             po,
 +             probes=list(
-+               probe.acf(var=c("y1"),lag.max=2,type="cov"),
++               probe.acf(var=c("y1"),lags=c(0,1,2),type="cov"),
 +               probe.ccf(vars=c("y1","y1"),lags=c(0,1,2))
 +               ),
 +             nsim=1000,

Modified: pkg/tests/ricker-probe.R
===================================================================
--- pkg/tests/ricker-probe.R	2010-10-18 13:36:48 UTC (rev 384)
+++ pkg/tests/ricker-probe.R	2010-10-18 15:58:27 UTC (rev 385)
@@ -73,7 +73,7 @@
                                ),
               probe.acf(
                         var="y",
-                        lag.max=5
+                        lags=c(0,1,3,5)
                         ),
               mean=probe.mean(var="y",transform=sqrt)
               ),
@@ -172,7 +172,7 @@
             probes=probe.acf(
               var="y",
               transform=sqrt,
-              lag.max=5,
+              lags=seq.int(from=0,to=5),
               type="cov"
               ),
             nsim=1000,
@@ -187,7 +187,7 @@
             probes=probe.acf(
               var="y",
               transform=sqrt,
-              lag.max=5,
+              lags=seq.int(from=1,to=5),
               type="cor"
               ),
             nsim=1000,
@@ -204,7 +204,7 @@
               probe.acf(
                         var="y",
                         transform=sqrt,
-                        lag.max=2,
+                        lags=c(0,1,2),
                         type="cov"
                         ),
               probe.nlar(

Modified: pkg/tests/ricker-probe.Rout.save
===================================================================
--- pkg/tests/ricker-probe.Rout.save	2010-10-18 13:36:48 UTC (rev 384)
+++ pkg/tests/ricker-probe.Rout.save	2010-10-18 15:58:27 UTC (rev 385)
@@ -165,7 +165,7 @@
 +                                ),
 +               probe.acf(
 +                         var="y",
-+                         lag.max=5
++                         lags=c(0,1,3,5)
 +                         ),
 +               mean=probe.mean(var="y",transform=sqrt)
 +               ),
@@ -175,8 +175,8 @@
 > pb at datvals
        marg.1        marg.2        marg.3       acf.0.y       acf.1.y 
  1.000000e+00 -3.470661e-18 -1.108330e-18  3.679493e+03 -1.275470e+03 
-      acf.2.y       acf.3.y       acf.4.y       acf.5.y          mean 
--6.404084e+02  4.212841e+02 -4.929864e+02  2.954671e+02  4.430440e+00 
+      acf.3.y       acf.5.y          mean 
+ 4.212841e+02  2.954671e+02  4.430440e+00 
 > summary(pb)
 $coef
     log.r log.sigma   log.phi       N.0       e.0 
@@ -186,14 +186,14 @@
 [1] 1000
 
 $quantiles
- marg.1  marg.2  marg.3 acf.0.y acf.1.y acf.2.y acf.3.y acf.4.y acf.5.y    mean 
-  0.855   0.284   0.275   0.647   0.034   0.431   0.920   0.149   0.686   0.838 
+ marg.1  marg.2  marg.3 acf.0.y acf.1.y acf.3.y acf.5.y    mean 
+  0.855   0.284   0.275   0.647   0.034   0.920   0.686   0.838 
 
 $pvals
-    marg.1     marg.2     marg.3    acf.0.y    acf.1.y    acf.2.y    acf.3.y 
-0.29170829 0.56943057 0.55144855 0.70729271 0.06993007 0.86313686 0.16183816 
-   acf.4.y    acf.5.y       mean 
-0.29970030 0.62937063 0.32567433 
+    marg.1     marg.2     marg.3    acf.0.y    acf.1.y    acf.3.y    acf.5.y 
+0.29170829 0.56943057 0.55144855 0.70729271 0.06993007 0.16183816 0.62937063 
+      mean 
+0.32567433 
 
 > plot(pb)
 > 
@@ -245,7 +245,7 @@
 +                               )
 +             )
    user  system elapsed 
- 10.140   0.013  10.153 
+ 10.152   0.147  10.301 
 > plot(pm)
 > 
 > cbind(truth=coef(ricker),est=coef(pm),guess=coef(po))
@@ -301,7 +301,7 @@
 +                               )
 +             )
    user  system elapsed 
-  6.228   0.011   6.241 
+  6.215   0.093   6.310 
 > plot(pm)
 > plot(as(pm,"pomp"),variables="y")
 > plot(simulate(pm),variables="y")
@@ -352,7 +352,7 @@
 +             probes=probe.acf(
 +               var="y",
 +               transform=sqrt,
-+               lag.max=5,
++               lags=seq.int(from=0,to=5),
 +               type="cov"
 +               ),
 +             nsim=1000,
@@ -384,7 +384,7 @@
 +             probes=probe.acf(
 +               var="y",
 +               transform=sqrt,
-+               lag.max=5,
++               lags=seq.int(from=1,to=5),
 +               type="cor"
 +               ),
 +             nsim=1000,
@@ -418,7 +418,7 @@
 +               probe.acf(
 +                         var="y",
 +                         transform=sqrt,
-+                         lag.max=2,
++                         lags=c(0,1,2),
 +                         type="cov"
 +                         ),
 +               probe.nlar(



More information about the pomp-commits mailing list