Description Usage Arguments Details Value Author(s) See Also Examples
simulate
generates simulations of the state and measurement processes.
1 2 3 4 |
object |
An object of class |
nsim |
The number of simulations to perform.
Note that the number of replicates will be |
seed |
optional; if set, the pseudorandom number generator (RNG) will be initialized with |
params |
either a named numeric vector or a numeric matrix with rownames.
The parameters to use in simulating the model.
If |
states |
Do we want the state trajectories? |
obs |
Do we want data-frames of the simulated observations? |
times, t0 |
|
as.data.frame, include.data |
logical; if |
... |
further arguments that are currently 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, together with the parameters used (in slot params
) and the state trajectories also (in slot states
).
If times
is specified, then the simulated observations will be at times times
.
If nsim=1
, then a single pomp
object is returned (and not a singleton list).
If states=TRUE
and obs=FALSE
, simulated state trajectories are returned as a rank-3 array with dimensions nvar
x (ncol(params)*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-3 array with dimensions nobs
x (ncol(params)*nsim)
x ntimes
.
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
pomp
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.