simulate {pomp} | R Documentation |
Simulations of a partially-observed Markov process
Description
simulate
generates simulations of the state and measurement
processes.
Usage
## S4 method for signature 'missing'
simulate(
nsim = 1,
seed = NULL,
times,
t0,
params,
rinit,
rprocess,
rmeasure,
format = c("pomps", "arrays", "data.frame"),
include.data = FALSE,
...,
verbose = getOption("verbose", FALSE)
)
## S4 method for signature 'data.frame'
simulate(
object,
nsim = 1,
seed = NULL,
times,
t0,
params,
rinit,
rprocess,
rmeasure,
format = c("pomps", "arrays", "data.frame"),
include.data = FALSE,
...,
verbose = getOption("verbose", FALSE)
)
## S4 method for signature 'pomp'
simulate(
object,
nsim = 1,
seed = NULL,
format = c("pomps", "arrays", "data.frame"),
include.data = FALSE,
...,
verbose = getOption("verbose", FALSE)
)
## S4 method for signature 'objfun'
simulate(object, nsim = 1, seed = NULL, ...)
Arguments
nsim |
The number of simulations to perform.
Note that the number of replicates will be |
seed |
optional integer;
if set, the pseudorandom number generator (RNG) will be initialized with |
times |
the sequence of observation times.
|
t0 |
The zero-time, i.e., the time of the initial state.
This must be no later than the time of the first observation, i.e., |
params |
a named numeric vector or a matrix with rownames containing the parameters at which the simulations are to be performed. |
rinit |
simulator of the initial-state distribution.
This can be furnished either as a C snippet, an R function, or the name of a pre-compiled native routine available in a dynamically loaded library.
Setting |
rprocess |
simulator of the latent state process, specified using one of the rprocess plugins.
Setting |
rmeasure |
simulator of the measurement model, specified either as a C snippet, an R function, or the name of a pre-compiled native routine available in a dynamically loaded library.
Setting |
format |
the format in which to return the results.
|
include.data |
if |
... |
additional arguments are passed to |
verbose |
logical; if |
object |
optional; if present, it should be a data frame or a ‘pomp’ object. |
Value
A single “pomp” object,
a “pompList” object,
a named list of two arrays,
or a data frame, according to the format
option.
If params
is a matrix, each column is treated as a distinct parameter set.
In this case, if nsim=1
,
then simulate
will return one simulation for each parameter set.
If nsim>1
,
then simulate
will yield nsim
simulations for each parameter set.
These will be ordered such that
the first ncol(params)
simulations represent one simulation
from each of the distinct parameter sets,
the second ncol(params)
simulations represent a second simulation from each,
and so on.
Adding column names to params
can be helpful.
Note for Windows users
Some Windows users report problems when using C snippets in parallel computations.
These appear to arise when the temporary files created during the C snippet compilation process are not handled properly by the operating system.
To circumvent this problem, use the cdir
and cfile
options to cause the C snippets to be written to a file of your choice, thus avoiding the use of temporary files altogether.
Author(s)
Aaron A. King
See Also
More on pomp elementary algorithms:
elementary_algorithms
,
kalman
,
pfilter()
,
pomp-package
,
probe()
,
spect()
,
trajectory()
,
wpfilter()