I am doing time-series analysis in python for the dataset given below-

Here's link

The plot for the above time series seems to be non-stationary for me because on observing it looks like consisting of some trend. The plot for the above time series is as given- enter image description here

The above plot is converted into stationary time series by taking log and then the difference between previous and succeeding values. I have plotted corresponding ACF and PACF plot for that non-stationary time series which is given below- enter image description here

From the above ACF it is clear to me that curve cutoff after 1th lag, and also in PACF plot no of ticks outside cutoff is 1. But from these two plots how I should choose the type of model (ARMA or ARIMA). If it is ARMA model then what is (p,q) and Why. Or if it is ARIMA model then what is (p,d,q) and Why?.

  • $\begingroup$ you say "it looks like consisting of some trend." I say "it looks like it has a level.step shift indicating a change in intercept" $\endgroup$
    – IrishStat
    May 18, 2019 at 14:36

2 Answers 2


There are different methods to decide on the order of integration for a nonseasonal AR(I)MA model. Hyndman & Khandakar (2008, section 3.1) give pointers to the most commonly encountered ones. The most common type would be unit root tests, especially the Dickey-Fuller test, which Hyndman & Khandakar counsel against, since it biases towards more rather than fewer differences. Instead, they use a KPSS test (Kwiatkowski et al., 1992): you test for a unit root; if the test is significant, you difference and test again, until the test is not significant any more.

Yes, these are not the most recent papers, but auto.arima() in the forecast package for R still uses this approach, and that is pretty much as close to the gold standard in time series analysis as you can get.

After you have decided on the order of integration, you need to decide on AR and MA orders. Parsing ACF/PACF plots of successive residuals is the older Box-Jenkins approach; the more modern way would be to minimize an information criterion like the AICc. See the fuller description of how auto.arima() decides on a model order and estimates.

In the present case, auto.arima() would go for an ARIMA(1,1,1) model:


births <- read.table("daily-total-female-births-CA.csv",header=TRUE,sep=",",colClasses=c("Date","numeric"))
births_ts <- ts(births$births,frequency=365,start=births$date[1])


Since you work in Python, you may be interested in pmdarima and in this SO thread: auto.arima() equivalent for python.

  • $\begingroup$ From your answer I understand how to take value of those parameters (p,d,q) for ARIMA model. But my first problem is how should I decide that whether that stationary series is fitted in ARMA model or ARIMA model. Is there any parameters to decide between the above two models $\endgroup$
    – T.g
    May 7, 2019 at 9:57
  • $\begingroup$ Yes, that is the question of integration, which I start my answer with.If your very first KPSS test comes up insignificant, you do not difference, but fit an ARMA model. $\endgroup$ May 7, 2019 at 10:00
  • $\begingroup$ That means for ARMA model I=0 and for ARIMA model I>0. But is there any easy way to decide that order of integration using only ACF and PACF plot. Or by just looking how we reduced series to stationary. $\endgroup$
    – T.g
    May 7, 2019 at 10:05
  • $\begingroup$ You typically look at unit roots and make your series stationary by differencing, i.e., accounting for integration. $\endgroup$ May 7, 2019 at 10:07
  • $\begingroup$ +1 In three short understandable paragraphs this answer has covered more ground than thousands of other ARIMA-related posts on this site have done collectively. $\endgroup$
    – whuber
    May 7, 2019 at 12:51

Your data set not only needs differencing and a log transform BUT also needs to incorporate a marginally significant level shift detectable at 1974/1 period 181 . ARIMA model building/identification should be done in concert with the empirical identification of pulses, level shifts , seasonal pulses and local time trends as has been smartly pointed out by @AdamO not simply assuming no latent deterministic structure Interrupted Time Series Analysis - ARIMAX for High Frequency Biological Data? ..... "The correlograms (acf/pacf) should be calculated from residuals using a model that controls for intervention administration, otherwise the intervention effects are taken to be Gaussian noise, underestimating the actual autoregressive effect."

enter image description here

A useful model is here enter image description here and here enter image description here with residual acf here enter image description here


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.