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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Dec 24 23:01:11 CET 2011


Author: kingaa
Date: 2011-12-24 23:01:11 +0100 (Sat, 24 Dec 2011)
New Revision: 571

Modified:
   pkg/DESCRIPTION
   pkg/R/pomp.R
   pkg/man/pomp.Rd
   pkg/tests/fhn.Rout.save
   pkg/tests/ricker-probe.Rout.save
Log:
- finish removing deprecated 'skeleton.map' and 'skeleton.vectorfield' interface


Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2011-12-24 16:31:01 UTC (rev 570)
+++ pkg/DESCRIPTION	2011-12-24 22:01:11 UTC (rev 571)
@@ -1,8 +1,8 @@
 Package: pomp
 Type: Package
 Title: Statistical inference for partially observed Markov processes
-Version: 0.39-5
-Date: 2011-12-14
+Version: 0.40-1
+Date: 2011-12-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/R/pomp.R
===================================================================
--- pkg/R/pomp.R	2011-12-24 16:31:01 UTC (rev 570)
+++ pkg/R/pomp.R	2011-12-24 22:01:11 UTC (rev 571)
@@ -360,38 +360,8 @@
        )
 }
 
-## deal with the change-over from 'skeleton.map'/'skeleton.vectorfield' to
-## 'skeleton'/'skeleton.type'
-skeleton.jigger <- function (skeleton = NULL, skeleton.type,
-                             skeleton.map = NULL, skeleton.vectorfield = NULL) {
-  if (!is.null(skeleton.map)) {
-    warning(
-            "the arguments ",sQuote("skeleton.map")," and ",sQuote("skeleton.vectorfield"),
-            " are now deprecated.",
-            " Use ",sQuote("skeleton")," and ",sQuote("skeleton.type")," instead.",
-            call.=FALSE
-            )
-    if (!is.null(skeleton.vectorfield))
-      stop("pomp error: it is not permitted to specify both ",sQuote("skeleton.vectorfield")," and ",sQuote("skeleton.map"))
-    if (!is.null(skeleton))
-      stop("pomp error: it is not permitted to specify both ",sQuote("skeleton.map")," and ",sQuote("skeleton"))
-    skeleton.type <- "map"
-    skeleton <- skeleton.map
-  }
-  if (!is.null(skeleton.vectorfield)) {
-    warning(
-            "the arguments ",sQuote("skeleton.map")," and ",sQuote("skeleton.vectorfield"),
-            " are now deprecated.",
-            " Use ",sQuote("skeleton")," and ",sQuote("skeleton.type")," instead.",
-            call.=FALSE
-            )
-    if (!is.null(skeleton.map))
-      stop("pomp error: it is not permitted to specify both ",sQuote("skeleton.vectorfield")," and ",sQuote("skeleton.map"))
-    if (!is.null(skeleton))
-      stop("pomp error: it is not permitted to specify both ",sQuote("skeleton.vectorfield")," and ",sQuote("skeleton"))
-    skeleton.type <- "vectorfield"
-    skeleton <- skeleton.vectorfield
-  }
+## for backward compatibility
+skeleton.jigger <- function (skeleton = NULL, skeleton.type) {
   list(fn=skeleton,type=skeleton.type)
 }
 
@@ -402,15 +372,12 @@
           function (data, times, t0, ..., rprocess, dprocess,
                     rmeasure, dmeasure, measurement.model,
                     skeleton = NULL, skeleton.type = c("map","vectorfield"),
-                    skeleton.map = NULL, skeleton.vectorfield = NULL,
                     initializer, covar, tcovar,
                     obsnames, statenames, paramnames, covarnames,
                     PACKAGE, parameter.transform, parameter.inv.transform) {
             skel <- skeleton.jigger(
                                     skeleton=skeleton,
-                                    skeleton.type=skeleton.type,
-                                    skeleton.map=skeleton.map,
-                                    skeleton.vectorfield=skeleton.vectorfield
+                                    skeleton.type=skeleton.type
                                     )
             pomp.constructor(
                              data=data,
@@ -444,15 +411,12 @@
           function (data, times, t0, ..., rprocess, dprocess,
                     rmeasure, dmeasure, measurement.model,
                     skeleton = NULL, skeleton.type = c("map","vectorfield"),
-                    skeleton.map = NULL, skeleton.vectorfield = NULL,
                     initializer, covar, tcovar,
                     obsnames, statenames, paramnames, covarnames,
                     PACKAGE, parameter.transform, parameter.inv.transform) {
             skel <- skeleton.jigger(
                                     skeleton=skeleton,
-                                    skeleton.type=skeleton.type,
-                                    skeleton.map=skeleton.map,
-                                    skeleton.vectorfield=skeleton.vectorfield
+                                    skeleton.type=skeleton.type
                                     )
             pomp.constructor(
                              data=data,
@@ -487,15 +451,12 @@
           function (data, times, t0, ..., rprocess, dprocess,
                     rmeasure, dmeasure, measurement.model,
                     skeleton = NULL, skeleton.type = c("map","vectorfield"),
-                    skeleton.map = NULL, skeleton.vectorfield = NULL,
                     initializer, covar, tcovar,
                     obsnames, statenames, paramnames, covarnames,
                     PACKAGE, parameter.transform, parameter.inv.transform) {
             skel <- skeleton.jigger(
                                     skeleton=skeleton,
-                                    skeleton.type=skeleton.type,
-                                    skeleton.map=skeleton.map,
-                                    skeleton.vectorfield=skeleton.vectorfield
+                                    skeleton.type=skeleton.type
                                     )
             pomp.constructor(
                              data=matrix(data,nrow=1,ncol=length(data)),

Modified: pkg/man/pomp.Rd
===================================================================
--- pkg/man/pomp.Rd	2011-12-24 16:31:01 UTC (rev 570)
+++ pkg/man/pomp.Rd	2011-12-24 22:01:11 UTC (rev 571)
@@ -16,21 +16,18 @@
 \S4method{pomp}{data.frame}(data, times, t0, \dots, rprocess, dprocess, rmeasure, dmeasure,
        measurement.model,
        skeleton = NULL, skeleton.type = c("map","vectorfield"),
-       skeleton.map = NULL, skeleton.vectorfield = NULL,
        initializer, covar, tcovar,
        obsnames, statenames, paramnames, covarnames,
        PACKAGE, parameter.transform, parameter.inv.transform)
 \S4method{pomp}{numeric}(data, times, t0, \dots, rprocess, dprocess, rmeasure, dmeasure,
        measurement.model,
        skeleton = NULL, skeleton.type = c("map","vectorfield"),
-       skeleton.map = NULL, skeleton.vectorfield = NULL,
        initializer, covar, tcovar,
        obsnames, statenames, paramnames, covarnames,
        PACKAGE, parameter.transform, parameter.inv.transform)
 \S4method{pomp}{matrix}(data, times, t0, \dots, rprocess, dprocess, rmeasure, dmeasure,
        measurement.model,
        skeleton = NULL, skeleton.type = c("map","vectorfield"),
-       skeleton.map = NULL, skeleton.vectorfield = NULL,
        initializer, covar, tcovar,
        obsnames, statenames, paramnames, covarnames,
        PACKAGE, parameter.transform, parameter.inv.transform)
@@ -91,7 +88,7 @@
     See below for an example.
     \strong{NB:} it will typically be possible to acclerate measurement model computations by writing \code{dmeasure} and/or \code{rmeasure} functions directly.
   }
-  \item{skeleton, skeleton.type, skeleton.map, skeleton.vectorfield}{
+  \item{skeleton, skeleton.type}{
     The function \code{skeleton} specifies the deterministic skeleton of the unobserved Markov process.
     If we are dealing with a discrete-time Markov process, its deterministic skeleton is a map: indicate this by specifying \code{skeleton.type="map"}.
     If we are dealing with a continuous-time Markov process, its deterministic skeleton is a vectorfield: indicate this by specifying \code{skeleton.type="vectorfield"}.
@@ -99,12 +96,6 @@
     (1) as an \R function of prototype \code{skeleton(x,t,params,\dots)} that evaluates the deterministic skeleton at state \code{x} and time \code{t} given the parameters \code{params}, or
     (2) as the name of a native (compiled) routine with prototype \dQuote{pomp_skeleton} as defined in the header file \dQuote{pomp.h}.
     If the deterministic skeleton depends on covariates, the optional argument \code{covars} will be filled with interpolated values of the covariates at the time \code{t}.
-    
-    For compatibility with older versions (<0.37-1), one can specify \code{skeleton.map} or \code{skeleton.vectorfield}.
-    Specifying \code{skeleton.map=X} is equivalent to \code{skeleton=X} and \code{skeleton.type="map"}.
-    Specifying \code{skeleton.vectorfield=X} is equivalent to \code{skeleton=X} and \code{skeleton.type="vectorfield"}.
-    A dynamical system cannot be both discrete and continuous, so specifying both \code{skeleton.map} and \code{skeleton.vectorfield} generates an error.
-    Use of these arguments generates a warning; in future releases, these arguments will be removed.
   }
   \item{initializer}{
     optional function of prototype \code{initializer(params,t0,\dots)} that yields initial conditions for the state process when given a vector, \code{params}, of parameters.
@@ -167,7 +158,13 @@
   If such custom versions are desired, the following describes how each of these functions should be written in this case.
   \describe{
     \item{\code{rprocess}}{
-      if provided, must have at least the following arguments:
+      In general, the specification of \code{rprocess} can be somewhat nontrivial:
+      for this reason, \code{\link{plugins}} have been developed to streamline this process for the user.
+      Currently, if one's process model evolves in discrete time or one is willing to make such an approximation (e.g., via an Euler approximation), then the \code{\link{euler.sim}} or \code{\link{onestep.sim}} plugin is available.
+      For exact simulation of certain continuous-time Markov chains, an implementation of Gillespie's algorithm is available (see \code{\link{gillespie.sim}}).
+      To use the plugins, consult the help documentation (\code{?\link{plugins}}) and the vignettes.
+
+      If the plugins are not used \code{rprocess} must have at least the following arguments:
       \code{xstart}, \code{times}, \code{params}, and \code{\dots}.
       It can also take additional arguments.
       It is guaranteed that these will be filled with the corresponding elements the user has included as additional arguments in the construction of the \code{pomp} object.
@@ -196,7 +193,12 @@
 	}
     }
     \item{\code{dprocess}}{
-      if provided, must have at least the following arguments:
+      In general, the specification of \code{dprocess} can be somewhat nontrivial:
+      for this reason, \code{\link{plugins}} have been developed to streamline this process for the user.
+      Currently, if one's process model evolves in discrete time or one is willing to make such an approximation (e.g., via an Euler approximation), then the \code{\link{onestep.dens}} plugin for \code{dprocess} is available.
+      To use the plugins, consult the help documentation (\code{?\link{plugins}}) and the vignettes.
+
+      If the plugins are not used, \code{dprocess} must have at least the following arguments:
       \code{x}, \code{times}, \code{params}, \code{log}, and \code{\dots}.
       It may take additional arguments.
       It is guaranteed that these will be filled with the corresponding elements the user has included as additional arguments in the construction of the \code{pomp} object.

Modified: pkg/tests/fhn.Rout.save
===================================================================
--- pkg/tests/fhn.Rout.save	2011-12-24 16:31:01 UTC (rev 570)
+++ pkg/tests/fhn.Rout.save	2011-12-24 22:01:11 UTC (rev 571)
@@ -1,5 +1,5 @@
 
-R version 2.13.1 (2011-07-08)
+R version 2.14.1 (2011-12-22)
 Copyright (C) 2011 The R Foundation for Statistical Computing
 ISBN 3-900051-07-0
 Platform: x86_64-unknown-linux-gnu (64-bit)
@@ -88,15 +88,14 @@
 +             t0=0,
 +             tcovar=seq(0,21,by=0.1),
 +             covar=cbind(i=sin(2*pi*seq(0,21,by=0.1))),
-+             skeleton.vectorfield=function(x,t,params,covars,...) {
++             skeleton.type="vectorfield",
++             skeleton=function(x,t,params,covars,...) {
 +               c(
 +                 V=unname(params['c']*(x['V']-(x['V']^3)/3-x['R']+covars['i'])),
 +                 R=unname((x['V']+params['a']-params['b']*x['R'])/params['c'])
 +                 )
 +             }
 +             )
-Warning message:
-the arguments 'skeleton.map' and 'skeleton.vectorfield' are now deprecated. Use 'skeleton' and 'skeleton.type' instead. 
 > 
 > skeleton(fhn,x,t=c(0,3),params=params)
 , , 1

Modified: pkg/tests/ricker-probe.Rout.save
===================================================================
--- pkg/tests/ricker-probe.Rout.save	2011-12-24 16:31:01 UTC (rev 570)
+++ pkg/tests/ricker-probe.Rout.save	2011-12-24 22:01:11 UTC (rev 571)
@@ -1,5 +1,5 @@
 
-R version 2.13.1 (2011-07-08)
+R version 2.14.1 (2011-12-22)
 Copyright (C) 2011 The R Foundation for Statistical Computing
 ISBN 3-900051-07-0
 Platform: x86_64-unknown-linux-gnu (64-bit)
@@ -149,8 +149,8 @@
 +             seed=838775L
 +             )
 > pb at datvals
-       marg.1        marg.2        marg.3 
- 1.000000e+00 -3.470661e-18 -1.108330e-18 
+      marg.1       marg.2       marg.3 
+1.000000e+00 2.308125e-18 9.896164e-19 
 > summary(pb)
 $coef
     log.r log.sigma   log.phi       N.0       e.0 
@@ -193,7 +193,7 @@
 +             )
 > pb at datvals
        marg.1        marg.2        marg.3       acf.0.y       acf.1.y 
- 1.000000e+00 -3.470661e-18 -1.108330e-18  3.679493e+03 -1.275470e+03 
+ 1.000000e+00  2.308125e-18  9.896164e-19  3.679493e+03 -1.275470e+03 
       acf.3.y       acf.5.y          mean 
  4.212841e+02  2.954671e+02  4.430440e+00 
 > summary(pb)
@@ -276,8 +276,8 @@
 +             seed=838775L
 +             )
 > pb at datvals
-       marg.1        marg.2        marg.3 
- 1.000000e+00 -3.470661e-18 -1.108330e-18 
+      marg.1       marg.2       marg.3 
+1.000000e+00 2.308125e-18 9.896164e-19 
 > summary(pb)
 $coef
     log.r log.sigma   log.phi       N.0       e.0 
@@ -312,7 +312,7 @@
 +                               )
 +             )
    user  system elapsed 
- 13.267   0.002  13.271 
+  7.380   0.000   7.404 
 > plot(pm)
 > 
 > cbind(truth=coef(ricker),est=coef(pm),guess=coef(po))
@@ -371,7 +371,7 @@
 +                               )
 +             )
    user  system elapsed 
- 10.041   0.021  10.064 
+  5.492   0.000   5.512 
 > plot(pm)
 > plot(as(pm,"pomp"),variables="y")
 > plot(simulate(pm),variables="y")
@@ -530,7 +530,7 @@
 0.8171828 0.8171828 0.1358641 0.6313686 0.2117882 0.2677323 
 
 $synth.loglik
-[1] 30.22958
+[1] 29.82456
 
 > plot(pb)
 > 



More information about the pomp-commits mailing list