# 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