Learn R Programming

spatPomp (version 1.1.0)

simulate: Simulation of a spatiotemporal partially-observed Markov process

Description

simulate generates simulations of the latent and measurement processes.

Usage

# S4 method for spatPomp
simulate(
  object,
  nsim = 1,
  seed = NULL,
  format = c("spatPomps", "data.frame"),
  include.data = FALSE,
  ...
)

Value

if format='spatPomps' and nsim=1 an object of class ‘spatPomp’ representing a simulation from the model in object is returned. If format='spatPomps' and nsim>1 a list of class ‘spatPomp’ objects is returned. If format='data.frame' then a class ‘data.frame’ object is returned.

Arguments

object

optional; if present, it should be a data frame or a ‘pomp’ object.

nsim

number of simulations.

seed

optional integer; if set, the pseudorandom number generator (RNG) will be initialized with seed. The RNG will be restored to its original state afterward.

format

the format of the simulated results. If the argument is set to 'spatPomps', the default behavior, then the output is a list of spatPomp objects. Options are 'spatPomps' and 'data.frame'.

include.data

if TRUE, the original data and covariates (if any) are included (with .id = "data"). This option is ignored unless format = "data.frame".

...

additional arguments are passed to pomp.

Author

Kidus Asfaw

References

Asfaw, K., Park, J., Ho, A., King, A. A., and Ionides, E. L. (2020) Partially observed Markov processes with spatial structure via the R package spatPomp. ArXiv: 2101.01157. tools:::Rd_expr_doi("10.48550/arXiv.2101.01157")

Examples

Run this code
# Complete examples are provided in the package tests
if (FALSE) {
# Get a spatPomp object
b <- bm(U=2, N=5)
# Get 2 simulations from same model as data.frame
sims <- simulate(b, nsim=2, format='data.frame')
}

Run the code above in your browser using DataLab