pomp
object,
encoding a partially-observed Markov process model together with a uni- or multivariate time series.
One implements the model by specifying its components, each of which can be written as Rfunctions or, for much greater computational efficiency, using C code.
The preferred way to specify most components (as detailed below) is through the use of Csnippet
s, snippets of C that are compiled and linked into a running Rsession.## 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, fromEstimationScale, toEstimationScale, globals, cdir, cfile)
## 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, fromEstimationScale, toEstimationScale, globals, cdir, cfile)
## 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, fromEstimationScale, toEstimationScale, globals, cdir, cfile)
## 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, fromEstimationScale, toEstimationScale, globals, cdir, cfile)
data
can be specified as a vector, a matrix, a data-frame.
Alternatively, a pomp
object can be supplied in the data
argument. If data<
t0 <= times[1]<="" code="">.=>
plugins
x
, timet
, and paray
givenx
,t
, armeasure
and dmeasure
functions.
If measurement.model
is given it overrides any specskeleton
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 s
params
and an initial time, t0
, the initializer determines the state params
,double
.covar
is the table of covariates (one column per variable);
tcovar
the corresponding times (one entry per row of covar
). covar
can be specified a
rprocess
, dprocess
, rm
pomp
uses Csnippet
s.
If no C
cdir
specifies the name of the directory within which Csnippet
code will be compiled.
By default, this is in a temporary directory specific to the running instance of R.
cfile
gives thpomp
will be stored in the pomp
object and passed as arguments to each of the basic functions whenever they are evaluated.pomp
returns 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.rprocess
, dprocess
, rmeasure
, dmeasure
, and skeleton
in any given problem.
Each algorithm makes use of only a subset of these components.
Any algorithm requiring a component that has not been defined will return an informative error.Csnippet
s, see the tutorials on the Csnippet
help. If skeleton
if provided, must have at least the arguments x
, t
, params
, and ...
.
x
is a numeric vector containing the coordinates of a point in state space at which evaluation of the skeleton is desired.
t
is a numeric value giving the time at which evaluation of the skeleton is desired.
Of course, these will be irrelevant in the case of an autonomous skeleton.
params
is a numeric vector holding the parameters.
skeleton
may take additional arguments, which will be filled, as above, with user-specified data.
skeleton
must return a numeric vector of the same length as x
, which contains the value vectorfield (if the dynamical system is continuous) or the value of the map (if the dynamical system is discrete), at the point x
at time t
.
params
, t0
, and ...
.
params
will be a named numeric vector of parameters.
t0
will be the time at which initial conditions are desired.
initializer
must return a named numeric vector of initial states.pomp
object contains covariates (via the covar
argument; see above), then whenever any of the Rfunctions described above are called, they will each be supplied with an additional argument covars
.
This will be a named numeric vector containing the (interpolated) values of the covariates at the time t
.
In particular, covars
will have one value for each column of the covariate table.pomp
's zeronames
argument will be set to zero immediately following each observation.
See euler.sir
and the tutorials on the pomp
, but complete error checking is impossible.
If the user-specified functions do not conform to the above specifications, 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.
If skeleton
is specified, the user is responsible for verifying that it corresponds to a deterministic skeleton of the model.
Each rprocess
, dprocess
, rmeasure
, dmeasure
, skeleton
).
If an algorithm requires a component that has not been specified, an informative error will be generated.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