3
$\begingroup$

As a course project for Time Series Analysis, I used ARIMA for a very simple model - (Analyzing number of deaths in each episode of game of thrones and forecasting the number of deaths in the final episode), thus there wasn't as much data for this. I have been asked to redo it using INAR model. I was wondering if that could be achieved using ARIMA and applying zero for the MA and lag part, which would just give it AR. But I'm confused as to how to make it Integer valued. I need this done in Python and was wondering if there is a model out there for this.

This is the code I used for forecasting but I'm sure INAR is more than this.

#Prediction    
model = ARIMA(df, order=(15, 0, 0))    
model_fit = model.fit(disp=False)    
prediction = model_fit.forecast()[0]    
print(prediction)
$\endgroup$

2 Answers 2

2
$\begingroup$

INAR is structurally different from ARIMA. ARIMA supposes normally distributed innovations, whereas INAR models . Therefore, INAR models need to estimate their parameters using different likelihoods. You won't be able to make an ARIMA estimator perform well on low volume count data. (If your count data is high volume, a normal approximation may make more sense.)

Unfortunately, there does not seem to be anything in Python, judging from a couple of searches using combinations of "integer autoregressive", "count data" and "time series". You could take published descriptions of INAR models (e.g., this or this, both of which I haven't read) and "roll your own" estimator in Python. Or, if you are open to alternatives to Python, the tscount package for R may be helpful. (While Python's statistical capabilities have been catching up to R, they still lag behind, and count data time series models are one aspect where R is ahead. There are also others.)

$\endgroup$
1
$\begingroup$

Before experimenting with the INAR model, you may want to check the pattern of serial correlation in your data set (by using the ACF plot). If you don't find a strong correlation at lags 1,2,3... etc, then an integer autoregressive model is obviously not a good choice for your data. You may then want to use a static Poisson or some other count data model such as the Generalized Poisson or the Negative Binomial depending on how dispersed your data is. On the other hand, if you find evidence of serial correlation, especially at lag-1, then the Poisson INAR(1) model may be a good choice.

Here is an implementation of the Poisson INAR(1) model in Python and using statsmodels' GenericLikelihoodModel class:

https://gist.github.com/sachinsdate/570b08d8052d71a94ee57b188abfbf90

In the above implementation, the estimation is done using MLE, although the original paper on Poisson INAR(1) by Brannas seems to use Conditional Least Squares and GMM. Here is a tutorial on how to use the Poisson INAR(1) model.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.