Time Series Stationarity & Order Picker
Time-series models like ARIMA assume the series is stationary, meaning its statistical behavior does not drift over time. ADF and KPSS tests check this. Paste a series to get both verdicts, ACF and PACF plots, a recommended differencing order, and ranked candidate ARIMA(p,d,q) models with AICc.
New to stationarity? Read the 4-min primer ▾
Stationarity in one sentence. A series is stationary if its mean, variance, and autocorrelation structure don't drift over time. Most forecasting models (ARMA, ARIMA, VAR) assume stationarity, so the first job is to check, and if needed, to difference the series until it looks stationary.
ADF vs KPSS. They flip the null hypothesis. ADF (Augmented Dickey-Fuller) tests H₀: a unit root is present (non-stationary). KPSS tests H₀: the series is stationary. Combine them: ADF rejects + KPSS does not reject ⇒ stationary. KPSS rejects + ADF does not ⇒ non-stationary, difference once. Both reject or both fail to reject ⇒ ambiguous; lean on the visual.
Reading ACF and PACF. The autocorrelation function (ACF) shows correlation at each lag; the partial autocorrelation function (PACF) shows the same after removing shorter-lag effects. AR(p) shows PACF cutting off at lag p, ACF tailing off. MA(q) shows ACF cutting off at lag q, PACF tailing off. Mixed ARMA shows both decaying. Bars outside ±1.96/√n are the conventional significance bounds.
Picking ARIMA(p,d,q). First fix d via ADF/KPSS. Then read p and q from ACF/PACF cutoff patterns as a starting point. Then refine with AICc, the small-sample-corrected information criterion: lower AICc means a better trade-off between fit and complexity. Auto-suggested orders are starting points; always validate with residual diagnostics before trusting a forecast.
Try a real-world example to load.
Read more Anatomy of stationarity testing & ARIMA order picking
Caveats When this is the wrong tool
- If you have…
- Use instead
- n < 30
- Both ADF and KPSS have low power on short series. The verdict will be ambiguous; the visual is your best evidence.
- Multiple time series (VAR / VECM / cointegration)
- Out of scope. Use the
varsorurcaR packages. - Structural breaks (level shifts, regime change)
- ADF/KPSS treat the whole series as one regime. Use Zivot-Andrews or Bai-Perron tests via
strucchange. - Heteroskedastic series (GARCH-flavoured)
- Variance non-stationarity is a different beast. Run ARCH-LM tests and consider a GARCH model after fitting the mean.
- Missing values mid-series
- We strip missing values before testing. If the gaps are large, impute with
imputeTS::na_kalmanfirst; biased imputation will bias the tests. - Daily series with weekly + yearly seasonality
- Multi-seasonal series need
msts+tbatsfrom theforecastpackage; this tool handles a single seasonal period.
- Time Series Analysis with R - foundations, decomposition, smoothing.
- Time Series Forecasting with R - ARIMA, ETS, and validation.
- More on forecasting - auto.arima, residual diagnostics, ensembles.
- Confidence Interval Calculator - the next step once your residuals are clean.
Numerical accuracy: ADF p-value via MacKinnon (1996) response surface; KPSS p-value via interpolation of Kwiatkowski et al. (1992) critical values; ACF/PACF via Durbin-Levinson; ARIMA log-likelihood via the innovations algorithm.