[Pomp-commits] r970 - pkg pkg/pomp pkg/pomp/R pkg/pomp/inst pkg/pomp/man pkg/pomp/tests www/content www/vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jun 9 18:32:01 CEST 2014


Author: kingaa
Date: 2014-06-09 18:32:00 +0200 (Mon, 09 Jun 2014)
New Revision: 970

Modified:
   pkg/Makefile
   pkg/pomp/DESCRIPTION
   pkg/pomp/NAMESPACE
   pkg/pomp/R/abc-methods.R
   pkg/pomp/R/pmcmc-methods.R
   pkg/pomp/inst/NEWS
   pkg/pomp/inst/NEWS.Rd
   pkg/pomp/man/abc-methods.Rd
   pkg/pomp/man/pmcmc-methods.Rd
   pkg/pomp/tests/abc.R
   pkg/pomp/tests/abc.Rout.save
   www/content/NEWS.html
   www/vignettes/advanced_topics_in_pomp.R
   www/vignettes/advanced_topics_in_pomp.Rnw
   www/vignettes/advanced_topics_in_pomp.pdf
   www/vignettes/intro_to_pomp.R
   www/vignettes/intro_to_pomp.Rnw
   www/vignettes/intro_to_pomp.pdf
   www/vignettes/pomp.pdf
Log:
- redefine the 'pmcmcList' class so that it contains 'list'
- add 'abcList' class and associated methods
- fix problems in vignettes associated with bug in knitr 1.6

Modified: pkg/Makefile
===================================================================
--- pkg/Makefile	2014-06-09 16:30:46 UTC (rev 969)
+++ pkg/Makefile	2014-06-09 16:32:00 UTC (rev 970)
@@ -27,7 +27,7 @@
 pomp/inst/include/pomp.h: pomp/src/pomp.h
 	$(CP) $^ $@
 
-../www.vignettes: export POMP_BUILD_VIGNETTES=yes
+pomp.vignettes: export POMP_BUILD_VIGNETTES=yes
 %.dist %.manual %.vignettes: export R_QPDF=qpdf
 %.dist %.manual %.vignettes: export R_GSCMD=gs
 %.dist %.manual %.vignettes: export GS_QUALITY=ebook
@@ -123,7 +123,7 @@
 	$(TOUCH) $@
 
 %.remove:
-	$(RCMD) REMOVE --library=$(INSTALL_DIR) $*
+	-$(RCMD) REMOVE --library=$(INSTALL_DIR) $*
 	$(RM) $*.install
 
 %.publish: %.dist %.manual

Modified: pkg/pomp/DESCRIPTION
===================================================================
--- pkg/pomp/DESCRIPTION	2014-06-09 16:30:46 UTC (rev 969)
+++ pkg/pomp/DESCRIPTION	2014-06-09 16:32:00 UTC (rev 970)
@@ -1,8 +1,8 @@
 Package: pomp
 Type: Package
 Title: Statistical inference for partially observed Markov processes
-Version: 0.51-1
-Date: 2014-05-23
+Version: 0.51-2
+Date: 2014-06-10
 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/NAMESPACE
===================================================================
--- pkg/pomp/NAMESPACE	2014-06-09 16:30:46 UTC (rev 969)
+++ pkg/pomp/NAMESPACE	2014-06-09 16:32:00 UTC (rev 970)
@@ -48,7 +48,7 @@
               traj.matched.pomp,
               probed.pomp,probe.matched.pomp,
               spect.pomp,spect.matched.pomp,
-              abc,
+              abc,abcList,
               Csnippet
               )
 

Modified: pkg/pomp/R/abc-methods.R
===================================================================
--- pkg/pomp/R/abc-methods.R	2014-06-09 16:30:46 UTC (rev 969)
+++ pkg/pomp/R/abc-methods.R	2014-06-09 16:32:00 UTC (rev 970)
@@ -6,7 +6,7 @@
           'abc',
           function (object, pars, ...) {
             if (missing(pars)) pars <- colnames(object at conv.rec)
-            coda::mcmc(object at conv.rec[,pars])
+            coda::mcmc(object at conv.rec[,pars,drop=FALSE])
           }
           )
 
@@ -15,64 +15,165 @@
           "plot",
           "abc",
           function (x, y, pars, scatter = FALSE, ...) {
-            if (missing(pars)) pars <- x at pars
-            if (scatter) {
-              pairs(as.matrix(conv.rec(x, pars)))
+            ## if (missing(pars)) pars <- x at pars
+            ## if (scatter) {
+            ##   pairs(as.matrix(conv.rec(x,pars)))
+            ## } else {
+            ##   plot.ts(conv.rec(x,pars),xlab="iteration",...)
+            ## }
+            abc.diagnostics(c(x),pars=pars,scatter=scatter,...)
+          }
+          )
+
+## abcList class
+setClass(
+         'abcList',
+         contains='list',
+         validity=function (object) {
+           if (!all(sapply(object,is,'abc'))) {
+             retval <- paste0(
+                              "error in ",sQuote("c"),
+                              ": dissimilar objects cannot be combined"
+                              )
+             return(retval)
+           }
+           d <- sapply(object,function(x)dim(x at conv.rec))
+           if (!all(apply(d,1,diff)==0)) {
+             retval <- paste0(
+                              "error in ",sQuote("c"),
+                              ": to be combined, ",sQuote("abc"),
+                              " objects must have chains of equal length"
+                              )
+             return(retval)
+           }
+           TRUE
+         }
+         )
+
+setMethod(
+          'c',
+          signature=signature(x='abc'),
+          definition=function (x, ...) {
+            y <- list(...)
+            if (length(y)==0) {
+              new("abcList",list(x))
             } else {
-              plot.ts(conv.rec(x,pars),xlab="iteration",...)
+              p <- sapply(y,is,'abc')
+              pl <- sapply(y,is,'abcList')
+              if (any(!(p||pl)))
+                stop("cannot mix ",sQuote("abc"),
+                     " and non-",sQuote("abc")," objects")
+              y[p] <- lapply(y[p],list)
+              y[pl] <- lapply(y[pl],as,"list")
+              new("abcList",c(list(x),y,recursive=TRUE))
             }
           }
           )
 
-compare.abc <- function (z) {
-  ## assumes that z is a list of abcs with identical structure
-  if (!is.list(z)) z <- list(z)
-  if (!all(sapply(z,function(x)is(x,'abc'))))
-    stop("compare.abc 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]]
-  estnames <- xx at pars
-  parnames <- names(coef(xx))
-  unestnames <- parnames[-match(estnames,parnames)]
+setMethod(
+          'c',
+          signature=signature(x='abcList'),
+          definition=function (x, ...) {
+            y <- list(...)
+            if (length(y)==0) {
+              x
+            } else {
+              p <- sapply(y,is,'abc')
+              pl <- sapply(y,is,'abcList')
+              if (any(!(p||pl)))
+                stop("cannot mix ",sQuote("abc"),
+                     " and non-",sQuote("abc")," objects")
+              y[p] <- lapply(y[p],list)
+              y[pl] <- lapply(y[pl],as,"list")
+              new("abcList",c(as(x,"list"),y,recursive=TRUE))
+            }
+          }
+          )
 
-  ## plot pmcmc convergence diagnostics
-  other.diagnostics <- c()
-  plotnames <- c(other.diagnostics,estnames)
-  nplots <- length(plotnames)
-  n.per.page <- min(nplots,10)
-  nc <- if (n.per.page<=4) 1 else 2
-  nr <- ceiling(n.per.page/nc)
-  oldpar <- par(mar=mar.multi,oma=oma.multi,mfcol=c(nr,nc))
-  on.exit(par(oldpar)) 
-  low <- 1
-  hi <- 0
-  iteration <- seq(0,xx at Nabc)
-  while (hi<nplots) {
-    hi <- min(low+n.per.page-1,nplots)
-    for (i in seq(from=low,to=hi,by=1)) {
-      n <- i-low+1
-      dat <- sapply(z,function(po,label) conv.rec(po,label),label=plotnames[i])
-      matplot(
-              y=dat, 
-              x=iteration,
-              axes = FALSE,
-              xlab = "",
-              ylab = "",
-              type = "l"
-              )
-      box()
-      y.side <- 2
-      axis(y.side,xpd=NA)
-      mtext(plotnames[i],y.side,line=3)
-      do.xax <- (n%%nr==0||n==n.per.page)
-      if (do.xax) axis(1,xpd=NA)
-      if (do.xax) mtext("ABC iteration",side=1,line=3)
-    }  
-    low <- hi+1
-    mtext("ABC convergence diagnostics",3,line=2,outer=TRUE)
+setMethod(
+          "[",
+          signature=signature(x="abcList"),
+          definition=function(x, i, ...) {
+            new('abcList',as(x,"list")[i])
+          }
+          )
+
+setMethod(
+          'conv.rec',
+          signature=signature(object='abcList'),
+          definition=function (object, ...) {
+            coda::mcmc.list(lapply(object,conv.rec,...))
+          }
+          )
+
+setMethod(
+          "plot",
+          signature=signature(x='abcList'),
+          definition=function (x, y = NULL, ...) {
+            abc.diagnostics(x,...)
+          }
+          )
+
+abc.diagnostics <- function (z, pars, scatter = FALSE, ...) {
+  if (missing(pars))
+    pars <- unique(do.call(c,lapply(z,slot,'pars')))
+
+  if (scatter) {
+
+    x <- lapply(z,function(x)as.matrix(conv.rec(x,pars)))
+    x <- lapply(seq_along(x),function(n)cbind(x[[n]],.num=n))
+    x <- do.call(rbind,x)
+    if (ncol(x)<3) {
+      stop("can't make a scatterplot with only one variable")
+    } else {
+      pairs(x[,pars],col=x[,'.num'],...)
+    }
+
+  } else {
+
+    mar.multi <- c(0,5.1,0,2.1)
+    oma.multi <- c(6,0,5,0)
+    xx <- z[[1]]
+    estnames <- pars
+    
+    ## plot abc convergence diagnostics
+    other.diagnostics <- c()
+    plotnames <- c(other.diagnostics,estnames)
+    nplots <- length(plotnames)
+    n.per.page <- min(nplots,10)
+    nc <- if (n.per.page<=4) 1 else 2
+    nr <- ceiling(n.per.page/nc)
+    oldpar <- par(mar=mar.multi,oma=oma.multi,mfcol=c(nr,nc))
+    on.exit(par(oldpar)) 
+    low <- 1
+    hi <- 0
+    iteration <- seq(0,xx at Nabc)
+    while (hi<nplots) {
+      hi <- min(low+n.per.page-1,nplots)
+      for (i in seq(from=low,to=hi,by=1)) {
+        n <- i-low+1
+        dat <- sapply(z,function(po,label) conv.rec(po,label),label=plotnames[i])
+        matplot(
+                y=dat, 
+                x=iteration,
+                axes = FALSE,
+                xlab = "",
+                ylab = "",
+                type = "l"
+                )
+        box()
+        y.side <- 2
+        axis(y.side,xpd=NA)
+        mtext(plotnames[i],y.side,line=3)
+        do.xax <- (n%%nr==0||n==n.per.page)
+        if (do.xax) axis(1,xpd=NA)
+        if (do.xax) mtext("ABC iteration",side=1,line=3)
+      }  
+      low <- hi+1
+      mtext("ABC convergence diagnostics",3,line=2,outer=TRUE)
+    }
+
   }
   invisible(NULL)
 }
+

Modified: pkg/pomp/R/pmcmc-methods.R
===================================================================
--- pkg/pomp/R/pmcmc-methods.R	2014-06-09 16:30:46 UTC (rev 969)
+++ pkg/pomp/R/pmcmc-methods.R	2014-06-09 16:32:00 UTC (rev 970)
@@ -1,15 +1,15 @@
-## this file contains short definitions of methods for the 'pmcmc' class
+## this file defines methods for the 'pmcmc' and 'pmcmcList' classes
 
 ## extract the estimated log likelihood
 setMethod('logLik','pmcmc',function(object,...)object at loglik)
 
-## extract the convergence record
+## extract the convergence record as a coda::mcmc object
 setMethod(
           'conv.rec',
           signature=signature(object='pmcmc'),
           function (object, pars, ...) {
             if (missing(pars)) pars <- colnames(object at conv.rec)
-            coda::mcmc(object at conv.rec[,pars])
+            coda::mcmc(object at conv.rec[,pars,drop=FALSE])
           }
           )
 
@@ -26,21 +26,16 @@
 ## pmcmcList class
 setClass(
          'pmcmcList',
-         slots=c(
-           list = 'list'
-           ),
-         prototype=prototype(
-           list = list()
-           ),
+         contains='list',
          validity=function (object) {
-           if (!all(sapply(object at list,is,'pmcmc'))) {
+           if (!all(sapply(object,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))
+           d <- sapply(object,function(x)dim(x at conv.rec))
            if (!all(apply(d,1,diff)==0)) {
              retval <- paste0(
                               "error in ",sQuote("c"),
@@ -59,16 +54,16 @@
           definition=function (x, ...) {
             y <- list(...)
             if (length(y)==0) {
-              new("pmcmcList",list=list(x))
+              new("pmcmcList",list(x))
             } else {
               p <- sapply(y,is,'pmcmc')
-              q <- sapply(y,is,'pmcmcList')
-              if (any(!(p||q)))
+              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[q] <- lapply(y[q],slot,"list")
-              new("pmcmcList",list=c(list(x),y,recursive=TRUE))
+              y[pl] <- lapply(y[pl],as,"list")
+              new("pmcmcList",c(list(x),y,recursive=TRUE))
             }
           }
           )
@@ -81,15 +76,14 @@
             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))
+              y[pl] <- lapply(y[pl],as,"list")
+              new("pmcmcList",c(as(x,"list"),y,recursive=TRUE))
             }
           }
           )
@@ -98,25 +92,15 @@
           "[",
           signature=signature(x="pmcmcList"),
           definition=function(x, i, ...) {
-            y <- x
-            y at list <- x at list[i]
-            y
+            new('pmcmcList',as(x,"list")[i])
           }
           )
 
 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,...))
+            coda::mcmc.list(lapply(object,conv.rec,...))
           }
           )
 
@@ -124,7 +108,7 @@
           "plot",
           signature=signature(x='pmcmcList'),
           definition=function (x, y = NULL, ...) {
-            pmcmc.diagnostics(x at list)
+            pmcmc.diagnostics(x)
           }
           )
 

Modified: pkg/pomp/inst/NEWS
===================================================================
--- pkg/pomp/inst/NEWS	2014-06-09 16:30:46 UTC (rev 969)
+++ pkg/pomp/inst/NEWS	2014-06-09 16:32:00 UTC (rev 970)
@@ -1,19 +1,35 @@
 _N_e_w_s _f_o_r _p_a_c_k_a_g_e '_p_o_m_p'
 
+_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._5_1-_2:
+
+        • More informative error messages are generated when a needed
+          variable cannot be found.
+
+        • Features that facilitate multiple ABC chains have been added.
+          There is a ‘c’ method to combine ‘abc’ objects into an
+          ‘abcList’ object and to combine ‘abcList’ objects.  Running
+          ‘conv.rec’ on an ‘abc’ or ‘abcList’ object produces ‘coda’
+          ‘mcmc’ and ‘mcmc.list’ objects, respectively.  Diagnostic
+          plots are produced by running ‘plot’ on such objects.
+
+        • Basic structure of ‘pmcmcList’ and ‘abcList’ objects is
+          changed: these objects now inherit directly from ‘list’.
+
 _C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._5_1-_1:
 
-        • Package 'coda' is now a dependency of 'pomp'.  This package
+        • Package ‘coda’ is now a dependency of ‘pomp’.  This package
           provides various generic MCMC diagnostics.
 
         • Features that facilitate multiple PMCMC chains have been
-          added.  There is a 'c' method to combine 'pmcmc' objects into
-          a 'pmcmcList' object.  Running 'conv.rec' on a 'pmcmc' or
-          'pmcmcList' object now produces 'coda' 'mcmc' and 'mcmc.list'
-          objects, respectively.  Diagnostic plots are produced by
-          running 'plot' on such objects.
+          added.  There is a ‘c’ method to combine ‘pmcmc’ objects into
+          a ‘pmcmcList’ object and to combine ‘pmcmcList’ objects.
+          Running ‘conv.rec’ on a ‘pmcmc’ or ‘pmcmcList’ object now
+          produces ‘coda’ ‘mcmc’ and ‘mcmc.list’ objects, respectively.
+          Diagnostic plots are produced by running ‘plot’ on such
+          objects.
 
-        • The 'compare.pmcmc' and 'compare.abc' methods have been
-          removed.  They are superceded by these diagnostic plots.
+        • The ‘compare.pmcmc’ and ‘compare.abc’ methods have been
+          removed as obsolete.
 
 _C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _0._5_0-_9:
 
@@ -37,7 +53,7 @@
 
         • ‘pomp’ can now take snippets of C code directly as
           definitions of the various basic functions.  This is
-          accomplished through the use of a new "Csnippet" function.
+          accomplished through the use of a new ‘Csnippet’ function.
           See the ‘sir’ demo for a demonstration.
 
         • It is now possible to specify global variables and typedefs
@@ -314,7 +330,7 @@
 
         • The ‘data()’-loadable examples have been re-implemented to
           make use of the above-mentioned facility.  Note that this new
-          functionality makes it unnecessary to "un-transform" model
+          functionality makes it unnecessary to un-transform model
           parameters within the user-specified ‘rprocess’, ‘dprocess’,
           ‘rmeasure’, ‘dmeasure’, ‘skeleton’, and ‘initializer’ codes.
           This change is not backward-compatible, but only codes using

Modified: pkg/pomp/inst/NEWS.Rd
===================================================================
--- pkg/pomp/inst/NEWS.Rd	2014-06-09 16:30:46 UTC (rev 969)
+++ pkg/pomp/inst/NEWS.Rd	2014-06-09 16:32:00 UTC (rev 970)
@@ -1,15 +1,24 @@
 \name{NEWS}
 \title{News for package `pomp'}
+\section{Changes in \pkg{pomp} version 0.51-2}{
+  \itemize{
+    \item More informative error messages are generated when a needed variable cannot be found.
+    \item Features that facilitate multiple ABC chains have been added.
+    There is a \code{c} method to combine \code{abc} objects into an \code{abcList} object and to combine \code{abcList} objects.
+    Running \code{conv.rec} on an \code{abc} or \code{abcList} object produces \pkg{coda} \code{mcmc} and \code{mcmc.list} objects, respectively.
+    Diagnostic plots are produced by running \code{plot} on such objects.
+    \item Basic structure of \code{pmcmcList} and \code{abcList} objects is changed: these objects now inherit directly from \code{list}.
+  }
+}
 \section{Changes in \pkg{pomp} version 0.51-1}{
   \itemize{
-    \item Package 'coda' is now a dependency of 'pomp'.
+    \item Package \pkg{coda} is now a dependency of \pkg{pomp}.
     This package provides various generic MCMC diagnostics.
     \item Features that facilitate multiple PMCMC chains have been added.
-    There is a 'c' method to combine 'pmcmc' objects into a 'pmcmcList' object.
-    Running 'conv.rec' on a 'pmcmc' or 'pmcmcList' object now produces 'coda' 'mcmc' and 'mcmc.list' objects, respectively.
-    Diagnostic plots are produced by running 'plot' on such objects.
-    \item The 'compare.pmcmc' and 'compare.abc' methods have been removed.
-    They are superceded by these diagnostic plots.
+    There is a \code{c} method to combine \code{pmcmc} objects into a \code{pmcmcList} object and to combine \code{pmcmcList} objects.
+    Running \code{conv.rec} on a \code{pmcmc} or \code{pmcmcList} object now produces \pkg{coda} \code{mcmc} and \code{mcmc.list} objects, respectively.
+    Diagnostic plots are produced by running \code{plot} on such objects.
+    \item The \code{compare.pmcmc} and \code{compare.abc} methods have been removed as obsolete.
   }
 }
 \section{Changes in \pkg{pomp} version 0.50-9}{
@@ -32,7 +41,7 @@
 \section{Changes in \pkg{pomp} version 0.50-1}{
   \itemize{
     \item \code{pomp} can now take snippets of C code directly as definitions of the various basic functions.
-    This is accomplished through the use of a new "Csnippet" function.
+    This is accomplished through the use of a new \code{Csnippet} function.
     See the \sQuote{sir} demo for a demonstration.
     \item It is now possible to specify global variables and typedefs using the \code{globals} argument to \code{pompBuilder} and \code{pomp}.
     See the \sQuote{sir} demo for a demonstration.
@@ -249,7 +258,7 @@
     When \code{transform=TRUE} in these commands (\code{transform.params=TRUE} for \code{nlf}), estimation is performed on the transformed parameter space.
     This is described and demonstrated in the \dQuote{intro_to_pomp} vignette.
     \item The \code{data()}-loadable examples have been re-implemented to make use of the above-mentioned facility.
-    Note that this new functionality makes it unnecessary to "un-transform" model parameters within the user-specified \code{rprocess}, \code{dprocess}, \code{rmeasure}, \code{dmeasure}, \code{skeleton}, and \code{initializer} codes.
+    Note that this new functionality makes it unnecessary to un-transform model parameters within the user-specified \code{rprocess}, \code{dprocess}, \code{rmeasure}, \code{dmeasure}, \code{skeleton}, and \code{initializer} codes.
     This change is not backward-compatible, but only codes using these \code{data()}-loadable example are affected.
     \item The Bayesian sequential Monte Carlo command \code{bsmc} now returns not a list but an object of class \code{bsmcd.pomp}.
     An experimental \code{plot} method for objects of this class now exists.

Modified: pkg/pomp/man/abc-methods.Rd
===================================================================
--- pkg/pomp/man/abc-methods.Rd	2014-06-09 16:30:46 UTC (rev 969)
+++ pkg/pomp/man/abc-methods.Rd	2014-06-09 16:32:00 UTC (rev 970)
@@ -3,21 +3,33 @@
 \alias{abc-methods}
 \alias{conv.rec,abc-method}
 \alias{conv.rec-abc}
+\alias{conv.rec,abcList-method}
+\alias{conv.rec-abcList}
 \alias{plot-abc}
 \alias{plot,abc-method}
-\alias{compare.abc}
+\alias{plot-abcList}
+\alias{plot,abcList-method}
+\alias{abcList-class}
+\alias{c-abc}
+\alias{c,abc-method}
+\alias{c-abcList}
+\alias{c,abcList-method}
+\alias{[-abcList}
+\alias{[,abcList-method}
 \title{Methods of the "abc" class}
 \description{Methods of the "abc" class.}
 \usage{
 \S4method{conv.rec}{abc}(object, pars, \dots)
+\S4method{conv.rec}{abcList}(object, \dots)
 \S4method{plot}{abc}(x, y, pars, scatter = FALSE, \dots)
-compare.abc(z)
+\S4method{plot}{abcList}(x, y, \dots)
+\S4method{c}{abc}(x, \dots, recursive = FALSE)
+\S4method{c}{abcList}(x, \dots, recursive = FALSE)
 }
 \arguments{
   \item{object, x}{The \code{abc} object.}
   \item{pars}{Names of parameters.}
-  \item{y}{Ignored.}
-  \item{z}{An \code{abc} object or list of \code{abc} objects.}
+  \item{y, recursive}{Ignored.}
   \item{scatter}{
     optional logical;
     If \code{TRUE}, draw scatterplots.
@@ -33,8 +45,8 @@
       \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.
     }
-    \item{plot, compare.abc}{
-      Plots a series of diagnostic plots.
+    \item{plot}{
+      Diagnostic plots.
     }
   }
 }

Modified: pkg/pomp/man/pmcmc-methods.Rd
===================================================================
--- pkg/pomp/man/pmcmc-methods.Rd	2014-06-09 16:30:46 UTC (rev 969)
+++ pkg/pomp/man/pmcmc-methods.Rd	2014-06-09 16:32:00 UTC (rev 970)
@@ -18,8 +18,6 @@
 \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{
@@ -27,6 +25,7 @@
 \S4method{conv.rec}{pmcmc}(object, pars, \dots)
 \S4method{conv.rec}{pmcmcList}(object, \dots)
 \S4method{plot}{pmcmc}(x, y = NULL, \dots)
+\S4method{plot}{pmcmcList}(x, y, \dots)
 \S4method{c}{pmcmc}(x, \dots, recursive = FALSE)
 \S4method{c}{pmcmcList}(x, \dots, recursive = FALSE)
 }
@@ -44,8 +43,7 @@
       \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.
+      Diagnostic plots.
     }
     \item{logLik}{
       Returns the value in the \code{loglik} slot.

Modified: pkg/pomp/tests/abc.R
===================================================================
--- pkg/pomp/tests/abc.R	2014-06-09 16:30:46 UTC (rev 969)
+++ pkg/pomp/tests/abc.R	2014-06-09 16:32:00 UTC (rev 970)
@@ -93,5 +93,11 @@
             )
 plot(abc6)
 
+try(abc7 <- c(abc2,abc3))
+plot(abc7 <- c(abc2,abc4))
+plot(abc7,scatter=TRUE)
+plot(conv.rec(c(abc2,abc4)))
+plot(conv.rec(c(abc7,abc6)))
+
 dev.off()
 

Modified: pkg/pomp/tests/abc.Rout.save
===================================================================
--- pkg/pomp/tests/abc.Rout.save	2014-06-09 16:30:46 UTC (rev 969)
+++ pkg/pomp/tests/abc.Rout.save	2014-06-09 16:32:00 UTC (rev 970)
@@ -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)
 
@@ -22,6 +22,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):
  ou2 
@@ -117,6 +119,14 @@
 +             )
 > plot(abc6)
 > 
+> try(abc7 <- c(abc2,abc3))
+Error in validObject(.Object) : 
+  invalid class "abcList" object: error in 'c': to be combined, 'abc' objects must have chains of equal length
+> plot(abc7 <- c(abc2,abc4))
+> plot(abc7,scatter=TRUE)
+> plot(conv.rec(c(abc2,abc4)))
+> plot(conv.rec(c(abc7,abc6)))
+> 
 > dev.off()
 null device 
           1 
@@ -124,4 +134,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  7.884   0.052   8.120 
+  8.616   0.052   8.991 

Modified: www/content/NEWS.html
===================================================================
--- www/content/NEWS.html	2014-06-09 16:30:46 UTC (rev 969)
+++ www/content/NEWS.html	2014-06-09 16:32:00 UTC (rev 970)
@@ -8,22 +8,40 @@
 
 <h2>News for package ‘pomp’</h2>
 
+<h3>Changes in <span class="pkg">pomp</span> version 0.51-2</h3>
+
+
+<ul>
+<li><p> More informative error messages are generated when a needed variable cannot be found.
+</p>
+</li>
+<li><p> Features that facilitate multiple ABC chains have been added.
+There is a <code>c</code> method to combine <code>abc</code> objects into an <code>abcList</code> object and to combine <code>abcList</code> objects.
+Running <code>conv.rec</code> on an <code>abc</code> or <code>abcList</code> object produces <span class="pkg">coda</span> <code>mcmc</code> and <code>mcmc.list</code> objects, respectively.
+Diagnostic plots are produced by running <code>plot</code> on such objects.
+</p>
+</li>
+<li><p> Basic structure of <code>pmcmcList</code> and <code>abcList</code> objects is changed: these objects now inherit directly from <code>list</code>.
+</p>
+</li></ul>
+
+
+
 <h3>Changes in <span class="pkg">pomp</span> version 0.51-1</h3>
 
 
 <ul>
-<li><p> Package 'coda' is now a dependency of 'pomp'.
+<li><p> Package <span class="pkg">coda</span> is now a dependency of <span class="pkg">pomp</span>.
 This package provides various generic MCMC diagnostics.
 </p>
 </li>
 <li><p> Features that facilitate multiple PMCMC chains have been added.
-There is a 'c' method to combine 'pmcmc' objects into a 'pmcmcList' object.
-Running 'conv.rec' on a 'pmcmc' or 'pmcmcList' object now produces 'coda' 'mcmc' and 'mcmc.list' objects, respectively.
-Diagnostic plots are produced by running 'plot' on such objects.
+There is a <code>c</code> method to combine <code>pmcmc</code> objects into a <code>pmcmcList</code> object and to combine <code>pmcmcList</code> objects.
+Running <code>conv.rec</code> on a <code>pmcmc</code> or <code>pmcmcList</code> object now produces <span class="pkg">coda</span> <code>mcmc</code> and <code>mcmc.list</code> objects, respectively.
+Diagnostic plots are produced by running <code>plot</code> on such objects.
 </p>
 </li>
-<li><p> The 'compare.pmcmc' and 'compare.abc' methods have been removed.
-They are superceded by these diagnostic plots.
+<li><p> The <code>compare.pmcmc</code> and <code>compare.abc</code> methods have been removed as obsolete.
 </p>
 </li></ul>
 
@@ -68,7 +86,7 @@
 
 <ul>
 <li> <p><code>pomp</code> can now take snippets of C code directly as definitions of the various basic functions.
-This is accomplished through the use of a new "Csnippet" function.
+This is accomplished through the use of a new <code>Csnippet</code> function.
 See the ‘sir’ demo for a demonstration.
 </p>
 </li>
@@ -494,7 +512,7 @@
 </p>
 </li>
 <li><p> The <code>data()</code>-loadable examples have been re-implemented to make use of the above-mentioned facility.
-Note that this new functionality makes it unnecessary to "un-transform" model parameters within the user-specified <code>rprocess</code>, <code>dprocess</code>, <code>rmeasure</code>, <code>dmeasure</code>, <code>skeleton</code>, and <code>initializer</code> codes.
+Note that this new functionality makes it unnecessary to un-transform model parameters within the user-specified <code>rprocess</code>, <code>dprocess</code>, <code>rmeasure</code>, <code>dmeasure</code>, <code>skeleton</code>, and <code>initializer</code> codes.
 This change is not backward-compatible, but only codes using these <code>data()</code>-loadable example are affected.
 </p>
 </li>

Modified: www/vignettes/advanced_topics_in_pomp.R
===================================================================
--- www/vignettes/advanced_topics_in_pomp.R	2014-06-09 16:30:46 UTC (rev 969)
+++ www/vignettes/advanced_topics_in_pomp.R	2014-06-09 16:32:00 UTC (rev 970)
@@ -1,6 +1,5 @@
 
 ## ----include=FALSE-------------------------------------------------------
-
 opts_chunk$set(
                echo=TRUE,results='markup',
                progress=TRUE,prompt=FALSE,tidy=FALSE,highlight=FALSE,
@@ -21,14 +20,11 @@
 
 
 ## ----include=FALSE-------------------------------------------------------
-
   library(pomp)
   set.seed(5384959)
 
 
-
 ## ----pomp-builder-measmod,eval=T-----------------------------------------
-
 ## negative binomial measurement model
 ## E[cases|incid] = rho*incid
 ## Var[cases|incid] = rho*incid*(1+rho*incid/theta)
@@ -41,9 +37,7 @@
 '
 
 
-
 ## ----pomp-builder-stepfn,eval=T------------------------------------------
-
 ## SIR process model with extra-demographic stochasticity
 ## and seasonal transmission
 step.fn <- '
@@ -83,9 +77,7 @@
 '
 
 
-
 ## ----pomp-builder-skel,eval=T--------------------------------------------
-
 skel <- '
   int nrate = 6;
   double rate[nrate];		// transition rates
@@ -121,9 +113,7 @@
 '
 
 
-
 ## ----pomp-builder-partrans,eval=T----------------------------------------
-
 ## parameter transformations
 ## note we use barycentric coordinates for the initial conditions
 ## the success of this depends on S0, I0, R0 being in
@@ -155,9 +145,7 @@
 "
 
 
-
 ## ----pomp-builder-covar,eval=T-------------------------------------------
-
 covartab <- data.frame(
                        time=seq(from=-1/52,to=10+1/52,by=1/26)
                        )
@@ -178,7 +166,6 @@
 
 
 ## ----pomp-builder,eval=F-------------------------------------------------
-## 
 ## pompBuilder(
 ##             name="SIR",
 ##             data=data.frame(
@@ -212,13 +199,11 @@
 ##               x0
 ##             }
 ##             ) -> sir
-## 
 
 
 ## ----pomp-builder-eval,echo=F,eval=T,results='hide'----------------------
 if (Sys.getenv("POMP_BUILD_VIGNETTES")=="yes") {
   require(pomp)
-
 pompBuilder(
             name="SIR",
             data=data.frame(
@@ -252,12 +237,10 @@
               x0
             }
             ) -> sir
-
 }
 
 
 ## ----sir-sim,eval=T------------------------------------------------------
-
 coef(sir) <- c(
                gamma=26,mu=0.02,iota=0.01,
                beta1=400,beta2=480,beta3=320,
@@ -271,7 +254,6 @@
 traj <- trajectory(sir,hmax=1/52)
 
 
-
 ## ----sir-plot,fig=T,echo=F-----------------------------------------------
 plot(sir)
 
@@ -304,7 +286,6 @@
 dim(fp)
 fp[,36:40]
 
-
 ## ------------------------------------------------------------------------
 fm <- dmeasure(ou2,y=y[,1,],x=x,times=time(ou2),params=true.p)
 dim(fm)
@@ -346,11 +327,9 @@
        )
      ) -> ou2.Rplug
 
-
 ## ----plugin-R-code-sim,echo=T,eval=F-------------------------------------
 ## simdat.Rplug <- simulate(ou2.Rplug,params=coef(ou2),nsim=5000,states=T)
 
-
 ## ----plugin-R-code-eval,echo=F,eval=T------------------------------------
 binary.file <- "plugin-R-code.rda"
 if (file.exists(binary.file)) {
@@ -412,11 +391,9 @@
 ##            sigma.1=3, sigma.2=-0.5, sigma.3=2
 ##            )
 
-
 ## ----vectorized-R-code-sim,eval=F,echo=T---------------------------------
 ## simdat.Rvect <- simulate(ou2.Rvect,params=theta,states=T,nsim=100000)
 
-
 ## ----vectorized-R-code-eval,eval=T,echo=F--------------------------------
 binary.file <- "vectorized-R-code.rda"
 if (file.exists(binary.file)) {
@@ -562,7 +539,6 @@
 ## simdat.Cvect <- simulate(ou2.Cvect,params=theta[paramnames],
 ##                          nsim=100000,states=T)
 
-
 ## ----vectorized-C-code-eval,echo=F,eval=T--------------------------------
 binary.file <- "vectorized-C-code.rda"
 if (file.exists(binary.file)) {

Modified: www/vignettes/advanced_topics_in_pomp.Rnw
===================================================================
--- www/vignettes/advanced_topics_in_pomp.Rnw	2014-06-09 16:30:46 UTC (rev 969)
+++ www/vignettes/advanced_topics_in_pomp.Rnw	2014-06-09 16:32:00 UTC (rev 970)
@@ -50,7 +50,6 @@
 
 
 <<include=FALSE>>=
-
 opts_chunk$set(
                echo=TRUE,results='markup',
                progress=TRUE,prompt=FALSE,tidy=FALSE,highlight=FALSE,
@@ -80,10 +79,8 @@
 \tableofcontents
 
 <<include=FALSE>>=
-
   library(pomp)
   set.seed(5384959)
-
 @ 
 
 \section{Accumulator variables}
@@ -126,7 +123,6 @@
 We'll start by writing snippets of C code to implement each of the important parts of our model.
[TRUNCATED]

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


More information about the pomp-commits mailing list