Type: | Package |
Title: | Simulates ZINAR(1) Model and Estimates Its Parameters Under Frequentist Approach |
Version: | 0.1.0 |
Maintainer: | João Vitor Ribeiro <joao.vitorribeiro@ufpe.br> |
Description: | Generates Realizations of First-Order Integer Valued Autoregressive Processes with Zero-Inflated Innovations (ZINAR(1)) and Estimates its Parameters as described in Garay et al. (2021) <doi:10.1007/978-3-030-82110-4_2>. |
License: | GPL (≥ 3.0) |
Imports: | gamlss.dist, VGAM, MASS, statmod, gtools, graphics, stats, scales |
Suggests: | devtools, roxygen2 |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.2.1 |
Depends: | R (≥ 4.0) |
NeedsCompilation: | no |
Packaged: | 2022-11-01 13:56:26 UTC; Vitor |
Author: | Aldo M. Garay [aut], João Vitor Ribeiro [aut, cre] |
Repository: | CRAN |
Date/Publication: | 2022-11-02 14:30:12 UTC |
Parameter Estimation for ZINAR(1) Models
Description
This function uses the EM algorithm to find the maximum likelihood estimates of a ZINAR(1) model.
Usage
EST_ZINAR(y,init = NULL,tol = 1e-05,iter = 1000,model,innovation,desc = FALSE)
Arguments
y |
A vector containing a discrete non-negative time series dataset. |
init |
A vector containing the initial parameters estimates to maximize the likelihood function. If not informed, uses Yule-Walker method to calculate. |
tol |
Tolerance for the convergence of the algorithm. Defaults to 1e-5. |
iter |
Maximum number of iterations of the algorithm. Defaults to 1000. |
model |
Must be "zinar", if the innovation have Zero-Inflated distribution, and "inar", otherwise. |
innovation |
Must be "Po" if Poisson, "NB" if Negative binomial or "GI" if Gaussian inverse. |
desc |
TRUE to plot the exploratory graphs. Defaults to FALSE. |
Value
Returns a list containing the parameters estimates and the number of interactions.
References
Aldo M.; Medina, Francyelle L.; Jales, Isaac C.; Bertail, Patrice. First-order integer valued AR processes with zero-inflated innovations. Cyclostationarity: Theory and Methods, Springer Verlag - 2021, v. 1, p. 19-40.
Examples
# Estimates the parameters of an INAR(1) and a ZINAR(1) models with Poisson innovations
# for the monthly number of drug offenses recorded from January 1990 to December 2001
# in Pittsburgh census tract 2206.
data(PghTracts)
y=ts(PghTracts$DRUGS,start=c(1990,1),end=c(2001,12),frequency=12)
Inar1 = EST_ZINAR(y, init = c(0.3,0.5,2), model = "inar", innovation = "Po",desc = TRUE)
ZIPInar1 = EST_ZINAR(y, init = c(0.3,0.5,2), model = "zinar", innovation = "Po",desc = TRUE)
Drug Offenses
Description
Monthly number of drug offenses recorded from January 1990 to December 2001, with 144 observations, in Pittsburgh census tract 2206.
Usage
PghTracts
Format
A data frame with 144 rows and 4 columns containing the census tract and the variables YEAR
,MONTH
and DRUGS
.
Source
Aldo M.; Medina, Francyelle L.; Jales, Isaac C.; Bertail, Patrice. First-order integer valued AR processes with zero-inflated innovations. Cyclostationarity: Theory and Methods, Springer Verlag - 2021, v. 1, p. 19-40. DOI: 10.1007/978-3-030-82110-4_2
Simulate values for ZINAR(1)
Description
This function generates realizations of a ZINAR(1) process.
Usage
SIM_ZINAR(n, alpha, rho, th, innovation)
Arguments
n |
Number of realizations of the ZINAR(1) process. |
alpha |
The probability of an element remaining in the process. The parameter alpha must be in [0,1]. |
rho |
The probability of the innovation be from the state zero. The parameter rho must be in [0,1]. |
th |
Is equal the value of the parameter lambda, if the innovations follow a Zero-Inflated Poisson (ZIP) distribution, and is a vector containing the values of the parameters (mu,phi), if the innovations follow a Zero-Inflated Negative Binomial (ZINB) or Zero-Inflated Inverse Gaussian (ZIPIG) distribution. |
innovation |
Must be "Po" if Poisson, "NB" if Negative binomial or "GI" if Gaussian inverse. |
Value
Returns a numeric vector representing a realization of a ZINAR(1) process.
References
Aldo M.; Medina, Francyelle L.; Jales, Isaac C.; Bertail, Patrice. First-order integer valued AR processes with zero-inflated innovations. Cyclostationarity: Theory and Methods, Springer Verlag - 2021, v. 1, p. 19-40.
Examples
# Simulates values for ZIPInar1 model and estimate its parameters.
set.seed(5)
model = "zinar"
innv = "Po"
y = SIM_ZINAR(n = 500,alpha = 0.3,rho = 0.5,th = 3,innovation = innv)
ZIPInar1 = EST_ZINAR(y,model=model,innovation=innv,desc = TRUE)