| simulate-pomp {pomp} | R Documentation |
simulate can be used to generate simulated data sets
and/or to simulate the state process.
## S4 method for signature 'pomp':
simulate(object, nsim = 1, seed = NULL, xstart, params,
states = FALSE, obs = FALSE, times = c(object@t0,time(object)),
...)
object |
An object of class pomp. |
nsim |
The number of simulations to perform. Note that the
number of replicates will be nsim times
ncol(xstart). |
seed |
The random seed to use. |
xstart |
The initial conditions. |
params |
The parameters to use in simulating the model. |
states |
Do we want the state trajectories? |
obs |
Do we want data-frames of the simulated observations? |
times |
The times for which observations are required. Note
that the first element in times is the start time. No
observation will be returned for this time. |
... |
further arguments that are at present ignored. |
Simulation of the state process and of the measurement process are
each accomplished by a single call to the user-supplied
rprocess and rmeasure functions, respectively. This
makes it possible for the user to write highly optimized code for
these potentially expensive computations.
If states=FALSE and obs=FALSE (the default), a list of
nsim `pomp' objects is returned. Each has a simulated data
set.
If states=TRUE and obs=FALSE, simulated state
trajectories are returned as a rank-4 array with dimensions
nvar x ncol(xstart) x nsim x ntimes.
Here, nvar is the number of state variables and ntimes
the length of the argument times. The measurement process is
not simulated in this case.
If states=FALSE and obs=TRUE, simulated observations are
returned as a rank-4 array with dimensions nobs x
ncol(xstart) x nsim x (ntimes-1). Here,
nobs is the number of observables.
If both states=TRUE and obs=TRUE, then a
named list is returned. It contains the state trajectories and
simulated observations as above.
Aaron A. King (kingaa at umich dot edu)