I have a time series data that i wanted to make an ARIMA model, but in a condition that, my forecast result needed to be a strictly positive number, so here is my actual data:

Time Series Data

but before making a model, I am conducting stationary test first to these data to look if it follows Stationary or not, then I get result like this using adf.test(x, alternative="stationary")

enter image description here

it is failed to reject h0, so the conclusion is my data is not stationary (contains unit root), so I try second order differencing diff(x) until the p value shows 0.01 that reject h0, and makes my data look like this

enter image description here

but the following result of differencing will produce combination of negative and positive number on the forecasting that doesn't satisfy my condition that I needed all forecast number to be positive.. here is the comparison of my actual and prediction values

enter image description here

in here I am using the differenced data to make an ARIMA model that appears to have a best model of ARIMA(4,0,0) by auto.arima() function, I wonder.. does making an absolute of data differencing are allowed to make this happen? or does these data is not suited to forecast? I am still new while studying to do better in ARIMA modelling, thankyou in advance


You have , i.e., a time series that is integer-valued and nonnegative. ARIMA doesn't really make a lot of sense in this case, since it assumes non-integer data and in principle can yield negative values.

You may want to look at earlier threads tagged both "count data" and "time series".

Unfortunately, standard forecasting textbooks offer only limited guidance about count data time series, especially series that exhibit obvious trends, like yours. In your case, I would try fitting a Poisson or Negative Binomial regression, where you could regress your sales on a trend regressors. This would disregard any integer autoregressive behavior, but with just 33 observations, fitting two parameters (intercept and trend coefficient) for a Poisson regression or three parameters (the same, plus an overdispersion coefficient for a NegBin regression), I don't think expending yet another degree of freedom for potential AR effects is worthwhile.

Alternatively, you may want to look into integer ARMA models, or INARMA. Mona Mohammadipour wrote a Ph.D. thesis on these a few years ago, but haven't seen them much used in the count data forecasting community.

Or you could look into count data forecasting methods that explicitly model obsolescence, which is what comes to mind at seeing your series decay to zero. Prestwich et al. (2014, IJF) and Teunter et al. (2011, EJOR) are two recent publications proposing such methods.

  • $\begingroup$ i see.. thankyou sir Stephan! i am learning a lot.. so best practice to implement count data is to use INARMA model or to try fitting some regression instead.. by the way, the publication ebook need purchases, i wonder if i can get some free copy if possible..again Thankyou sir! $\endgroup$ – Jovan Geraldy Candra Jan 24 '18 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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