TIME SERIES & FORECASTING · INTERVIEW QUESTION
What is stationarity? Why is it important and how do you test for it?
🟡 intermediate · Statistical Methods
Hint: Statistical properties don't change over time. Think about ADF test.
Answer
A time series is stationary if its statistical properties (mean, variance, autocorrelation) are constant over time.
Interview reasoning
Types: strict stationarity (full distribution invariant) vs weak/wide-sense stationarity (first two moments constant).
Why important: many models (ARIMA, VAR) assume stationarity; non-stationary data leads to spurious results.
Testing:
-
Visual inspection: look for trends, changing variance.
-
Augmented Dickey-Fuller (ADF) test: H0 is unit root (non-stationary).
-
KPSS test: H0 is stationarity.
-
Phillips-Perron test. Making stationary: differencing (removes trend), log transform (stabilizes variance), seasonal differencing (removes seasonality), detrending.
Common pitfall: failing to check stationarity before modeling leads to poor forecasts and misleading statistical tests.
Weak stationarity means stable mean and variance with covariance depending only on lag; strict stationarity imposes invariance of the full joint distribution. Many classical models rely on the weaker condition. ADF and KPSS have different null hypotheses, so combine them with plots, structural-break evidence and forecast diagnostics.
Worked example. Random-walk levels have variance increasing with time, while independent first differences can be stationary under the specified innovation process.
Validation
Inspect level/variance shifts and residual ACF; compare transformed and untransformed forecasts across origins, accounting for short histories and breaks.
Common pitfalls
Rejecting a unit root does not rule out every nonstationarity. Differencing can leave changing variance and may remove useful structure unnecessarily.
Related questions
- Explain ARIMA. What are the p, d, q parameters and how do you select them?
- What is a time series and what makes it different from regular tabular data?
- Compare traditional vs deep learning approaches for time series forecasting.
- Why is random train-test splitting usually inappropriate for forecasting?
- What does stationarity mean in the context of many classical time-series models?