Learn R Programming

spINAR (version 0.2.0)

spinar_est: Semiparametric estimation of INAR models

Description

Semiparametric estimation of the autoregressive parameters and the innovation distribution of INAR(p) models, \(\code{p} \in \{1,2\}\). The estimation is conducted by maximizing the conditional likelihood of the model.

Usage

spinar_est(x, p)

Value

Vector containing the estimated coefficients \(\code{alpha}_1,...,\code{alpha}_p\) and the estimated entries of the pmf \(\code{pmf}_0, \code{pmf}_1\),... where \(\code{pmf}_i\) represents the probability of an innovation being equal to \(i\).

Arguments

x

[integer]
vector with integer observations.

p

[integer(1)]
order of the INAR model, where \(\code{p} \in \{1,2\}\).

Examples

Run this code
# generate data
dat1 <- spinar_sim(n = 200, p = 1, alpha = 0.5,
                   pmf = c(0.3, 0.3, 0.2, 0.1, 0.1))
dat2 <- spinar_sim(n = 200, p = 2, alpha = c(0.2, 0.3),
                   pmf = c(0.25, 0.2, 0.15, 0.1, 0.1, 0.1, 0.1))

# \donttest{
# semiparametric estimation of INAR(1) model
spinar_est(x = dat1, p = 1)
# semiparametric estimation of INAR(2) model
spinar_est(x = dat2, p = 2)# }

Run the code above in your browser using DataLab