[Pomp-commits] r1045 - in pkg/pomp: . R src tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jan 7 00:08:16 CET 2015


Author: kingaa
Date: 2015-01-07 00:08:15 +0100 (Wed, 07 Jan 2015)
New Revision: 1045

Modified:
   pkg/pomp/DESCRIPTION
   pkg/pomp/R/trajectory-pomp.R
   pkg/pomp/src/dmeasure.c
   pkg/pomp/src/dprocess.c
   pkg/pomp/src/initstate.c
   pkg/pomp/src/pomp_internal.h
   pkg/pomp/src/rmeasure.c
   pkg/pomp/src/rprior.c
   pkg/pomp/src/rprocess.c
   pkg/pomp/src/skeleton.c
   pkg/pomp/tests/bbs-trajmatch.Rout.save
   pkg/pomp/tests/bbs.Rout.save
   pkg/pomp/tests/blowflies.Rout.save
   pkg/pomp/tests/dacca.Rout.save
   pkg/pomp/tests/dimchecks.Rout.save
   pkg/pomp/tests/fhn.Rout.save
   pkg/pomp/tests/filtfail.Rout.save
   pkg/pomp/tests/gillespie.Rout.save
   pkg/pomp/tests/gompertz.Rout.save
   pkg/pomp/tests/logistic.Rout.save
   pkg/pomp/tests/ou2-abc.Rout.save
   pkg/pomp/tests/ou2-bsmc.Rout.save
   pkg/pomp/tests/ou2-bsmc2.Rout.save
   pkg/pomp/tests/ou2-forecast.Rout.save
   pkg/pomp/tests/ou2-kalman.Rout.save
   pkg/pomp/tests/ou2-mif-fp.Rout.save
   pkg/pomp/tests/ou2-mif.Rout.save
   pkg/pomp/tests/ou2-mif2.Rout.save
   pkg/pomp/tests/ou2-nlf.Rout.save
   pkg/pomp/tests/ou2-pmcmc.Rout.save
   pkg/pomp/tests/ou2-probe.Rout.save
   pkg/pomp/tests/ou2-procmeas.R
   pkg/pomp/tests/ou2-procmeas.Rout.save
   pkg/pomp/tests/ou2-simulate.Rout.save
   pkg/pomp/tests/ou2-trajmatch.Rout.save
   pkg/pomp/tests/partrans.Rout.save
   pkg/pomp/tests/pfilter.Rout.save
   pkg/pomp/tests/pomppomp.Rout.save
   pkg/pomp/tests/prior.Rout.save
   pkg/pomp/tests/ricker-bsmc.Rout.save
   pkg/pomp/tests/ricker-probe.Rout.save
   pkg/pomp/tests/ricker-spect.Rout.save
   pkg/pomp/tests/ricker.Rout.save
   pkg/pomp/tests/rw2.Rout.save
   pkg/pomp/tests/sir.Rout.save
   pkg/pomp/tests/skeleton.Rout.save
   pkg/pomp/tests/steps.Rout.save
   pkg/pomp/tests/synlik.Rout.save
   pkg/pomp/tests/verhulst.Rout.save
Log:
- use names on dimnames of arrays returned by basic pomp methods

Modified: pkg/pomp/DESCRIPTION
===================================================================
--- pkg/pomp/DESCRIPTION	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/DESCRIPTION	2015-01-06 23:08:15 UTC (rev 1045)
@@ -1,8 +1,8 @@
 Package: pomp
 Type: Package
 Title: Statistical Inference for Partially Observed Markov Processes
-Version: 0.57-1
-Date: 2015-01-02
+Version: 0.57-2
+Date: 2015-01-06
 Authors at R: c(person(given=c("Aaron","A."),family="King",
 		role=c("aut","cre"),email="kingaa at umich.edu"),
 	  person(given=c("Edward","L."),family="Ionides",role=c("aut")),

Modified: pkg/pomp/R/trajectory-pomp.R
===================================================================
--- pkg/pomp/R/trajectory-pomp.R	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/R/trajectory-pomp.R	2015-01-06 23:08:15 UTC (rev 1045)
@@ -91,6 +91,8 @@
 
   }
 
+  dimnames(x) <- setNames(dimnames(x),c("variable","rep","time"))
+
   if (as.data.frame) {
     x <- lapply(
                 seq_len(ncol(x)),

Modified: pkg/pomp/src/dmeasure.c
===================================================================
--- pkg/pomp/src/dmeasure.c	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/src/dmeasure.c	2015-01-06 23:08:15 UTC (rev 1045)
@@ -129,7 +129,9 @@
   // create array to store results
   {
     int dim[2] = {nreps, ntimes};
+    const char *dimnm[2] = {"rep","time"};
     PROTECT(F = makearray(2,dim)); nprotect++; 
+    fixdimnames(F,dimnm,2);
   }
 
   // now do computations

Modified: pkg/pomp/src/dprocess.c
===================================================================
--- pkg/pomp/src/dprocess.c	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/src/dprocess.c	2015-01-06 23:08:15 UTC (rev 1045)
@@ -109,7 +109,10 @@
     UNPROTECT(nprotect);
     error("dprocess error: user 'dprocess' must return a %d x %d array",nreps,ntimes-1);
   }
-
+  {
+    const char *dimnms[2] = {"rep","time"};
+    fixdimnames(X,dimnms,2);
+  }
   UNPROTECT(nprotect);
   return X;
 }

Modified: pkg/pomp/src/initstate.c
===================================================================
--- pkg/pomp/src/initstate.c	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/src/initstate.c	2015-01-06 23:08:15 UTC (rev 1045)
@@ -18,6 +18,7 @@
   int npar, nrep, nvar;
   int xdim[2], j, k;
   double *p, *pp, *xp, *xpp;
+  const char *dimnms[2] = {"variable","rep"};
 
   PROTECT(params = as_matrix(params)); nprotect++;
   dim = INTEGER(GET_DIM(params));
@@ -76,6 +77,7 @@
   xdim[0] = nvar; xdim[1] = nrep;
   PROTECT(x = makearray(2,xdim)); nprotect++;
   setrownames(x,statenames,2);
+  fixdimnames(x,dimnms,2);
   xpp = REAL(x);
 
   for (k = 0; k < nvar; k++) xpp[k] = xp[k];

Modified: pkg/pomp/src/pomp_internal.h
===================================================================
--- pkg/pomp/src/pomp_internal.h	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/src/pomp_internal.h	2015-01-06 23:08:15 UTC (rev 1045)
@@ -13,7 +13,6 @@
 # define MATCHNAMES(X,N,W) (matchnames(GET_NAMES(X),(N),(W)))
 # define MATCHROWNAMES(X,N,W) (matchnames(GET_ROWNAMES(GET_DIMNAMES(X)),(N),(W)))
 # define MATCHCOLNAMES(X,N,W) (matchnames(GET_COLNAMES(GET_DIMNAMES(X)),(N),(W)))
-# define MATCH_CHAR_TO_ROWNAMES(X,N,A) (match_char_to_names(GET_ROWNAMES(GET_DIMNAMES(X)),(N),(A)))
 
 // lookup-table structure, as used internally
 typedef struct lookup_table {
@@ -77,27 +76,25 @@
 void unset_pomp_userdata (void);
 
 static R_INLINE SEXP makearray (int rank, int *dim) {
-  int nprotect = 0;
   int *dimp, k;
   double *xp;
   SEXP dimx, x;
-  PROTECT(dimx = NEW_INTEGER(rank)); nprotect++;
+  PROTECT(dimx = NEW_INTEGER(rank));
   dimp = INTEGER(dimx); 
   for (k = 0; k < rank; k++) dimp[k] = dim[k];
-  PROTECT(x = allocArray(REALSXP,dimx)); nprotect++;
+  PROTECT(x = allocArray(REALSXP,dimx));
   xp = REAL(x);
   for (k = 0; k < length(x); k++) xp[k] = NA_REAL;
-  UNPROTECT(nprotect);
+  UNPROTECT(2);
   return x;
 }
 
 static R_INLINE SEXP matchnames (SEXP x, SEXP names, const char *where) {
-  int nprotect = 0;
   int n = length(names);
   int *idx, k;
   SEXP index, nm;
-  PROTECT(nm = AS_CHARACTER(names)); nprotect++;
-  PROTECT(index = match(x,names,0)); nprotect++;
+  PROTECT(nm = AS_CHARACTER(names));
+  PROTECT(index = match(x,names,0));
   idx = INTEGER(index);
   for (k = 0; k < n; k++) {
     if (idx[k]==0) 
@@ -106,31 +103,10 @@
 	    where);
     idx[k] -= 1;
   }
-  UNPROTECT(nprotect);
+  UNPROTECT(2);
   return index;
 }
 
-static R_INLINE SEXP match_char_to_names (SEXP x, int n, char **names) {
-  int nprotect = 0;
-  int *idx, k;
-  SEXP index, nm;
-  PROTECT(nm = NEW_CHARACTER(n)); nprotect++;
-  for (k = 0; k < n; k++) {
-    SET_STRING_ELT(nm,k,mkChar(names[k]));
-  }
-  PROTECT(index = match(x,nm,0)); nprotect++;
-  idx = INTEGER(index);
-  for (k = 0; k < n; k++) {
-    if (idx[k]==0) {
-      UNPROTECT(nprotect);
-      error("variable %s not specified",names[k]);
-    }
-    idx[k] -= 1;
-  }
-  UNPROTECT(nprotect);
-  return index;
-}
-
 static R_INLINE SEXP name_index (SEXP names, SEXP object, const char *slot) {
   SEXP slotnames, index;
   PROTECT(slotnames = GET_SLOT(object,install(slot)));
@@ -144,12 +120,27 @@
 }
 
 static R_INLINE void setrownames (SEXP x, SEXP names, int n) {
-  int nprotect = 0;
   SEXP dimnms, nm;
-  PROTECT(nm = AS_CHARACTER(names)); nprotect++;
-  PROTECT(dimnms = allocVector(VECSXP,n)); nprotect++;
+  PROTECT(nm = AS_CHARACTER(names));
+  PROTECT(dimnms = allocVector(VECSXP,n));
   SET_ELEMENT(dimnms,0,nm);	// set row names
   SET_DIMNAMES(x,dimnms);
+  UNPROTECT(2);
+}
+
+static R_INLINE void fixdimnames (SEXP x, const char **names, int n) {
+  int nprotect = 0;
+  int i;
+  SEXP dimnames, nm;
+  PROTECT(dimnames = GET_DIMNAMES(x)); nprotect++;
+  if (isNull(dimnames)) {
+    PROTECT(dimnames = allocVector(VECSXP,n)); nprotect++;
+  }
+  PROTECT(nm = allocVector(VECSXP,n)); nprotect++;
+  for (i = 0; i < n; i++)
+    SET_ELEMENT(nm,i,mkChar(names[i]));
+  SET_NAMES(dimnames,nm);
+  SET_DIMNAMES(x,dimnames);
   UNPROTECT(nprotect);
 }
 

Modified: pkg/pomp/src/rmeasure.c
===================================================================
--- pkg/pomp/src/rmeasure.c	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/src/rmeasure.c	2015-01-06 23:08:15 UTC (rev 1045)
@@ -61,8 +61,10 @@
 
   {
     int dim[3] = {nobs, nreps, ntimes};
+    const char *dimnm[3] = {"variable","rep","time"};
     PROTECT(Y = makearray(3,dim)); nprotect++; 
     setrownames(Y,Onames,3);
+    fixdimnames(Y,dimnm,3);
   }
 
   // extract the user-defined function

Modified: pkg/pomp/src/rprior.c
===================================================================
--- pkg/pomp/src/rprior.c	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/src/rprior.c	2015-01-06 23:08:15 UTC (rev 1045)
@@ -20,6 +20,7 @@
   SEXP Pnames, P, fn, fcall;
   SEXP pompfun;
   int *dim;
+  const char *dimnms[2] = {"variable","rep"};
 
   PROTECT(params = as_matrix(params)); nprotect++;
   dim = INTEGER(GET_DIM(params));
@@ -144,5 +145,6 @@
   }
 
   UNPROTECT(nprotect);
+  fixdimnames(P,dimnms,2);
   return P;
 }

Modified: pkg/pomp/src/rprocess.c
===================================================================
--- pkg/pomp/src/rprocess.c	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/src/rprocess.c	2015-01-06 23:08:15 UTC (rev 1045)
@@ -14,6 +14,7 @@
   int *xdim, nvars, npars, nreps, nrepsx, ntimes, off;
   SEXP X, Xoff, copy, fn, fcall, rho;
   SEXP dimXstart, dimP, dimX;
+  const char *dimnm[3] = {"variable","rep","time"};
 
   PROTECT(gnsi = duplicate(gnsi)); nprotect++;
 
@@ -113,10 +114,12 @@
     xdim[2] -= off;
     PROTECT(Xoff = makearray(3,xdim)); nprotect++;
     setrownames(Xoff,GET_ROWNAMES(GET_DIMNAMES(X)),3);
+    fixdimnames(Xoff,dimnm,3);
     memcpy(REAL(Xoff),REAL(X)+off*nvars*nreps,(ntimes-off)*nvars*nreps*sizeof(double));
     UNPROTECT(nprotect);
     return Xoff;
   } else {
+    fixdimnames(X,dimnm,3);
     UNPROTECT(nprotect);
     return X;
   }

Modified: pkg/pomp/src/skeleton.c
===================================================================
--- pkg/pomp/src/skeleton.c	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/src/skeleton.c	2015-01-06 23:08:15 UTC (rev 1045)
@@ -131,8 +131,10 @@
   // set up the array to hold results
   {
     int dim[3] = {nvars, nreps, ntimes};
+    const char *dimnms[3] = {"variable","rep","time"};
     PROTECT(F = makearray(3,dim)); nprotect++; 
     setrownames(F,Snames,3);
+    fixdimnames(F,dimnms,3);
   }
 
   // first do setup

Modified: pkg/pomp/tests/bbs-trajmatch.Rout.save
===================================================================
--- pkg/pomp/tests/bbs-trajmatch.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/bbs-trajmatch.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -80,4 +80,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  2.725   0.017   2.733 
+  2.480   0.052   2.555 

Modified: pkg/pomp/tests/bbs.Rout.save
===================================================================
--- pkg/pomp/tests/bbs.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/bbs.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -69,4 +69,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  7.769   0.051   7.832 
+  7.008   0.076   7.124 

Modified: pkg/pomp/tests/blowflies.Rout.save
===================================================================
--- pkg/pomp/tests/blowflies.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/blowflies.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -24,45 +24,47 @@
  blowflies1 blowflies2 
 > 
 > init.state(blowflies1)
-     [,1]
-N1  397.0
-N2  450.5
-N3  504.0
-N4  590.0
-N5  676.0
-N6  738.5
-N7  801.0
-N8  829.5
-N9  858.0
-N10 884.5
-N11 911.0
-N12 926.5
-N13 942.0
-N14 945.0
-N15 948.0
-R     0.0
-S     0.0
-e     0.0
-eps   0.0
+        rep
+variable  [,1]
+     N1  397.0
+     N2  450.5
+     N3  504.0
+     N4  590.0
+     N5  676.0
+     N6  738.5
+     N7  801.0
+     N8  829.5
+     N9  858.0
+     N10 884.5
+     N11 911.0
+     N12 926.5
+     N13 942.0
+     N14 945.0
+     N15 948.0
+     R     0.0
+     S     0.0
+     e     0.0
+     eps   0.0
 > x1 <- simulate(blowflies1)
 > f1 <- pfilter(blowflies1,Np=1000,seed=599688L)
 > logLik(f1)
 [1] -1466.694
 > 
 > init.state(blowflies2)
-    [,1]
-N1   397
-N2   504
-N3   676
-N4   801
-N5   858
-N6   911
-N7   942
-N8   948
-R      0
-S      0
-e      0
-eps    0
+        rep
+variable [,1]
+     N1   397
+     N2   504
+     N3   676
+     N4   801
+     N5   858
+     N6   911
+     N7   942
+     N8   948
+     R      0
+     S      0
+     e      0
+     eps    0
 > x2 <- simulate(blowflies2)
 > f2 <- pfilter(blowflies2,Np=1000,seed=599688L)
 > logLik(f2)
@@ -70,4 +72,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  1.493   0.039   1.519 
+  1.304   0.044   1.380 

Modified: pkg/pomp/tests/dacca.Rout.save
===================================================================
--- pkg/pomp/tests/dacca.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/dacca.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -107,4 +107,4 @@
 > 
 > proc.time()
    user  system elapsed 
- 14.817   0.035  14.853 
+ 10.852   0.064  10.968 

Modified: pkg/pomp/tests/dimchecks.Rout.save
===================================================================
--- pkg/pomp/tests/dimchecks.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/dimchecks.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -29,19 +29,22 @@
 > pars <- coef(po)
 > xstart <- init.state(po,params=pars)
 > rprocess(po,xstart,times=0:5,params=pars)[,1,]
-  [,1]      [,2]        [,3]        [,4]      [,5]       [,6]
-N    7 0.4578051 11.78599703 0.004766933 0.2732487 14.6301023
-e    0 0.4727782 -0.09397106 0.173032749 0.2534460  0.4537029
+        time
+variable [,1]      [,2]        [,3]        [,4]      [,5]       [,6]
+       N    7 0.4578051 11.78599703 0.004766933 0.2732487 14.6301023
+       e    0 0.4727782 -0.09397106 0.173032749 0.2534460  0.4537029
 > 
 > rprocess(po,xstart=parmat(xstart,5),times=0:5,params=pars)[,3,]
-  [,1]       [,2]      [,3]       [,4]       [,5]      [,6]
-N    7  0.1788532 8.0265735 0.11906954  4.1101032 4.7809853
-e    0 -0.4671001 0.1828009 0.01576817 -0.1394347 0.4613017
+        time
+variable [,1]       [,2]      [,3]       [,4]       [,5]      [,6]
+       N    7  0.1788532 8.0265735 0.11906954  4.1101032 4.7809853
+       e    0 -0.4671001 0.1828009 0.01576817 -0.1394347 0.4613017
 > 
 > rprocess(po,xstart=xstart,times=0:5,params=parmat(pars,3))[,3,]
-  [,1]      [,2]       [,3]       [,4]      [,5]      [,6]
-N    7 0.3200483  7.9793435  0.1061246 6.3880659 0.5943893
-e    0 0.1148066 -0.2638123 -0.1406537 0.4036972 0.2134135
+        time
+variable [,1]      [,2]       [,3]       [,4]      [,5]      [,6]
+       N    7 0.3200483  7.9793435  0.1061246 6.3880659 0.5943893
+       e    0 0.1148066 -0.2638123 -0.1406537 0.4036972 0.2134135
 > 
 > try(
 +     rprocess(po,xstart=parmat(xstart,2),times=0:5,params=parmat(pars,3))[,,3]
@@ -50,9 +53,10 @@
   rprocess error: larger number of replicates is not a multiple of smaller
 > 
 > rprocess(po,xstart=parmat(xstart,2),times=0:5,params=parmat(pars,6))[,,3]
-        [,1]       [,2]       [,3]       [,4]      [,5]        [,6]
-N 11.4232929 11.3881039  4.8636396  7.1427117 9.4874566  9.65359657
-e  0.1987878  0.2241485 -0.5425199 -0.1655866 0.2008968 -0.09235699
+        rep
+variable       [,1]       [,2]       [,3]       [,4]      [,5]        [,6]
+       N 11.4232929 11.3881039  4.8636396  7.1427117 9.4874566  9.65359657
+       e  0.1987878  0.2241485 -0.5425199 -0.1655866 0.2008968 -0.09235699
 > 
 > x <- rprocess(po,xstart=parmat(xstart,2),times=0:5,params=parmat(pars,8))
 > 
@@ -68,72 +72,85 @@
 > rmeasure(po,x=x,params=parmat(pars,4),times=0:5)
 , , 1
 
-  [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
-y   95   77   70   84   75   65   55   73
+        rep
+variable [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
+       y   95   77   70   84   75   65   55   73
 
 , , 2
 
-  [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
-y    6    2    4    9    3    1    2    1
+        rep
+variable [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
+       y    6    2    4    9    3    1    2    1
 
 , , 3
 
-  [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
-y  107   67   95   99   74   54   36   74
+        rep
+variable [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
+       y  107   67   95   99   74   54   36   74
 
 , , 4
 
-  [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
-y    0    7    0    0    1    4   10    5
+        rep
+variable [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
+       y    0    7    0    0    1    4   10    5
 
 , , 5
 
-  [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
-y    7  178   14    1   82  190  200   88
+        rep
+variable [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
+       y    7  178   14    1   82  190  200   88
 
 , , 6
 
-  [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
-y  216    0  190  106    1    0    0    0
+        rep
+variable [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
+       y  216    0  190  106    1    0    0    0
 
 > 
 > x <- rprocess(po,xstart=xstart,times=0:5,params=pars)
 > rmeasure(po,x=x,params=parmat(pars,2),times=0:5)
 , , 1
 
-  [,1] [,2]
-y   79   73
+        rep
+variable [,1] [,2]
+       y   79   73
 
 , , 2
 
-  [,1] [,2]
-y    1    1
+        rep
+variable [,1] [,2]
+       y    1    1
 
 , , 3
 
-  [,1] [,2]
-y   73   51
+        rep
+variable [,1] [,2]
+       y   73   51
 
 , , 4
 
-  [,1] [,2]
-y   10   12
+        rep
+variable [,1] [,2]
+       y   10   12
 
 , , 5
 
-  [,1] [,2]
-y  193  186
+        rep
+variable [,1] [,2]
+       y  193  186
 
 , , 6
 
-  [,1] [,2]
-y    0    0
+        rep
+variable [,1] [,2]
+       y    0    0
 
 > 
 > y <- rmeasure(po,x=x,params=parmat(pars,4),times=0:5)
 > dmeasure(po,x=x,y=y[,2,,drop=F],params=pars,times=0:5)
-            [,1]     [,2]       [,3]      [,4]       [,5]      [,6]
-[1,] 0.002350788 0.268881 0.04825714 0.1309304 0.02090266 0.9998435
+      time
+rep           [,1]     [,2]       [,3]      [,4]       [,5]      [,6]
+  [1,] 0.002350788 0.268881 0.04825714 0.1309304 0.02090266 0.9998435
 > 
 > x <- rprocess(po,xstart=parmat(xstart,3),times=0:5,params=pars)
 > y <- rmeasure(po,x=x,params=pars,times=0:5)
@@ -162,4 +179,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  0.489   0.041   0.517 
+  0.560   0.092   0.677 

Modified: pkg/pomp/tests/fhn.Rout.save
===================================================================
--- pkg/pomp/tests/fhn.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/fhn.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -44,15 +44,17 @@
 > skeleton(fhn,x,t=c(0,3),params=params)
 , , 1
 
-   [,1]      [,2]
-V -0.40 -6.666667
-R -0.05  0.100000
+        rep
+variable  [,1]      [,2]
+       V -0.40 -6.666667
+       R -0.05  0.100000
 
 , , 2
 
-       [,1] [,2]
-V 0.9333333  5.0
-R 0.4500000  0.2
+        rep
+variable      [,1] [,2]
+       V 0.9333333  5.0
+       R 0.4500000  0.2
 
 > y <- trajectory(fhn,params=params,hmax=0.1)
 > invisible(y[,,599:601])
@@ -91,4 +93,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  0.927   0.060   0.950 
+  1.084   0.064   1.285 

Modified: pkg/pomp/tests/filtfail.Rout.save
===================================================================
--- pkg/pomp/tests/filtfail.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/filtfail.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -116,4 +116,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  0.489   0.053   0.529 
+  0.576   0.068   0.660 

Modified: pkg/pomp/tests/gillespie.Rout.save
===================================================================
--- pkg/pomp/tests/gillespie.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/gillespie.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -131,4 +131,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  2.565   0.041   2.592 
+  2.564   0.048   2.635 

Modified: pkg/pomp/tests/gompertz.Rout.save
===================================================================
--- pkg/pomp/tests/gompertz.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/gompertz.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -133,4 +133,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  1.797   0.038   1.822 
+  1.576   0.052   1.652 

Modified: pkg/pomp/tests/logistic.Rout.save
===================================================================
--- pkg/pomp/tests/logistic.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/logistic.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -76,8 +76,9 @@
 +                ),
 +       digits=4
 +       )
-         [,1]      [,2]      [,3]      [,4]      [,5]
-[1,] 0.001204 0.0005132 0.0005411 0.0007547 0.0005974
+      time
+rep        [,1]      [,2]      [,3]      [,4]      [,5]
+  [1,] 0.001204 0.0005132 0.0005411 0.0007547 0.0005974
 > 
 > print(
 +       dmeasure(
@@ -90,8 +91,9 @@
 +                ),
 +       digits=4
 +       )
-       [,1]   [,2]   [,3]   [,4]   [,5]   [,6]
-[1,] -7.915 -8.896 -7.992 -8.196 -11.12 -7.946
+      time
+rep      [,1]   [,2]   [,3]   [,4]   [,5]   [,6]
+  [1,] -7.915 -8.896 -7.992 -8.196 -11.12 -7.946
 > 
 > print(
 +       drop(
@@ -122,4 +124,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  0.874   0.030   0.887 
+  0.976   0.052   1.175 

Modified: pkg/pomp/tests/ou2-abc.Rout.save
===================================================================
--- pkg/pomp/tests/ou2-abc.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/ou2-abc.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -131,4 +131,4 @@
 > 
 > proc.time()
    user  system elapsed 
- 11.085   0.055  11.138 
+  9.612   0.100   9.906 

Modified: pkg/pomp/tests/ou2-bsmc.Rout.save
===================================================================
--- pkg/pomp/tests/ou2-bsmc.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/ou2-bsmc.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -59,7 +59,7 @@
 > post <- smc$post
 > 
 > print(etime <- toc-tic)
-Time difference of 3.430529 secs
+Time difference of 2.789886 secs
 > 
 > print(
 +       cbind(
@@ -101,4 +101,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  5.498   0.064   5.527 
+  4.688   0.064   4.785 

Modified: pkg/pomp/tests/ou2-bsmc2.Rout.save
===================================================================
--- pkg/pomp/tests/ou2-bsmc2.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/ou2-bsmc2.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -56,7 +56,7 @@
 > post <- smc$post
 > 
 > print(etime <- toc-tic)
-Time difference of 2.234756 secs
+Time difference of 2.022153 secs
 > 
 > print(
 +       cbind(
@@ -98,4 +98,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  3.846   0.045   3.881 
+  3.588   0.084   3.697 

Modified: pkg/pomp/tests/ou2-forecast.Rout.save
===================================================================
--- pkg/pomp/tests/ou2-forecast.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/ou2-forecast.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -61,4 +61,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  1.376   0.042   1.402 
+  1.420   0.036   1.559 

Modified: pkg/pomp/tests/ou2-kalman.Rout.save
===================================================================
--- pkg/pomp/tests/ou2-kalman.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/ou2-kalman.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -164,7 +164,7 @@
     117 function evaluations used
 > toc <- Sys.time()
 > print(toc-tic)
-Time difference of 3.235065 secs
+Time difference of 3.309699 secs
 > tic <- Sys.time()
 > print(loglik.mle <- -kalm.fit1$value,digits=4)
 [1] -477.2
@@ -188,4 +188,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  3.769   0.026   3.787 
+  3.960   0.044   4.036 

Modified: pkg/pomp/tests/ou2-mif-fp.Rout.save
===================================================================
--- pkg/pomp/tests/ou2-mif-fp.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/ou2-mif-fp.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -70,4 +70,4 @@
 > 
 > proc.time()
    user  system elapsed 
- 24.537   0.066  24.614 
+ 19.413   0.056  19.690 

Modified: pkg/pomp/tests/ou2-mif.Rout.save
===================================================================
--- pkg/pomp/tests/ou2-mif.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/ou2-mif.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -281,4 +281,4 @@
 > 
 > proc.time()
    user  system elapsed 
- 13.791   0.053  13.848 
+ 11.452   0.064  11.704 

Modified: pkg/pomp/tests/ou2-mif2.Rout.save
===================================================================
--- pkg/pomp/tests/ou2-mif2.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/ou2-mif2.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -135,4 +135,4 @@
 > 
 > proc.time()
    user  system elapsed 
- 62.157   0.075  62.274 
+ 49.355   0.040  49.763 

Modified: pkg/pomp/tests/ou2-nlf.Rout.save
===================================================================
--- pkg/pomp/tests/ou2-nlf.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/ou2-nlf.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -85,4 +85,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  5.003   0.037   5.037 
+  4.380   0.092   6.425 

Modified: pkg/pomp/tests/ou2-pmcmc.Rout.save
===================================================================
--- pkg/pomp/tests/ou2-pmcmc.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/ou2-pmcmc.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -114,4 +114,4 @@
 > 
 > proc.time()
    user  system elapsed 
- 26.822   0.042  26.880 
+ 24.125   0.068  24.493 

Modified: pkg/pomp/tests/ou2-probe.Rout.save
===================================================================
--- pkg/pomp/tests/ou2-probe.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/ou2-probe.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -340,4 +340,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  8.501   0.048   8.545 
+  7.892   0.092   8.187 

Modified: pkg/pomp/tests/ou2-procmeas.R
===================================================================
--- pkg/pomp/tests/ou2-procmeas.R	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/ou2-procmeas.R	2015-01-06 23:08:15 UTC (rev 1045)
@@ -23,8 +23,8 @@
 x <- simulate(po,states=T,params=coef(po))
 dp2 <- dprocess(po,x=x,times=time(po),params=coef(po),log=T)
 dp3 <- dprocess(po,x=x,times=time(po),params=pmat,log=T)
-stopifnot(identical(rbind(dp2,dp2,dp2),dp3))
+stopifnot(identical(rbind(dp2,dp2,dp2),unname(dp3)))
 
 dm2 <- dmeasure(po,x=x,y=obs(po),times=time(po),params=coef(po),log=T)
 dm3 <- dmeasure(po,x=x,y=obs(po),times=time(po),params=pmat,log=T)
-stopifnot(identical(rbind(dm2,dm2,dm2),dm3))
+stopifnot(identical(rbind(dm2,dm2,dm2),unname(dm3)))

Modified: pkg/pomp/tests/ou2-procmeas.Rout.save
===================================================================
--- pkg/pomp/tests/ou2-procmeas.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/ou2-procmeas.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -46,12 +46,12 @@
 > x <- simulate(po,states=T,params=coef(po))
 > dp2 <- dprocess(po,x=x,times=time(po),params=coef(po),log=T)
 > dp3 <- dprocess(po,x=x,times=time(po),params=pmat,log=T)
-> stopifnot(identical(rbind(dp2,dp2,dp2),dp3))
+> stopifnot(identical(rbind(dp2,dp2,dp2),unname(dp3)))
 > 
 > dm2 <- dmeasure(po,x=x,y=obs(po),times=time(po),params=coef(po),log=T)
 > dm3 <- dmeasure(po,x=x,y=obs(po),times=time(po),params=pmat,log=T)
-> stopifnot(identical(rbind(dm2,dm2,dm2),dm3))
+> stopifnot(identical(rbind(dm2,dm2,dm2),unname(dm3)))
 > 
 > proc.time()
    user  system elapsed 
-  0.493   0.037   0.495 
+  0.408   0.048   0.479 

Modified: pkg/pomp/tests/ou2-simulate.Rout.save
===================================================================
--- pkg/pomp/tests/ou2-simulate.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/ou2-simulate.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -35,7 +35,7 @@
 > ou2.sim <- simulate(ou2,params=p,nsim=100,seed=32043858)
 > toc <- Sys.time()
 > print(toc-tic)
-Time difference of 0.007747889 secs
+Time difference of 0.006910086 secs
 > 
 > coef(ou2,c('x1.0','x2.0')) <- c(-50,50)
 > 
@@ -46,4 +46,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  0.501   0.022   0.507 
+  0.508   0.040   0.572 

Modified: pkg/pomp/tests/ou2-trajmatch.Rout.save
===================================================================
--- pkg/pomp/tests/ou2-trajmatch.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/ou2-trajmatch.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -175,4 +175,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  1.740   0.048   1.765 
+  1.712   0.060   1.801 

Modified: pkg/pomp/tests/partrans.Rout.save
===================================================================
--- pkg/pomp/tests/partrans.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/partrans.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -52,4 +52,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  0.492   0.020   0.494 
+  0.600   0.060   0.678 

Modified: pkg/pomp/tests/pfilter.Rout.save
===================================================================
--- pkg/pomp/tests/pfilter.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/pfilter.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -77,4 +77,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  9.887   0.037   9.924 
+  8.448   0.080   8.699 

Modified: pkg/pomp/tests/pomppomp.Rout.save
===================================================================
--- pkg/pomp/tests/pomppomp.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/pomppomp.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -55,4 +55,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  0.489   0.030   0.504 
+  0.580   0.064   0.663 

Modified: pkg/pomp/tests/prior.Rout.save
===================================================================
--- pkg/pomp/tests/prior.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/prior.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -53,18 +53,19 @@
 > 
 > stopifnot(all.equal(mean(dprior(po,params=parmat(coef(po),3))),dnorm(x=0,mean=0,sd=5)^4))
 > rprior(po,params=coef(po))
-               [,1]
-alpha.1  -2.2417803
-alpha.2   0.7708391
-alpha.3  -3.2398829
-alpha.4   9.9993334
-sigma.1   3.0000000
-sigma.2  -0.5000000
-sigma.3   2.0000000
-tau       1.0000000
-x1.0     -3.0000000
-x2.0      4.0000000
-alpha.sd  5.0000000
+          rep
+variable         [,1]
+  alpha.1  -2.2417803
+  alpha.2   0.7708391
+  alpha.3  -3.2398829
+  alpha.4   9.9993334
+  sigma.1   3.0000000
+  sigma.2  -0.5000000
+  sigma.3   2.0000000
+  tau       1.0000000
+  x1.0     -3.0000000
+  x2.0      4.0000000
+  alpha.sd  5.0000000
 > 
 > coef(po,"alpha.sd") <- 1
 > mean(dprior(po,params=rprior(po,params=parmat(coef(po),10000)),log=TRUE))+0.5*(1+log(2*pi))*4
@@ -72,4 +73,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  0.683   0.025   0.694 
+  0.736   0.056   0.809 

Modified: pkg/pomp/tests/ricker-bsmc.Rout.save
===================================================================
--- pkg/pomp/tests/ricker-bsmc.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/ricker-bsmc.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -54,4 +54,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  2.571   0.057   2.614 
+  2.604   0.072   2.860 

Modified: pkg/pomp/tests/ricker-probe.Rout.save
===================================================================
--- pkg/pomp/tests/ricker-probe.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/ricker-probe.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -297,4 +297,4 @@
 > 
 > proc.time()
    user  system elapsed 
- 13.643   0.070  13.713 
+ 11.976   0.072  12.278 

Modified: pkg/pomp/tests/ricker-spect.Rout.save
===================================================================
--- pkg/pomp/tests/ricker-spect.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/ricker-spect.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -70,4 +70,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  2.504   0.018   2.511 
+  2.284   0.084   3.241 

Modified: pkg/pomp/tests/ricker.Rout.save
===================================================================
--- pkg/pomp/tests/ricker.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/ricker.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -83,4 +83,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  0.554   0.038   0.579 
+  0.704   0.048   0.884 

Modified: pkg/pomp/tests/rw2.Rout.save
===================================================================
--- pkg/pomp/tests/rw2.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/rw2.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -164,7 +164,7 @@
     }
     y
 }
-<environment: 0x1c9a9f8>
+<environment: 0x24441b8>
 measurement model density, dmeasure = 
 function (y, x, t, params, log, covars, ...) 
 {
@@ -177,7 +177,7 @@
         f
     else exp(f)
 }
-<environment: 0x1c9a9f8>
+<environment: 0x24441b8>
 prior simulator, rprior = 
 function not specified
 prior density, dprior = 
@@ -342,4 +342,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  0.879   0.041   0.908 
+  0.992   0.040   1.052 

Modified: pkg/pomp/tests/sir.Rout.save
===================================================================
--- pkg/pomp/tests/sir.Rout.save	2015-01-06 23:07:54 UTC (rev 1044)
+++ pkg/pomp/tests/sir.Rout.save	2015-01-06 23:08:15 UTC (rev 1045)
@@ -192,7 +192,7 @@
         method = 0L, zeronames = zeronames, tcovar = tcovar, 
         covar = covar, args = pairlist(...), gnsi = .getnativesymbolinfo)
 }
-<environment: 0x151f968>
+<environment: 0x24f3bf8>
 process model density, dprocess = 
 function (x, times, params, ..., tcovar, covar, log = FALSE, 
     .getnativesymbolinfo = TRUE) 
@@ -201,7 +201,7 @@
         params = params, tcovar = tcovar, covar = covar, log = log, 
         args = pairlist(...), gnsi = .getnativesymbolinfo)
 }
-<environment: 0x1272bc8>
+<environment: 0x228d048>
 measurement model simulator, rmeasure = 
 function (x, t, params, covars, ...) 
 {
@@ -274,7 +274,7 @@
 > x <- simulate(po,nsim=3)
 > toc <- Sys.time()
 > print(toc-tic)
-Time difference of 0.9468338 secs
+Time difference of 0.8555272 secs
 > 
 > pdf(file='sir.pdf')
 > 
@@ -291,7 +291,7 @@
 > X3 <- trajectory(po,times=t3,hmax=1/52)
 > toc <- Sys.time()
 > print(toc-tic)
-Time difference of 0.560688 secs
+Time difference of 0.5343869 secs
 > plot(t3,X3['I',1,],type='l')
 > 
 > f1 <- dprocess(
@@ -322,14 +322,16 @@
 +                params=params
 +                )
 > print(h1[c("S","I","R"),,],digits=4)
-      [,1]     [,2]      [,3]      [,4]     [,5]   [,6]     [,7]   [,8]
-S  32161.6  31582.4  32142.21  31758.36  31639.0  32006  31953.5  31666
-I   -318.4   -218.9    -88.93     21.52    128.7    218    309.2    403
-R -31855.2 -31375.0 -32064.98 -31792.40 -31780.0 -32236 -32276.8 -32083
-      [,9]    [,10]    [,11]    [,12]    [,13]  [,14]  [,15]  [,16]
-S  31017.5  29782.5  29443.9  28916.7  27997.1  27494  26434  25448
-I    518.5    675.3    768.6    868.8    996.8   1074   1187   1278
-R -31549.7 -30472.3 -30226.0 -29798.8 -29007.2 -28580 -27634 -26740
+        time
+variable     [,1]     [,2]      [,3]      [,4]     [,5]   [,6]     [,7]   [,8]
+       S  32161.6  31582.4  32142.21  31758.36  31639.0  32006  31953.5  31666
+       I   -318.4   -218.9    -88.93     21.52    128.7    218    309.2    403
+       R -31855.2 -31375.0 -32064.98 -31792.40 -31780.0 -32236 -32276.8 -32083
+        time
+variable     [,9]    [,10]    [,11]    [,12]    [,13]  [,14]  [,15]  [,16]
+       S  31017.5  29782.5  29443.9  28916.7  27997.1  27494  26434  25448
+       I    518.5    675.3    768.6    868.8    996.8   1074   1187   1278
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/pomp -r 1045


More information about the pomp-commits mailing list