[Pomp-commits] r545 - in pkg: . R inst src tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Aug 24 20:26:40 CEST 2011


Author: kingaa
Date: 2011-08-24 20:26:40 +0200 (Wed, 24 Aug 2011)
New Revision: 545

Modified:
   pkg/DESCRIPTION
   pkg/NAMESPACE
   pkg/R/plot-pomp.R
   pkg/R/pomp-methods.R
   pkg/inst/NEWS
   pkg/src/initstate.c
   pkg/src/lookup_table.c
   pkg/src/pomp_internal.h
   pkg/tests/gillespie.Rout.save
   pkg/tests/sir.Rout.save
Log:
- improve 'lookup_in_table', which can now handle multiple index values
- as(po,'data.frame'), 'po' a 'pomp' object, now has columns for (interpolated) covariates
- plot(po) behaves as before if 'po' is a 'pomp' object


Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2011-08-23 12:05:33 UTC (rev 544)
+++ pkg/DESCRIPTION	2011-08-24 18:26:40 UTC (rev 545)
@@ -2,7 +2,7 @@
 Type: Package
 Title: Statistical inference for partially observed Markov processes
 Version: 0.39-2
-Date: 2011-08-23
+Date: 2011-08-24
 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>
 URL: http://pomp.r-forge.r-project.org

Modified: pkg/NAMESPACE
===================================================================
--- pkg/NAMESPACE	2011-08-23 12:05:33 UTC (rev 544)
+++ pkg/NAMESPACE	2011-08-24 18:26:40 UTC (rev 545)
@@ -7,6 +7,7 @@
           systematic_resampling,
           euler_model_simulator,
           euler_model_density,
+          lookup_in_table,
           SSA_simulator,
           R_Euler_Multinom,D_Euler_Multinom,
           pfilter_computations,

Modified: pkg/R/plot-pomp.R
===================================================================
--- pkg/R/plot-pomp.R	2011-08-23 12:05:33 UTC (rev 544)
+++ pkg/R/plot-pomp.R	2011-08-24 18:26:40 UTC (rev 545)
@@ -14,11 +14,18 @@
             vars <- names(X)
             tpos <- match("time",vars)
             if (is.na(tpos))
-              stop(sQuote("pomp")," plot error: no data variable labeled ",sQuote("time"),call.=FALSE)
-            if (missing(variables))
+              stop(
+                   sQuote("pomp"),
+                   " plot error: no data variable labeled ",
+                   sQuote("time"),
+                   call.=FALSE
+                   )
+            if (missing(variables)) {
               vars <- vars[-tpos]
-            else
+              vars <- setdiff(vars,colnames(x at covar))
+            } else {
               vars <- variables
+            }
             plotpomp <- function (x, time, 
                                   xy.labels, xy.lines, panel = lines, nc, xlabel,
                                   type = "l", xlim = NULL, ylim = NULL, xlab = "time",

Modified: pkg/R/pomp-methods.R
===================================================================
--- pkg/R/pomp-methods.R	2011-08-23 12:05:33 UTC (rev 544)
+++ pkg/R/pomp-methods.R	2011-08-24 18:26:40 UTC (rev 545)
@@ -27,6 +27,12 @@
           x <- cbind(x,t(from at states))
           names(x) <- c(nm,rownames(from at states))
         }
+        if (length(from at covar)>0) {
+          nm <- names(x)
+          y <- .Call(lookup_in_table,from at tcovar,from at covar,from at times)
+          x <- cbind(x,t(y))
+          names(x) <- c(nm,rownames(y))
+        }
         x
       }
       )

Modified: pkg/inst/NEWS
===================================================================
--- pkg/inst/NEWS	2011-08-23 12:05:33 UTC (rev 544)
+++ pkg/inst/NEWS	2011-08-24 18:26:40 UTC (rev 545)
@@ -1,4 +1,8 @@
 NEWS
+0.39-2
+     o	When 'po' is a 'pomp'-class object with covariates, 'as.data.frame(po)' and 'as(po,"data.frame")' now contain columns for the covariates. 
+     	The latter are interpolated, if necessary, at the observation times.
+
 0.39-1
      o	New facilities for parameter transformation are provided.
      	New optional arguments 'parameter.transform' and 'parameter.inv.transform' to 'pomp' allow the user to specify transformations between natural and internal parameter scalings.

Modified: pkg/src/initstate.c
===================================================================
--- pkg/src/initstate.c	2011-08-23 12:05:33 UTC (rev 544)
+++ pkg/src/initstate.c	2011-08-24 18:26:40 UTC (rev 545)
@@ -15,7 +15,7 @@
   SEXP covar, tcovar, covars;
   SEXP paramnames, statenames, mindex;
   int *dim, *midx;
-  int npar, nrep, nvar, index = 0;
+  int npar, nrep, nvar;
   int xdim[2], j, k;
   double *p, *pp, *xp, *xpp;
 
@@ -45,7 +45,7 @@
   PROTECT(tcovar = GET_SLOT(object,install("tcovar"))); nprotect++;
   if (LENGTH(tcovar) > 0) {	// do table lookkup
     PROTECT(covar = GET_SLOT(object,install("covar"))); nprotect++;
-    PROTECT(covars = lookup_in_table(tcovar,covar,t0,&index)); nprotect++;
+    PROTECT(covars = lookup_in_table(tcovar,covar,t0)); nprotect++;
     PROTECT(fcall = LCONS(covars,fcall)); nprotect++;
     SET_TAG(fcall,install("covars"));
   }

Modified: pkg/src/lookup_table.c
===================================================================
--- pkg/src/lookup_table.c	2011-08-23 12:05:33 UTC (rev 544)
+++ pkg/src/lookup_table.c	2011-08-24 18:26:40 UTC (rev 545)
@@ -4,11 +4,16 @@
 
 #include "pomp_internal.h"
 
-SEXP lookup_in_table (SEXP ttable, SEXP xtable, SEXP t, int *index) {
+SEXP lookup_in_table (SEXP ttable, SEXP xtable, SEXP t) {
   int nprotect = 0;
-  int *dim, length, width;
+  int *dim, xdim[2], length, width;
+  int j, nt;
+  double *tp, *xp;
   SEXP X;
 
+  PROTECT(t = AS_NUMERIC(t)); nprotect++;
+  nt = LENGTH(t);
+
   dim = INTEGER(GET_DIM(xtable));
   length = dim[0]; width = dim[1];
   if (length != LENGTH(ttable)) {
@@ -16,12 +21,19 @@
     error("incommensurate dimensions in 'lookup_in_table'");
   }
 
-  PROTECT(X = NEW_NUMERIC(width)); nprotect++;
-  SET_NAMES(X,GET_COLNAMES(GET_DIMNAMES(xtable)));
+  if (nt > 1) {
+    xdim[0] = width; xdim[1] = nt;
+    PROTECT(X = makearray(2,xdim)); nprotect++;
+    setrownames(X,GET_COLNAMES(GET_DIMNAMES(xtable)),2);
+  } else {
+    PROTECT(X = NEW_NUMERIC(width)); nprotect++;
+    SET_NAMES(X,GET_COLNAMES(GET_DIMNAMES(xtable)));
+  }
 
   struct lookup_table tab = {length,width,0,REAL(ttable),REAL(xtable)};
-  table_lookup(&tab,*(REAL(t)),REAL(X),0);
-  
+  for (j = 0, tp = REAL(t), xp = REAL(X); j < nt; j++, tp++, xp += width)
+    table_lookup(&tab,*tp,xp,0);
+
   UNPROTECT(nprotect);
   return X;
 }

Modified: pkg/src/pomp_internal.h
===================================================================
--- pkg/src/pomp_internal.h	2011-08-23 12:05:33 UTC (rev 544)
+++ pkg/src/pomp_internal.h	2011-08-24 18:26:40 UTC (rev 545)
@@ -38,7 +38,7 @@
 SEXP get_pomp_fun (SEXP pfun);
 
 // lookup_table.c
-SEXP lookup_in_table (SEXP ttable, SEXP xtable, SEXP t, int *index);
+SEXP lookup_in_table (SEXP ttable, SEXP xtable, SEXP t);
 
 // resample.c
 SEXP systematic_resampling(SEXP weights);

Modified: pkg/tests/gillespie.Rout.save
===================================================================
--- pkg/tests/gillespie.Rout.save	2011-08-23 12:05:33 UTC (rev 544)
+++ pkg/tests/gillespie.Rout.save	2011-08-24 18:26:40 UTC (rev 545)
@@ -103,13 +103,20 @@
 > 
 > 
 > tail(as(gsir,"data.frame"))
-        time reports     S    I      R      N cases
-100 1.903846      41 65075 1271 933488 999834   555
-101 1.923077      68 64761 1210 933849 999820   639
-102 1.942308      62 64434 1225 934136 999795   570
-103 1.961538      49 64055 1258 934441 999754   575
-104 1.980769      53 63765 1225 934740 999730   588
-105 2.000000      60 63451 1290 935012 999753   531
+        time reports     S    I      R      N cases    seas.1     seas.2
+100 1.903846      41 65075 1271 933488 999834   555 0.5954581 0.06404093
+101 1.923077      68 64761 1210 933849 999820   639 0.6195570 0.07790927
+102 1.942308      62 64434 1225 934136 999795   570 0.6393034 0.09510602
+103 1.961538      49 64055 1258 934441 999754   575 0.6541212 0.11563116
+104 1.980769      53 63765 1225 934740 999730   588 0.6634343 0.13948471
+105 2.000000      60 63451 1290 935012 999753   531 0.6666667 0.16666667
+       seas.3
+100 0.3405010
+101 0.3025338
+102 0.2655906
+103 0.2302477
+104 0.1970810
+105 0.1666667
 > 
 > data(gillespie.sir)
 > 

Modified: pkg/tests/sir.Rout.save
===================================================================
--- pkg/tests/sir.Rout.save	2011-08-23 12:05:33 UTC (rev 544)
+++ pkg/tests/sir.Rout.save	2011-08-24 18:26:40 UTC (rev 545)
@@ -172,215 +172,215 @@
 > 
 > show(po)
 data and states:
-          time reports
-1   0.01923077       0
-2   0.03846154       0
-3   0.05769231       0
-4   0.07692308       0
-5   0.09615385       0
-6   0.11538462       0
-7   0.13461538       0
-8   0.15384615       0
-9   0.17307692       0
-10  0.19230769       0
-11  0.21153846       0
-12  0.23076923       0
-13  0.25000000       0
-14  0.26923077       0
-15  0.28846154       0
-16  0.30769231       0
-17  0.32692308       0
-18  0.34615385       0
-19  0.36538462       0
-20  0.38461538       0
-21  0.40384615       0
-22  0.42307692       0
-23  0.44230769       0
-24  0.46153846       0
-25  0.48076923       0
-26  0.50000000       0
-27  0.51923077       0
-28  0.53846154       0
-29  0.55769231       0
-30  0.57692308       0
-31  0.59615385       0
-32  0.61538462       0
-33  0.63461538       0
-34  0.65384615       0
-35  0.67307692       0
-36  0.69230769       0
-37  0.71153846       0
-38  0.73076923       0
-39  0.75000000       0
-40  0.76923077       0
-41  0.78846154       0
-42  0.80769231       0
-43  0.82692308       0
-44  0.84615385       0
-45  0.86538462       0
-46  0.88461538       0
-47  0.90384615       0
-48  0.92307692       0
-49  0.94230769       0
-50  0.96153846       0
-51  0.98076923       0
-52  1.00000000       0
-53  1.01923077       0
-54  1.03846154       0
-55  1.05769231       0
-56  1.07692308       0
-57  1.09615385       0
-58  1.11538462       0
-59  1.13461538       0
-60  1.15384615       0
-61  1.17307692       0
-62  1.19230769       0
-63  1.21153846       0
-64  1.23076923       0
-65  1.25000000       0
-66  1.26923077       0
-67  1.28846154       0
-68  1.30769231       0
-69  1.32692308       0
-70  1.34615385       0
-71  1.36538462       0
-72  1.38461538       0
-73  1.40384615       0
-74  1.42307692       0
-75  1.44230769       0
-76  1.46153846       0
-77  1.48076923       0
-78  1.50000000       0
-79  1.51923077       0
-80  1.53846154       0
-81  1.55769231       0
-82  1.57692308       0
-83  1.59615385       0
-84  1.61538462       0
-85  1.63461538       0
-86  1.65384615       0
-87  1.67307692       0
-88  1.69230769       0
-89  1.71153846       0
-90  1.73076923       0
-91  1.75000000       0
-92  1.76923077       0
-93  1.78846154       0
-94  1.80769231       0
-95  1.82692308       0
-96  1.84615385       0
-97  1.86538462       0
-98  1.88461538       0
-99  1.90384615       0
-100 1.92307692       0
-101 1.94230769       0
-102 1.96153846       0
-103 1.98076923       0
-104 2.00000000       0
-105 2.01923077       0
-106 2.03846154       0
-107 2.05769231       0
-108 2.07692308       0
-109 2.09615385       0
-110 2.11538462       0
-111 2.13461538       0
-112 2.15384615       0
-113 2.17307692       0
-114 2.19230769       0
-115 2.21153846       0
-116 2.23076923       0
-117 2.25000000       0
-118 2.26923077       0
-119 2.28846154       0
-120 2.30769231       0
-121 2.32692308       0
-122 2.34615385       0
-123 2.36538462       0
-124 2.38461538       0
-125 2.40384615       0
-126 2.42307692       0
-127 2.44230769       0
-128 2.46153846       0
-129 2.48076923       0
-130 2.50000000       0
-131 2.51923077       0
-132 2.53846154       0
-133 2.55769231       0
-134 2.57692308       0
-135 2.59615385       0
-136 2.61538462       0
-137 2.63461538       0
-138 2.65384615       0
-139 2.67307692       0
-140 2.69230769       0
-141 2.71153846       0
-142 2.73076923       0
-143 2.75000000       0
-144 2.76923077       0
-145 2.78846154       0
-146 2.80769231       0
-147 2.82692308       0
-148 2.84615385       0
-149 2.86538462       0
-150 2.88461538       0
-151 2.90384615       0
-152 2.92307692       0
-153 2.94230769       0
-154 2.96153846       0
-155 2.98076923       0
-156 3.00000000       0
-157 3.01923077       0
-158 3.03846154       0
-159 3.05769231       0
-160 3.07692308       0
-161 3.09615385       0
-162 3.11538462       0
-163 3.13461538       0
-164 3.15384615       0
-165 3.17307692       0
-166 3.19230769       0
-167 3.21153846       0
-168 3.23076923       0
-169 3.25000000       0
-170 3.26923077       0
-171 3.28846154       0
-172 3.30769231       0
-173 3.32692308       0
-174 3.34615385       0
-175 3.36538462       0
-176 3.38461538       0
-177 3.40384615       0
-178 3.42307692       0
-179 3.44230769       0
-180 3.46153846       0
-181 3.48076923       0
-182 3.50000000       0
-183 3.51923077       0
-184 3.53846154       0
-185 3.55769231       0
-186 3.57692308       0
-187 3.59615385       0
-188 3.61538462       0
-189 3.63461538       0
-190 3.65384615       0
-191 3.67307692       0
-192 3.69230769       0
-193 3.71153846       0
-194 3.73076923       0
-195 3.75000000       0
-196 3.76923077       0
-197 3.78846154       0
-198 3.80769231       0
-199 3.82692308       0
-200 3.84615385       0
-201 3.86538462       0
-202 3.88461538       0
-203 3.90384615       0
-204 3.92307692       0
-205 3.94230769       0
-206 3.96153846       0
-207 3.98076923       0
-208 4.00000000       0
+          time reports      seas1      seas2      seas3
+1   0.01923077       0 0.66343428 0.19708101 0.13948471
+2   0.03846154       0 0.65412115 0.23024769 0.11563116
+3   0.05769231       0 0.63930336 0.26559063 0.09510602
+4   0.07692308       0 0.61955697 0.30253376 0.07790927
+5   0.09615385       0 0.59545806 0.34050101 0.06404093
+6   0.11538462       0 0.56758269 0.37891633 0.05350099
+7   0.13461538       0 0.53650693 0.41720362 0.04628945
+8   0.15384615       0 0.50280686 0.45478683 0.04240631
+9   0.17307692       0 0.46705854 0.49108989 0.04185158
+10  0.19230769       0 0.42983804 0.52553672 0.04462525
+11  0.21153846       0 0.39172143 0.55755125 0.05072732
+12  0.23076923       0 0.35328478 0.58655743 0.06015779
+13  0.25000000       0 0.31510417 0.61197917 0.07291667
+14  0.26923077       0 0.27775565 0.63324040 0.08900394
+15  0.28846154       0 0.24181531 0.64976507 0.10841963
+16  0.30769231       0 0.20785920 0.66097709 0.13116371
+17  0.32692308       0 0.17646341 0.66630040 0.15723619
+18  0.34615385       0 0.14817554 0.66521582 0.18660863
+19  0.36538462       0 0.12321252 0.65786560 0.21892187
+20  0.38461538       0 0.10157791 0.64481869 0.25360340
+21  0.40384615       0 0.08327170 0.62665116 0.29007714
+22  0.42307692       0 0.06829389 0.60393908 0.32776703
+23  0.44230769       0 0.05664448 0.57725852 0.36609700
+24  0.46153846       0 0.04832347 0.54718556 0.40449097
+25  0.48076923       0 0.04333087 0.51429625 0.44237289
+26  0.50000000       0 0.04166667 0.47916667 0.47916667
+27  0.51923077       0 0.04333087 0.44237289 0.51429625
+28  0.53846154       0 0.04832347 0.40449097 0.54718556
+29  0.55769231       0 0.05664448 0.36609700 0.57725852
+30  0.57692308       0 0.06829389 0.32776703 0.60393908
+31  0.59615385       0 0.08327170 0.29007714 0.62665116
+32  0.61538462       0 0.10157791 0.25360340 0.64481869
+33  0.63461538       0 0.12321252 0.21892187 0.65786560
+34  0.65384615       0 0.14817554 0.18660863 0.66521582
+35  0.67307692       0 0.17646341 0.15723619 0.66630040
+36  0.69230769       0 0.20785920 0.13116371 0.66097709
+37  0.71153846       0 0.24181531 0.10841963 0.64976507
+38  0.73076923       0 0.27775565 0.08900394 0.63324040
+39  0.75000000       0 0.31510417 0.07291667 0.61197917
+40  0.76923077       0 0.35328478 0.06015779 0.58655743
+41  0.78846154       0 0.39172143 0.05072732 0.55755125
+42  0.80769231       0 0.42983804 0.04462525 0.52553672
+43  0.82692308       0 0.46705854 0.04185158 0.49108989
+44  0.84615385       0 0.50280686 0.04240631 0.45478683
+45  0.86538462       0 0.53650693 0.04628945 0.41720362
+46  0.88461538       0 0.56758269 0.05350099 0.37891633
+47  0.90384615       0 0.59545806 0.06404093 0.34050101
+48  0.92307692       0 0.61955697 0.07790927 0.30253376
+49  0.94230769       0 0.63930336 0.09510602 0.26559063
+50  0.96153846       0 0.65412115 0.11563116 0.23024769
+51  0.98076923       0 0.66343428 0.13948471 0.19708101
+52  1.00000000       0 0.66666667 0.16666667 0.16666667
+53  1.01923077       0 0.66343428 0.19708101 0.13948471
+54  1.03846154       0 0.65412115 0.23024769 0.11563116
+55  1.05769231       0 0.63930336 0.26559063 0.09510602
+56  1.07692308       0 0.61955697 0.30253376 0.07790927
+57  1.09615385       0 0.59545806 0.34050101 0.06404093
+58  1.11538462       0 0.56758269 0.37891633 0.05350099
+59  1.13461538       0 0.53650693 0.41720362 0.04628945
+60  1.15384615       0 0.50280686 0.45478683 0.04240631
+61  1.17307692       0 0.46705854 0.49108989 0.04185158
+62  1.19230769       0 0.42983804 0.52553672 0.04462525
+63  1.21153846       0 0.39172143 0.55755125 0.05072732
+64  1.23076923       0 0.35328478 0.58655743 0.06015779
+65  1.25000000       0 0.31510417 0.61197917 0.07291667
+66  1.26923077       0 0.27775565 0.63324040 0.08900394
+67  1.28846154       0 0.24181531 0.64976507 0.10841963
+68  1.30769231       0 0.20785920 0.66097709 0.13116371
+69  1.32692308       0 0.17646341 0.66630040 0.15723619
+70  1.34615385       0 0.14817554 0.66521582 0.18660863
+71  1.36538462       0 0.12321252 0.65786560 0.21892187
+72  1.38461538       0 0.10157791 0.64481869 0.25360340
+73  1.40384615       0 0.08327170 0.62665116 0.29007714
+74  1.42307692       0 0.06829389 0.60393908 0.32776703
+75  1.44230769       0 0.05664448 0.57725852 0.36609700
+76  1.46153846       0 0.04832347 0.54718556 0.40449097
+77  1.48076923       0 0.04333087 0.51429625 0.44237289
+78  1.50000000       0 0.04166667 0.47916667 0.47916667
+79  1.51923077       0 0.04333087 0.44237289 0.51429625
+80  1.53846154       0 0.04832347 0.40449097 0.54718556
+81  1.55769231       0 0.05664448 0.36609700 0.57725852
+82  1.57692308       0 0.06829389 0.32776703 0.60393908
+83  1.59615385       0 0.08327170 0.29007714 0.62665116
+84  1.61538462       0 0.10157791 0.25360340 0.64481869
+85  1.63461538       0 0.12321252 0.21892187 0.65786560
+86  1.65384615       0 0.14817554 0.18660863 0.66521582
+87  1.67307692       0 0.17646341 0.15723619 0.66630040
+88  1.69230769       0 0.20785920 0.13116371 0.66097709
+89  1.71153846       0 0.24181531 0.10841963 0.64976507
+90  1.73076923       0 0.27775565 0.08900394 0.63324040
+91  1.75000000       0 0.31510417 0.07291667 0.61197917
+92  1.76923077       0 0.35328478 0.06015779 0.58655743
+93  1.78846154       0 0.39172143 0.05072732 0.55755125
+94  1.80769231       0 0.42983804 0.04462525 0.52553672
+95  1.82692308       0 0.46705854 0.04185158 0.49108989
+96  1.84615385       0 0.50280686 0.04240631 0.45478683
+97  1.86538462       0 0.53650693 0.04628945 0.41720362
+98  1.88461538       0 0.56758269 0.05350099 0.37891633
+99  1.90384615       0 0.59545806 0.06404093 0.34050101
+100 1.92307692       0 0.61955697 0.07790927 0.30253376
+101 1.94230769       0 0.63930336 0.09510602 0.26559063
+102 1.96153846       0 0.65412115 0.11563116 0.23024769
+103 1.98076923       0 0.66343428 0.13948471 0.19708101
+104 2.00000000       0 0.66666667 0.16666667 0.16666667
+105 2.01923077       0 0.66343428 0.19708101 0.13948471
+106 2.03846154       0 0.65412115 0.23024769 0.11563116
+107 2.05769231       0 0.63930336 0.26559063 0.09510602
+108 2.07692308       0 0.61955697 0.30253376 0.07790927
+109 2.09615385       0 0.59545806 0.34050101 0.06404093
+110 2.11538462       0 0.56758269 0.37891633 0.05350099
+111 2.13461538       0 0.53650693 0.41720362 0.04628945
+112 2.15384615       0 0.50280686 0.45478683 0.04240631
+113 2.17307692       0 0.46705854 0.49108989 0.04185158
+114 2.19230769       0 0.42983804 0.52553672 0.04462525
+115 2.21153846       0 0.39172143 0.55755125 0.05072732
+116 2.23076923       0 0.35328478 0.58655743 0.06015779
+117 2.25000000       0 0.31510417 0.61197917 0.07291667
+118 2.26923077       0 0.27775565 0.63324040 0.08900394
+119 2.28846154       0 0.24181531 0.64976507 0.10841963
+120 2.30769231       0 0.20785920 0.66097709 0.13116371
+121 2.32692308       0 0.17646341 0.66630040 0.15723619
+122 2.34615385       0 0.14817554 0.66521582 0.18660863
+123 2.36538462       0 0.12321252 0.65786560 0.21892187
+124 2.38461538       0 0.10157791 0.64481869 0.25360340
+125 2.40384615       0 0.08327170 0.62665116 0.29007714
+126 2.42307692       0 0.06829389 0.60393908 0.32776703
+127 2.44230769       0 0.05664448 0.57725852 0.36609700
+128 2.46153846       0 0.04832347 0.54718556 0.40449097
+129 2.48076923       0 0.04333087 0.51429625 0.44237289
+130 2.50000000       0 0.04166667 0.47916667 0.47916667
+131 2.51923077       0 0.04333087 0.44237289 0.51429625
+132 2.53846154       0 0.04832347 0.40449097 0.54718556
+133 2.55769231       0 0.05664448 0.36609700 0.57725852
+134 2.57692308       0 0.06829389 0.32776703 0.60393908
+135 2.59615385       0 0.08327170 0.29007714 0.62665116
+136 2.61538462       0 0.10157791 0.25360340 0.64481869
+137 2.63461538       0 0.12321252 0.21892187 0.65786560
+138 2.65384615       0 0.14817554 0.18660863 0.66521582
+139 2.67307692       0 0.17646341 0.15723619 0.66630040
+140 2.69230769       0 0.20785920 0.13116371 0.66097709
+141 2.71153846       0 0.24181531 0.10841963 0.64976507
+142 2.73076923       0 0.27775565 0.08900394 0.63324040
+143 2.75000000       0 0.31510417 0.07291667 0.61197917
+144 2.76923077       0 0.35328478 0.06015779 0.58655743
+145 2.78846154       0 0.39172143 0.05072732 0.55755125
+146 2.80769231       0 0.42983804 0.04462525 0.52553672
+147 2.82692308       0 0.46705854 0.04185158 0.49108989
+148 2.84615385       0 0.50280686 0.04240631 0.45478683
+149 2.86538462       0 0.53650693 0.04628945 0.41720362
+150 2.88461538       0 0.56758269 0.05350099 0.37891633
+151 2.90384615       0 0.59545806 0.06404093 0.34050101
+152 2.92307692       0 0.61955697 0.07790927 0.30253376
+153 2.94230769       0 0.63930336 0.09510602 0.26559063
+154 2.96153846       0 0.65412115 0.11563116 0.23024769
+155 2.98076923       0 0.66343428 0.13948471 0.19708101
+156 3.00000000       0 0.66666667 0.16666667 0.16666667
+157 3.01923077       0 0.66343428 0.19708101 0.13948471
+158 3.03846154       0 0.65412115 0.23024769 0.11563116
+159 3.05769231       0 0.63930336 0.26559063 0.09510602
+160 3.07692308       0 0.61955697 0.30253376 0.07790927
+161 3.09615385       0 0.59545806 0.34050101 0.06404093
+162 3.11538462       0 0.56758269 0.37891633 0.05350099
+163 3.13461538       0 0.53650693 0.41720362 0.04628945
+164 3.15384615       0 0.50280686 0.45478683 0.04240631
+165 3.17307692       0 0.46705854 0.49108989 0.04185158
+166 3.19230769       0 0.42983804 0.52553672 0.04462525
+167 3.21153846       0 0.39172143 0.55755125 0.05072732
+168 3.23076923       0 0.35328478 0.58655743 0.06015779
+169 3.25000000       0 0.31510417 0.61197917 0.07291667
+170 3.26923077       0 0.27775565 0.63324040 0.08900394
+171 3.28846154       0 0.24181531 0.64976507 0.10841963
+172 3.30769231       0 0.20785920 0.66097709 0.13116371
+173 3.32692308       0 0.17646341 0.66630040 0.15723619
+174 3.34615385       0 0.14817554 0.66521582 0.18660863
+175 3.36538462       0 0.12321252 0.65786560 0.21892187
+176 3.38461538       0 0.10157791 0.64481869 0.25360340
+177 3.40384615       0 0.08327170 0.62665116 0.29007714
+178 3.42307692       0 0.06829389 0.60393908 0.32776703
+179 3.44230769       0 0.05664448 0.57725852 0.36609700
+180 3.46153846       0 0.04832347 0.54718556 0.40449097
+181 3.48076923       0 0.04333087 0.51429625 0.44237289
+182 3.50000000       0 0.04166667 0.47916667 0.47916667
+183 3.51923077       0 0.04333087 0.44237289 0.51429625
+184 3.53846154       0 0.04832347 0.40449097 0.54718556
+185 3.55769231       0 0.05664448 0.36609700 0.57725852
+186 3.57692308       0 0.06829389 0.32776703 0.60393908
+187 3.59615385       0 0.08327170 0.29007714 0.62665116
+188 3.61538462       0 0.10157791 0.25360340 0.64481869
+189 3.63461538       0 0.12321252 0.21892187 0.65786560
+190 3.65384615       0 0.14817554 0.18660863 0.66521582
+191 3.67307692       0 0.17646341 0.15723619 0.66630040
+192 3.69230769       0 0.20785920 0.13116371 0.66097709
+193 3.71153846       0 0.24181531 0.10841963 0.64976507
+194 3.73076923       0 0.27775565 0.08900394 0.63324040
+195 3.75000000       0 0.31510417 0.07291667 0.61197917
+196 3.76923077       0 0.35328478 0.06015779 0.58655743
+197 3.78846154       0 0.39172143 0.05072732 0.55755125
+198 3.80769231       0 0.42983804 0.04462525 0.52553672
+199 3.82692308       0 0.46705854 0.04185158 0.49108989
+200 3.84615385       0 0.50280686 0.04240631 0.45478683
+201 3.86538462       0 0.53650693 0.04628945 0.41720362
+202 3.88461538       0 0.56758269 0.05350099 0.37891633
+203 3.90384615       0 0.59545806 0.06404093 0.34050101
+204 3.92307692       0 0.61955697 0.07790927 0.30253376
+205 3.94230769       0 0.63930336 0.09510602 0.26559063
+206 3.96153846       0 0.65412115 0.11563116 0.23024769
+207 3.98076923       0 0.66343428 0.13948471 0.19708101
+208 4.00000000       0 0.66666667 0.16666667 0.16666667
 zero time, t0 = 0
 parameter(s) unspecified
 process model simulator, rprocess = 
@@ -394,7 +394,7 @@
         zeronames = zeronames, tcovar = tcovar, covar = covar, 
         args = pairlist(...))
 }
-<environment: 0x1513c10>
+<environment: 0x14e87b8>
 process model density, dprocess = 
 function (x, times, params, ..., statenames = character(0), paramnames = character(0), 
     covarnames = character(0), tcovar, covar, log = FALSE) 
@@ -404,7 +404,7 @@
         covarnames = covarnames, tcovar = tcovar, covar = covar, 
         log = log, args = pairlist(...))
 }
-<environment: 0x1edb848>
+<environment: 0x193a340>
 measurement model simulator, rmeasure = 
 function (x, t, params, covars, ...) 
 {
@@ -463,11 +463,11 @@
 parameter transform function = 
 function (params, ...) 
 params
-<environment: 0x1057aa0>
+<environment: 0x15beeb0>
 parameter inverse transform function = 
 function (params, ...) 
 params
-<environment: 0x1057aa0>
+<environment: 0x15beeb0>
 userdata = 
 $zeronames
 [1] "cases"
@@ -479,7 +479,7 @@
 > x <- simulate(po,params=log(params),nsim=3)
 > toc <- Sys.time()
 > print(toc-tic)
-Time difference of 2.048561 secs
+Time difference of 2.027774 secs
 > 
 > pdf(file='sir.pdf')
 > 
@@ -496,7 +496,7 @@
 > X3 <- trajectory(po,params=log(params),times=t3,hmax=1/52)
 > toc <- Sys.time()
 > print(toc-tic)
-Time difference of 2.724916 secs
+Time difference of 2.722191 secs
 > plot(t3,X3['I',1,],type='l')
 > 
 > f1 <- dprocess(
@@ -556,7 +556,7 @@
 > x <- simulate(po,nsim=100)
 > toc <- Sys.time()
 > print(toc-tic)
-Time difference of 2.509698 secs
+Time difference of 2.520875 secs
 > plot(x[[1]],variables=c("S","I","R","cases","W"))
 > 
 > t3 <- seq(0,20,by=1/52)
@@ -564,7 +564,7 @@
 > X4 <- trajectory(po,times=t3,hmax=1/52)
 > toc <- Sys.time()
 > print(toc-tic)
-Time difference of 0.153466 secs
+Time difference of 0.1533842 secs
 > plot(t3,X4['I',1,],type='l')
 > 
 > g2 <- dmeasure(



More information about the pomp-commits mailing list