simulate.hhh4ZI: Simulate 'hhh4ZI' Count Time Series

simulate.hhh4ZIR Documentation

Simulate hhh4ZI Count Time Series

Description

Fork of simulate.hhh4 to support zero-inflated models fitted with hhh4ZI.

Usage

## S3 method for class 'hhh4ZI'
simulate(
  object,
  nsim = 1,
  seed = NULL,
  y.start = NULL,
  subset = 1:nrow(object$stsObj),
  coefs = coef(object),
  components = c("ar", "ne", "end"),
  simplify = nsim > 1,
  ...
)

Arguments

object

of class "hhh4ZI".

nsim

number of time series to simulate. Defaults to 1.

seed

an object specifying how the random number generator should be initialized for simulation (via set.seed). The initial state will also be stored as an attribute "seed" of the result. The original state of the .Random.seed will be restored at the end of the simulation. By default (NULL), neither initialization nor recovery will be done. This behaviour is copied from the simulate.lm method.

y.start

vector or matrix (with ncol(object$stsObj) columns) with starting counts for the epidemic components. If NULL, the observed means in the respective units of the data in object during subset are used.

subset

time period in which to simulate data. Defaults to (and cannot exceed) the whole period defined by the underlying "sts" object.

coefs

coefficients used for simulation from the model in object. Default is to use the fitted parameters. Note that the coefs-vector must be in the same order and scaling as coef(object), which especially means reparamPsi = TRUE (as per default when using the coef-method to extract the parameters). The overdispersion parameter in coefs is the inverse of the dispersion parameter size in rnbinom.

components

character vector indicating which components of the fitted model object should be active during simulation. For instance, a simulation with components="end" is solely based on the fitted endemic mean.

simplify

logical indicating if only the simulated counts (TRUE) or the full "sts" object (FALSE) should be returned for every replicate. By default a full "sts" object is returned iff nsim=1.

...

unused (argument of the generic).


Junyi-L/hhh4ZI documentation built on Oct. 14, 2024, 11:45 p.m.