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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri May 23 18:23:09 CEST 2014


Author: kingaa
Date: 2014-05-23 18:23:09 +0200 (Fri, 23 May 2014)
New Revision: 961

Modified:
   pkg/pomp/DESCRIPTION
   pkg/pomp/NAMESPACE
   pkg/pomp/R/abc-methods.R
   pkg/pomp/R/pmcmc-methods.R
   pkg/pomp/R/pomp-methods.R
   pkg/pomp/man/pmcmc-methods.Rd
   pkg/pomp/src/Makevars
   pkg/pomp/tests/ou2-pmcmc.R
   pkg/pomp/tests/ou2-pmcmc.Rout.save
   pkg/pomp/tests/rw2.Rout.save
   pkg/pomp/tests/sir.Rout.save
Log:
- change 'show' method for 'pomp' objects to be somewhat less verbose
- add 'pmcmcList' class and associated methods to facilitate multiple-chain algorithms

Modified: pkg/pomp/DESCRIPTION
===================================================================
--- pkg/pomp/DESCRIPTION	2014-05-19 20:45:32 UTC (rev 960)
+++ pkg/pomp/DESCRIPTION	2014-05-23 16:23:09 UTC (rev 961)
@@ -1,8 +1,8 @@
 Package: pomp
 Type: Package
 Title: Statistical inference for partially observed Markov processes
-Version: 0.50-9
-Date: 2014-05-18
+Version: 0.51-1
+Date: 2014-05-21
 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")),
@@ -18,7 +18,7 @@
 	  )
 URL: http://pomp.r-forge.r-project.org
 Description: Inference methods for partially-observed Markov processes
-Depends: R(>= 3.0.0), stats, graphics, methods, mvtnorm, subplex, nloptr, deSolve
+Depends: R(>= 3.0.0), stats, graphics, methods, mvtnorm, subplex, nloptr, deSolve, coda
 Suggests: knitr
 License: GPL(>= 2)
 LazyData: true

Modified: pkg/pomp/NAMESPACE
===================================================================
--- pkg/pomp/NAMESPACE	2014-05-19 20:45:32 UTC (rev 960)
+++ pkg/pomp/NAMESPACE	2014-05-23 16:23:09 UTC (rev 961)
@@ -38,12 +38,13 @@
 importFrom(subplex,subplex)
 importFrom(deSolve,ode)
 importFrom(nloptr,nloptr)
+importFrom(coda,mcmc,mcmc.list)
 
 exportClasses(
               pomp,
               pfilterd.pomp,
               mif,
-              pmcmc,
+              pmcmc,pmcmcList,
               traj.matched.pomp,
               probed.pomp,probe.matched.pomp,
               spect.pomp,spect.matched.pomp,
@@ -87,7 +88,7 @@
        profileDesign,
        bspline.basis,
        periodic.bspline.basis,
-       compare.mif,compare.pmcmc,compare.abc,
+       compare.mif,
        nlf,
        parmat,
        logmeanexp,

Modified: pkg/pomp/R/abc-methods.R
===================================================================
--- pkg/pomp/R/abc-methods.R	2014-05-19 20:45:32 UTC (rev 960)
+++ pkg/pomp/R/abc-methods.R	2014-05-23 16:23:09 UTC (rev 961)
@@ -6,18 +6,18 @@
           'abc',
           function (object, pars, ...) {
             if (missing(pars)) pars <- colnames(object at conv.rec)
-            object at conv.rec[,pars]
+            coda::mcmc(object at conv.rec[,pars])
           }
           )
 
-## plot pmcmc object
+## plot abc object
 setMethod(
           "plot",
           "abc",
           function (x, y, pars, scatter = FALSE, ...) {
             if (missing(pars)) pars <- x at pars
             if (scatter) {
-              pairs(conv.rec(x, pars))
+              pairs(as.matrix(conv.rec(x, pars)))
             } else {
               plot.ts(conv.rec(x,pars),xlab="iteration",...)
             }

Modified: pkg/pomp/R/pmcmc-methods.R
===================================================================
--- pkg/pomp/R/pmcmc-methods.R	2014-05-19 20:45:32 UTC (rev 960)
+++ pkg/pomp/R/pmcmc-methods.R	2014-05-23 16:23:09 UTC (rev 961)
@@ -3,41 +3,133 @@
 ## extract the estimated log likelihood
 setMethod('logLik','pmcmc',function(object,...)object at loglik)
 
-## extract the filtering means
-setMethod(
-          'filter.mean',
-          'pmcmc',
-          function (object, pars, ...) {
-            if (missing(pars)) pars <- rownames(object at filter.mean)
-            object at filter.mean[pars,]
-          }
-          )
-
 ## extract the convergence record
 setMethod(
           'conv.rec',
-          'pmcmc',
+          signature=signature(object='pmcmc'),
           function (object, pars, ...) {
             if (missing(pars)) pars <- colnames(object at conv.rec)
-            object at conv.rec[,pars]
+            coda::mcmc(object at conv.rec[,pars])
           }
           )
 
 ## plot pmcmc object
 setMethod(
           "plot",
-          "pmcmc",
+          signature=signature(x='pmcmc'),
           function (x, y = NULL, ...) {
-            compare.pmcmc(x)
+            pmcmc.diagnostics(list(x))
           }
           )
 
-compare.pmcmc <- function (z) {
+
+## pmcmcList class
+setClass(
+         'pmcmcList',
+         slots=c(
+           list = 'list'
+           ),
+         prototype=prototype(
+           list = list()
+           ),
+         validity=function (object) {
+           if (!all(sapply(object at list,is,'pmcmc'))) {
+             retval <- paste0(
+                              "error in ",sQuote("c"),
+                              ": dissimilar objects cannot be combined"
+                              )
+             return(retval)
+           }
+           d <- sapply(object at list,function(x)dim(x at conv.rec))
+           if (!all(apply(d,1,diff)==0)) {
+             retval <- paste0(
+                              "error in ",sQuote("c"),
+                              ": to be combined, ",sQuote("pmcmc"),
+                              " objects must have chains of equal length"
+                              )
+             return(retval)
+           }
+           TRUE
+         }
+         )
+
+setMethod(
+          'c',
+          signature=signature(x='pmcmc'),
+          definition=function (x, ...) {
+            y <- list(...)
+            if (length(y)==0) {
+              new("pmcmcList",list=list(x))
+            } else {
+              p <- sapply(y,is,'pmcmc')
+              q <- sapply(y,is,'pmcmcList')
+              if (any(!(p||q)))
+                stop("cannot mix ",sQuote("pmcmc"),
+                     " and non-",sQuote("pmcmc")," objects")
+              y[p] <- lapply(y[p],list)
+              y[q] <- lapply(y[q],slot,"list")
+              new("pmcmcList",list=c(list(x),y,recursive=TRUE))
+            }
+          }
+          )
+
+setMethod(
+          'c',
+          signature=signature(x='pmcmcList'),
+          definition=function (x, ...) {
+            y <- list(...)
+            if (length(y)==0) {
+              x
+            } else {
+              x <- x at list
+              p <- sapply(y,is,'pmcmc')
+              pl <- sapply(y,is,'pmcmcList')
+              if (any(!(p||pl)))
+                stop("cannot mix ",sQuote("pmcmc"),
+                     " and non-",sQuote("pmcmc")," objects")
+              y[p] <- lapply(y[p],list)
+              y[pl] <- lapply(y[pl],slot,"list")
+              new("pmcmcList",list=c(x,y,recursive=TRUE))
+            }
+          }
+          )
+
+setMethod(
+          "[",
+          signature=signature(x="pmcmcList"),
+          definition=function(x, i, ...) {
+            y <- x
+            y at list <- x at list[i]
+            y
+          }
+          )
+
+setMethod(
+          "[[",
+          signature=signature(x="pmcmcList"),
+          definition=function(x, i, ...) {
+            x at list[[i]]
+          }
+          )
+
+setMethod(
+          'conv.rec',
+          signature=signature(object='pmcmcList'),
+          definition=function (object, ...) {
+            coda::mcmc.list(lapply(object at list,conv.rec,...))
+          }
+          )
+
+setMethod(
+          "plot",
+          signature=signature(x='pmcmcList'),
+          definition=function (x, y = NULL, ...) {
+            pmcmc.diagnostics(x at list)
+          }
+          )
+
+pmcmc.diagnostics <- function (z) {
   ## assumes that x is a list of pmcmcs with identical structure
-  if (!is.list(z)) z <- list(z)
-  if (!all(sapply(z,function(x)is(x,'pmcmc'))))
-    stop("compare.pmcmc error: ",sQuote("z"),
-         " must be a pmcmc object or a list of pmcmc objects",call.=FALSE)
   mar.multi <- c(0,5.1,0,2.1)
   oma.multi <- c(6,0,5,0)
   xx <- z[[1]]
@@ -81,3 +173,13 @@
   }
   invisible(NULL)
 }
+
+compare.pmcmc <- function (z) {
+  if (!is.list(z)) z <- list(z)
+  if (!all(sapply(z,function(x)is(x,'pmcmc'))))
+    stop("compare.pmcmc error: ",sQuote("z"),
+         " must be a pmcmc object or a list of pmcmc objects",call.=FALSE)
+  warning(sQuote("compare.pmcmc")," is deprecated.\n",
+          "Use ",sQuote("diagnostics")," instead.",call.=FALSE)
+  pmcmc.diagnostics(z)
+}

Modified: pkg/pomp/R/pomp-methods.R
===================================================================
--- pkg/pomp/R/pomp-methods.R	2014-05-19 20:45:32 UTC (rev 960)
+++ pkg/pomp/R/pomp-methods.R	2014-05-23 16:23:09 UTC (rev 961)
@@ -243,7 +243,7 @@
           "print",
           "pomp",
           function (x, ...) {
-            cat("data and states:\n")
+            cat("data, states, and covariates:\n")
             print(as(x,"data.frame"))
             invisible(x)
           }
@@ -253,13 +253,20 @@
           "show",
           "pomp",
           function (object) {
-            print(object)
+            cat(length(object at times),"records of",
+                nrow(obs(object)),"observables,",
+                "recorded from t =",
+                min(object at times),"to",max(object at times),"\n")
+            cat("summary of data:\n")
+            print(summary(as.data.frame(t(obs(object)))))
             cat("zero time, t0 = ",object at t0,"\n",sep="")
-            if (length(coef(object))>0) {
-              cat("parameter(s):\n")
-              print(coef(object))
-            } else {
-              cat ("parameter(s) unspecified\n");
+            if (length(object at tcovar)>0) {
+              cat(nrow(object at covar),"records of",
+                  ncol(object at covar),"covariates,",
+                  "recorded from t =",min(object at tcovar),
+                  "to",max(object at tcovar),"\n")
+              cat("summary of covariates:\n")
+              print(summary(as.data.frame(object at covar)))
             }
             cat("process model simulator, rprocess = \n")
             show(object at rprocess)
@@ -283,6 +290,12 @@
             show(object at par.trans)
             cat("parameter inverse transform function = \n")
             show(object at par.untrans)
+            if (length(coef(object))>0) {
+              cat("parameter(s):\n")
+              print(coef(object))
+            } else {
+              cat ("parameter(s) unspecified\n");
+            }
             if (length(object at userdata)>0) {
               cat("userdata = \n")
               show(object at userdata)

Modified: pkg/pomp/man/pmcmc-methods.Rd
===================================================================
--- pkg/pomp/man/pmcmc-methods.Rd	2014-05-19 20:45:32 UTC (rev 960)
+++ pkg/pomp/man/pmcmc-methods.Rd	2014-05-23 16:23:09 UTC (rev 961)
@@ -5,25 +5,35 @@
 \alias{logLik-pmcmc}
 \alias{conv.rec,pmcmc-method}
 \alias{conv.rec-pmcmc}
-\alias{filter.mean,pmcmc-method}
-\alias{filter.mean-pmcmc}
+\alias{conv.rec,pmcmcList-method}
+\alias{conv.rec-pmcmcList}
 \alias{plot-pmcmc}
 \alias{plot,pmcmc-method}
-\alias{compare.pmcmc}
+\alias{plot-pmcmcList}
+\alias{plot,pmcmcList-method}
+\alias{pmcmcList-class}
+\alias{c-pmcmc}
+\alias{c,pmcmc-method}
+\alias{c-pmcmcList}
+\alias{c,pmcmcList-method}
+\alias{[-pmcmcList}
+\alias{[,pmcmcList-method}
+\alias{[[-pmcmcList}
+\alias{[[,pmcmcList-method}
 \title{Methods of the "pmcmc" class}
 \description{Methods of the "pmcmc" class.}
 \usage{
 \S4method{logLik}{pmcmc}(object, \dots)
 \S4method{conv.rec}{pmcmc}(object, pars, \dots)
-\S4method{filter.mean}{pmcmc}(object, pars, \dots)
+\S4method{conv.rec}{pmcmcList}(object, \dots)
 \S4method{plot}{pmcmc}(x, y = NULL, \dots)
-compare.pmcmc(z)
+\S4method{c}{pmcmc}(x, \dots, recursive = FALSE)
+\S4method{c}{pmcmcList}(x, \dots, recursive = FALSE)
 }
 \arguments{
-  \item{object, x}{The \code{pmcmc} object.}
+  \item{object, x}{The \code{pmcmc} or \code{pmcmcList} object.}
   \item{pars}{Names of parameters.}
-  \item{y}{Ignored.}
-  \item{z}{A \code{pmcmc} object or list of \code{pmcmc} objects.}
+  \item{y, recursive}{Ignored.}
   \item{\dots}{
     Further arguments (either ignored or passed to underlying functions).
   }
@@ -31,36 +41,18 @@
 \section{Methods}{
   \describe{
     \item{conv.rec}{
-      \code{conv.rec(object, pars)} returns the columns of the convergence-record matrix corresponding to the names in \code{pars}.
-      By default, all rows are returned.
+      \code{conv.rec(object, pars)} returns the columns of the convergence-record matrix corresponding to the names in \code{pars} as an object of class \code{\link[coda]{mcmc}} or \code{\link[coda]{mcmc.list}}.
     }
+    \item{plot}{
+      Plots density- and trace-plots.
+      This uses package \pkg{coda}'s default plots.
+    }
     \item{logLik}{
       Returns the value in the \code{loglik} slot.
     }
-    \item{pmcmc}{
-      Re-runs the PMCMC iterations.
-      See the documentation for \code{\link{pmcmc}}.
+    \item{c}{
+      Concatenates \code{pmcmc} objects into a \code{pmcmcList}.
     }
-    \item{compare.pmcmc}{
-      Given a \code{pmcmc} object or a list of \code{pmcmc} objects, \code{compare.pmcmc} produces a set of diagnostic plots.
-    }
-    \item{plot}{
-      Plots a series of diagnostic plots.
-      When \code{x} is a \code{pmcmc} object, \code{plot(x)} is equivalent to \code{compare.pmcmc(list(x))}.
-    }
-    \item{filter.mean}{
-      \code{filter.mean(object, pars = NULL)} returns the rows of the filtering-mean matrix corresponding to the names in \code{pars}.
-      By default, all rows are returned.
-    }
-    \item{print}{
-      Prints a summary of the \code{pmcmc} object.
-    }
-    \item{show}{
-      Displays the \code{pmcmc} object.
-    }
-    \item{pfilter}{
-      See \code{\link{pfilter}}.
-    }
   }
 }
 \references{


Property changes on: pkg/pomp/src/Makevars
___________________________________________________________________
Deleted: svn:executable
   - *

Modified: pkg/pomp/tests/ou2-pmcmc.R
===================================================================
--- pkg/pomp/tests/ou2-pmcmc.R	2014-05-19 20:45:32 UTC (rev 960)
+++ pkg/pomp/tests/ou2-pmcmc.R	2014-05-23 16:23:09 UTC (rev 961)
@@ -17,7 +17,7 @@
             max.fail=100, 
             verbose=FALSE
             )
-f1 <- continue(f1,Nmcmc=200,max.fail=100)
+f1 <- continue(f1,Nmcmc=20,max.fail=100)
 plot(f1)
 
 ff <- pfilter(f1)
@@ -29,44 +29,55 @@
             verbose=FALSE
             )
 
-f3 <- pmcmc(
-            ff,
-            Nmcmc=20,
-            transform=TRUE,
-            rw.sd=c(alpha.2=0.01,alpha.3=0.01),
-            max.fail=100, 
-            verbose=FALSE
-            )
-f4 <- pmcmc(f3)
-f4 <- continue(f4,Nmcmc=100)
+f3 <- pmcmc(f2)
+f4 <- continue(f3,Nmcmc=20)
 
-if (FALSE) {
-  f2 <- pmcmc(
-              f1,Nmcmc=1000,Np=500,max.fail=100,
-              verbose=FALSE
-              )
-  plot(f2)
-  runs <- rle(conv.rec(f2)[,'loglik'])$lengths
-  plot(runs)
-  acf(conv.rec(f2)[,c("alpha.2","alpha.3")])
-}
+plot(c(f2,f3))
 
-dprior.ou2 <- function (params, log, ...) {
-  f <- sum(dnorm(params,mean=coef(ou2),sd=1,log=TRUE))
-  if (log) f else exp(f)
+try(ff <- c(f3,f4))
+
+if (Sys.getenv("POMP_FULL_TESTS")=="yes") {
+  f2a <- pmcmc(
+               f1,Nmcmc=1000,Np=100,max.fail=100,
+               verbose=FALSE
+               )
+  plot(f2a)
+  runs <- rle(as.numeric(conv.rec(f2a,'loglik')))$lengths
+  plot(sort(runs))
+  acf(conv.rec(f2a,c("alpha.2","alpha.3")))
 }
 
 f5 <- pmcmc(
-            ou2,
-            start=coef(ou2),
+            pomp(ou2,
+                 dprior=function (params, log, ...) {
+                   f <- sum(dnorm(params,mean=coef(ou2),sd=1,log=TRUE))
+                   if (log) f else exp(f)
+                 }
+                 ),
             Nmcmc=20,
             rw.sd=c(alpha.2=0.001,alpha.3=0.001),
             Np=100,
             max.fail=100, 
             verbose=FALSE
             )
-f5 <- continue(f5,Nmcmc=200,max.fail=100)
-plot(f5)
+f6 <- continue(f5,Nmcmc=20,max.fail=100)
+plot(f6)
 
+ff <- c(f4,f6)
+plot(ff)
+plot(conv.rec(ff,c("alpha.2","alpha.3","loglik")))
+
+ff <- c(f2,f3)
+
+try(ff <- c(ff,f4,f6))
+try(ff <- c(f4,ou2))
+try(ff <- c(ff,ou2))
+
+plot(ff <- c(ff,f5))
+plot(conv.rec(c(f2,ff),c("alpha.2","alpha.3")))
+plot(conv.rec(ff[2],c("alpha.2")))
+plot(conv.rec(ff[2:3],c("alpha.3")))
+plot(conv.rec(ff[[3]],c("alpha.3")))
+
 dev.off()
 

Modified: pkg/pomp/tests/ou2-pmcmc.Rout.save
===================================================================
--- pkg/pomp/tests/ou2-pmcmc.Rout.save	2014-05-19 20:45:32 UTC (rev 960)
+++ pkg/pomp/tests/ou2-pmcmc.Rout.save	2014-05-23 16:23:09 UTC (rev 961)
@@ -1,5 +1,5 @@
 
-R version 3.0.3 (2014-03-06) -- "Warm Puppy"
+R version 3.1.0 (2014-04-10) -- "Spring Dance"
 Copyright (C) 2014 The R Foundation for Statistical Computing
 Platform: x86_64-unknown-linux-gnu (64-bit)
 
@@ -20,6 +20,8 @@
 Loading required package: subplex
 Loading required package: nloptr
 Loading required package: deSolve
+Loading required package: coda
+Loading required package: lattice
 > 
 > pompExample(ou2)
 newly created pomp object(s):
@@ -40,7 +42,7 @@
 +             max.fail=100, 
 +             verbose=FALSE
 +             )
-> f1 <- continue(f1,Nmcmc=200,max.fail=100)
+> f1 <- continue(f1,Nmcmc=20,max.fail=100)
 > plot(f1)
 > 
 > ff <- pfilter(f1)
@@ -52,45 +54,62 @@
 +             verbose=FALSE
 +             )
 > 
-> f3 <- pmcmc(
-+             ff,
-+             Nmcmc=20,
-+             transform=TRUE,
-+             rw.sd=c(alpha.2=0.01,alpha.3=0.01),
-+             max.fail=100, 
-+             verbose=FALSE
-+             )
-> f4 <- pmcmc(f3)
-> f4 <- continue(f4,Nmcmc=100)
+> f3 <- pmcmc(f2)
+> f4 <- continue(f3,Nmcmc=20)
 > 
-> if (FALSE) {
-+   f2 <- pmcmc(
-+               f1,Nmcmc=1000,Np=500,max.fail=100,
-+               verbose=FALSE
-+               )
-+   plot(f2)
-+   runs <- rle(conv.rec(f2)[,'loglik'])$lengths
-+   plot(runs)
-+   acf(conv.rec(f2)[,c("alpha.2","alpha.3")])
-+ }
+> plot(c(f2,f3))
 > 
-> dprior.ou2 <- function (params, log, ...) {
-+   f <- sum(dnorm(params,mean=coef(ou2),sd=1,log=TRUE))
-+   if (log) f else exp(f)
+> try(ff <- c(f3,f4))
+Error in validObject(.Object) : 
+  invalid class "pmcmcList" object: error in 'c': to be combined, 'pmcmc' objects must have chains of equal length
+> 
+> if (Sys.getenv("POMP_FULL_TESTS")=="yes") {
++   f2a <- pmcmc(
++                f1,Nmcmc=1000,Np=100,max.fail=100,
++                verbose=FALSE
++                )
++   plot(f2a)
++   runs <- rle(as.numeric(conv.rec(f2a,'loglik')))$lengths
++   plot(sort(runs))
++   acf(conv.rec(f2a,c("alpha.2","alpha.3")))
 + }
 > 
 > f5 <- pmcmc(
-+             ou2,
-+             start=coef(ou2),
++             pomp(ou2,
++                  dprior=function (params, log, ...) {
++                    f <- sum(dnorm(params,mean=coef(ou2),sd=1,log=TRUE))
++                    if (log) f else exp(f)
++                  }
++                  ),
 +             Nmcmc=20,
 +             rw.sd=c(alpha.2=0.001,alpha.3=0.001),
 +             Np=100,
 +             max.fail=100, 
 +             verbose=FALSE
 +             )
-> f5 <- continue(f5,Nmcmc=200,max.fail=100)
-> plot(f5)
+> f6 <- continue(f5,Nmcmc=20,max.fail=100)
+> plot(f6)
 > 
+> ff <- c(f4,f6)
+> plot(ff)
+> plot(conv.rec(ff,c("alpha.2","alpha.3","loglik")))
+> 
+> ff <- c(f2,f3)
+> 
+> try(ff <- c(ff,f4,f6))
+Error in validObject(.Object) : 
+  invalid class "pmcmcList" object: error in 'c': to be combined, 'pmcmc' objects must have chains of equal length
+> try(ff <- c(f4,ou2))
+Error in c(f4, ou2) : cannot mix 'pmcmc' and non-'pmcmc' objects
+> try(ff <- c(ff,ou2))
+Error in c(ff, ou2) : cannot mix 'pmcmc' and non-'pmcmc' objects
+> 
+> plot(ff <- c(ff,f5))
+> plot(conv.rec(c(f2,ff),c("alpha.2","alpha.3")))
+> plot(conv.rec(ff[2],c("alpha.2")))
+> plot(conv.rec(ff[2:3],c("alpha.3")))
+> plot(conv.rec(ff[[3]],c("alpha.3")))
+> 
 > dev.off()
 null device 
           1 
@@ -98,4 +117,4 @@
 > 
 > proc.time()
    user  system elapsed 
- 13.904   0.052  14.145 
+ 23.369   0.040  23.847 

Modified: pkg/pomp/tests/rw2.Rout.save
===================================================================
--- pkg/pomp/tests/rw2.Rout.save	2014-05-19 20:45:32 UTC (rev 960)
+++ pkg/pomp/tests/rw2.Rout.save	2014-05-23 16:23:09 UTC (rev 961)
@@ -1,5 +1,5 @@
 
-R version 3.0.3 (2014-03-06) -- "Warm Puppy"
+R version 3.1.0 (2014-04-10) -- "Spring Dance"
 Copyright (C) 2014 The R Foundation for Statistical Computing
 Platform: x86_64-unknown-linux-gnu (64-bit)
 
@@ -20,6 +20,8 @@
 Loading required package: subplex
 Loading required package: nloptr
 Loading required package: deSolve
+Loading required package: coda
+Loading required package: lattice
 > 
 > set.seed(45768683)
 > 
@@ -113,110 +115,16 @@
 +             )
 > 
 > invisible(show(rw2))
-data and states:
-    time y1 y2
-1      1  0  0
-2      2  0  0
-3      3  0  0
-4      4  0  0
-5      5  0  0
-6      6  0  0
-7      7  0  0
-8      8  0  0
-9      9  0  0
-10    10  0  0
-11    11  0  0
-12    12  0  0
-13    13  0  0
-14    14  0  0
-15    15  0  0
-16    16  0  0
-17    17  0  0
-18    18  0  0
-19    19  0  0
-20    20  0  0
-21    21  0  0
-22    22  0  0
-23    23  0  0
-24    24  0  0
-25    25  0  0
-26    26  0  0
-27    27  0  0
-28    28  0  0
-29    29  0  0
-30    30  0  0
-31    31  0  0
-32    32  0  0
-33    33  0  0
-34    34  0  0
-35    35  0  0
-36    36  0  0
-37    37  0  0
-38    38  0  0
-39    39  0  0
-40    40  0  0
-41    41  0  0
-42    42  0  0
-43    43  0  0
-44    44  0  0
-45    45  0  0
-46    46  0  0
-47    47  0  0
-48    48  0  0
-49    49  0  0
-50    50  0  0
-51    51  0  0
-52    52  0  0
-53    53  0  0
-54    54  0  0
-55    55  0  0
-56    56  0  0
-57    57  0  0
-58    58  0  0
-59    59  0  0
-60    60  0  0
-61    61  0  0
-62    62  0  0
-63    63  0  0
-64    64  0  0
-65    65  0  0
-66    66  0  0
-67    67  0  0
-68    68  0  0
-69    69  0  0
-70    70  0  0
-71    71  0  0
-72    72  0  0
-73    73  0  0
-74    74  0  0
-75    75  0  0
-76    76  0  0
-77    77  0  0
-78    78  0  0
-79    79  0  0
-80    80  0  0
-81    81  0  0
-82    82  0  0
-83    83  0  0
-84    84  0  0
-85    85  0  0
-86    86  0  0
-87    87  0  0
-88    88  0  0
-89    89  0  0
-90    90  0  0
-91    91  0  0
-92    92  0  0
-93    93  0  0
-94    94  0  0
-95    95  0  0
-96    96  0  0
-97    97  0  0
-98    98  0  0
-99    99  0  0
-100  100  0  0
+100 records of 2 observables, recorded from t = 1 to 100 
+summary of data:
+       y1          y2   
+ Min.   :0   Min.   :0  
+ 1st Qu.:0   1st Qu.:0  
+ Median :0   Median :0  
+ Mean   :0   Mean   :0  
+ 3rd Qu.:0   3rd Qu.:0  
+ Max.   :0   Max.   :0  
 zero time, t0 = 0
-parameter(s) unspecified
 process model simulator, rprocess = 
 function (params, xstart, times, ...) 
 {
@@ -260,7 +168,7 @@
     }
     y
 }
-<environment: 0x25f5b00>
+<environment: 0x310abf8>
 measurement model density, dmeasure = 
 function (y, x, t, params, log, covars, ...) 
 {
@@ -273,7 +181,7 @@
         f
     else exp(f)
 }
-<environment: 0x25f5b00>
+<environment: 0x310abf8>
 prior simulator, rprior = 
 function not specified
 prior density, dprior = 
@@ -291,6 +199,7 @@
 function not specified
 parameter inverse transform function = 
 function not specified
+parameter(s) unspecified
 userdata = 
 $useless
 [1] 23
@@ -401,7 +310,7 @@
 > invisible(timezero(new))
 > timezero(new) <- 19
 > print(simulate(new))
-data and states:
+data, states, and covariates:
    time         y1         y2         x1         x2
 1    20  0.2438664  3.1093573  0.5247663  5.0741536
 2    21 -2.4324990  4.5669427 -2.2582676  4.2250510
@@ -437,4 +346,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  0.944   0.076   1.040 
+  0.968   0.064   1.059 

Modified: pkg/pomp/tests/sir.Rout.save
===================================================================
--- pkg/pomp/tests/sir.Rout.save	2014-05-19 20:45:32 UTC (rev 960)
+++ pkg/pomp/tests/sir.Rout.save	2014-05-23 16:23:09 UTC (rev 961)
@@ -20,6 +20,8 @@
 Loading required package: subplex
 Loading required package: nloptr
 Loading required package: deSolve
+Loading required package: coda
+Loading required package: lattice
 > 
 > tbasis <- seq(0,25,by=1/52)
 > basis <- periodic.bspline.basis(tbasis,nbasis=3,names="seas%d")
@@ -166,222 +168,25 @@
 +            )
 > 
 > show(po)
-data and states:
-          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
[TRUNCATED]

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


More information about the pomp-commits mailing list