data_simu: Simulate Time Series Data for ZI-INAR(1) or H-INAR(1) Models

View source: R/data_simu.R

data_simuR Documentation

Simulate Time Series Data for ZI-INAR(1) or H-INAR(1) Models

Description

This function simulates time series data for Zero-Inflated INAR(1) (ZI-INAR(1)) or Hurdle INAR(1) (H-INAR(1)) models, using Poisson, Negative Binomial, Generalized Poisson, or Conway-Maxwell-Poisson (CMP) innovations.

Usage

data_simu(n, alpha, rho, lambda, disp = NULL, mod_type, distri)

Arguments

n

Integer specifying the number of observations to simulate.

alpha

Numeric value between 0 and 1 representing the autoregressive parameter (strictly between 0 and 1).

rho

Numeric value between 0 and 1 representing the zero-inflation or hurdle parameter.

lambda

Numeric value (> 0) representing the location parameter (mean) for Poisson, or the location parameter for NB, GP, and CMP distributions. For CMP this is the rate parameter, not generally the mean.

disp

Numeric value representing the dispersion parameter.

  • For "nb": Must be positive (> 0).

  • For "gp": Must be strictly between 0 and 1 (0 < disp < 1).

  • For "cmp": The CMP parameter nu; must be positive (> 0). Values below 1 give overdispersed CMP innovations; 1 gives Poisson; values above 1 give underdispersed CMP innovations before zero inflation.

  • For "poi": Ignored.

mod_type

Character string indicating the model type ("zi" or "h").

distri

Character string specifying the distribution. Options are:

  • "poi" for Poisson

  • "nb" for Negative Binomial

  • "gp" for Generalized Poisson (Only mod_type="zi" supported)

  • "cmp" for Conway-Maxwell-Poisson (Only mod_type="zi" supported)

Details

The first 100 observations are discarded as burn-in. Zero inflation applies to the innovations, not directly to the series. For an ordinary CMP-INAR(1) process use rho = 0. This simulates CMP innovations, not a CMP stationary marginal distribution.

Value

A numeric vector containing the simulated time series data.

References

Part of the implementation of this function was adapted from the ZINAR1 package. The ZINAR1 package simulates first-order integer-valued autoregressive processes with zero-inflated innovations (ZINAR(1)) and estimates its parameters under a frequentist approach.

For more information about the ZINAR1 package, please refer to:

Aldo M. Garay, João Vitor Ribeiro (2022). ZINAR1: Simulates ZINAR(1) Model and Estimates Its Parameters Under Frequentist Approach. R package version 0.1.0. Available at: https://CRAN.R-project.org/package=ZINAR1.

Garay, A. M., Ribeiro, J. V. (2021). First-Order Integer Valued AR Processes with Zero-Inflated Innovations. In: Nonstationary Systems: Theory and Applications, Springer. DOI: \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/978-3-030-82110-4_2")}.

We acknowledge the original authors, Aldo M. Garay and João Vitor Ribeiro, for their contributions.

Examples

# Simulate 50 observations from a Zero-Inflated Poisson INAR(1) model
y_data <- data_simu(n = 50, alpha = 0.5, rho = 0.3, lambda = 5,
                    mod_type = "zi", distri = "poi")
head(y_data)

# Simulate a zero-inflated CMP-INAR(1) series (disp is nu)
y_cmp <- data_simu(n = 50, alpha = 0.5, rho = 0.3, lambda = 2.5,
                   disp = 1.2, mod_type = "zi", distri = "cmp")


ZIHINAR1 documentation built on Nov. 10, 2026, 9:07 a.m.