Learn R Programming

pomp (version 0.53-5)

pomp: Partially-observed Markov process object.

Description

This function creates a pomp object, encoding a partially-observed Markov process model together with a uni- or multi-variate time series.

Usage

## S3 method for class 'data.frame':
pomp(data, times, t0, \dots, rprocess, dprocess, rmeasure, dmeasure,
       measurement.model,
       skeleton, skeleton.type = c("map","vectorfield"), skelmap.delta.t = 1,
       initializer, rprior, dprior, params, covar, tcovar,
       obsnames, statenames, paramnames, covarnames, zeronames,
       PACKAGE, parameter.transform, parameter.inv.transform, globals)
## S3 method for class 'numeric':
pomp(data, times, t0, \dots, rprocess, dprocess, rmeasure, dmeasure,
       measurement.model,
       skeleton, skeleton.type = c("map","vectorfield"), skelmap.delta.t = 1,
       initializer, rprior, dprior, params, covar, tcovar,
       obsnames, statenames, paramnames, covarnames, zeronames,
       PACKAGE, parameter.transform, parameter.inv.transform, globals)
## S3 method for class 'matrix':
pomp(data, times, t0, \dots, rprocess, dprocess, rmeasure, dmeasure,
       measurement.model,
       skeleton, skeleton.type = c("map","vectorfield"), skelmap.delta.t = 1,
       initializer, rprior, dprior, params, covar, tcovar,
       obsnames, statenames, paramnames, covarnames, zeronames,
       PACKAGE, parameter.transform, parameter.inv.transform, globals)
## S3 method for class 'pomp':
pomp(data, times, t0, \dots, rprocess, dprocess, rmeasure, dmeasure,
       measurement.model, skeleton, skeleton.type, skelmap.delta.t,
       initializer, rprior, dprior, params, covar, tcovar,
       obsnames, statenames, paramnames, covarnames, zeronames,
       PACKAGE, parameter.transform, parameter.inv.transform, globals)

Arguments

data, times
The time series data and times at which observations are made. data can be specified as a vector, a matrix, a data-frame, or a pomp object.

If data is a numeric vector, times must be a numeric v

t0
The zero-time: the stochastic dynamical system is initialized at time t0. This must be no later than the time of the first observation, i.e., t0 <= times[1]<="" code="">.
rprocess
optional function; a function of prototype rprocess(xstart,times,params,\dots) that simulates from the unobserved process. The easiest way to specify rprocess is to use one of the plugins p
dprocess
optional function; a function of prototype dprocess(x,times,params,log,\dots) that evaluates the likelihood of a sequence of consecutive state transitions. The easiest way to specify dprocess is to use one of the
rmeasure
optional; the measurement model simulator. This can be specified in one of four ways: (1) as a function of prototype rmeasure(x,t,params,\dots) that makes a draw from the observation process given states x, time t, and pa
dmeasure
optional; the measurement model probability density function. This can be specified in one of four ways: (1) as a function of prototype dmeasure(y,x,t,params,log,\dots) that computes the p.d.f. of y given x, t
measurement.model
optional; a formula or list of formulae, specifying the measurement model. These formulae are parsed internally to generate rmeasure and dmeasure functions. If measurement.model is given it overrides any spec
skeleton, skeleton.type, skelmap.delta.t
The function 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 skeleton.type="
initializer
optional function of prototype initializer(params,t0,\dots) that yields initial conditions for the state process when given a vector, params, of parameters.

By default (i.e., if it is unspecified when pomp is called), the in

rprior
optional; function drawing a sample from a prior distribution on parameters. This can be specified in one of three ways: (1) as an Rfunction of prototype rprior(params,\dots) that makes a draw from the prior distribution given params,
dprior
optional; function evaluating the prior distribution. This can be specified in one of three ways: (1) as an Rfunction of prototype dprior(params,log=FALSE,\dots) that evaluates the prior probability density, (2) as a snippet of C code (via
params
optional named numeric vector of parameters. This will be coerced internally to storage mode double.
covar, tcovar
An optional table of covariates: covar is the table (one column per variable); tcovar the corresponding times (one entry per row of covar).

covar can be specified as either a matrix or a dat

obsnames, statenames, paramnames, covarnames
Optional character vectors specifying the names of observables, state variables, parameters, and covariates, respectively. These are only used in the event that one or more of the basic functions (rprocess, dprocess, rm
zeronames
Optional character vector specifying the names of accumulator variables. See the Advanced topics in pomp vignette for a discussion of accumulator variables.
PACKAGE
An optional string giving the name of the dynamically loaded library in which any native routines are to be found.
parameter.transform, parameter.inv.transform
Optional functions specifying parameter transformations. These functions must have arguments params and .... parameter.transform should transform parameters from the user's scale to the scale that rproc
globals
optional character; C code that will be included in the source for (and therefore hard-coded into) the shared-object library created when the call to pomp uses Csnippets. If no Csnippets are used, globa
...
Any additional arguments given to pomp will be stored in the pomp object and passed as arguments to each of the basic functions whenever they are evaluated.

Value

  • An object of class pomp. If data is an object of class pomp, then by default the returned pomp object is identical to data. If additional arguments are given, these override the defaults.

Warning

Some error checking is done by pomp, but complete error checking is impossible. If the user-specified functions do not conform to the above specifications (see Details), then the results may be invalid. In particular, if both rmeasure and dmeasure are specified, the user should verify that these two functions correspond to the same probability distribution and if skeleton is specified, the user is responsible for verifying that it corresponds to the true deterministic skeleton of the model. Each pomp-package algorithm uses some subset of the five basic functions (rprocess, dprocess, rmeasure, dmeasure, skeleton). If an algorithm requires a component that has not been specified, an informative error will be generated.

Details

It is not typically necessary (or even feasible) to define all of the functions rprocess, dprocess, rmeasure, dmeasure, and skeleton in any given problem. Each algorithm makes use of a different subset of these functions. Specification of process-model codes rprocess and/or dprocess in most cases is facilitated by so-called plugins that have been developed to handle common use-cases. 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 euler.sim, discrete.time.sim, or onestep.sim plugin for rprocess and onestep.dens plugin for dprocess are available. For exact simulation of certain continuous-time Markov chains, an implementation of Gillespie's algorithm is available (see gillespie.sim). To use the plugins, consult the help documentation (?plugins) and the vignettes.

In specific cases, it may be possible to obtain increased computational efficiency by writing custom versions of rprocess and/or dprocess. See the Advanced topics in pomp vignette for a discussion of this. If such custom versions are desired, the following describes how each of these functions should be written in this case. [object Object],[object Object]

The following is a guide to writing the measurement-model, deterministic skeleton, and initializer components. [object Object],[object Object],[object Object],[object Object]

See Also

pomp-methods, plugins, time, time<-, timezero, timezero<-, coef, coef<-, obs, states, window, as.data.frame.pomp

Examples

Run this code
## For examples, see the "Introduction to pomp"
## and "Advanced topics in pomp" documents,
## the demos, and the examples provided with the package, e.g.:
pompExample()
pomp.home <- system.file("examples",package="pomp")
pomp.examples <- list.files(pomp.home)
file.show(
          file.path(pomp.home,pomp.examples),
          header=paste("======",pomp.examples,"=======")
         )

Run the code above in your browser using DataLab