MLCrack

    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:

    1. Visual inspection: look for trends, changing variance.

    2. Augmented Dickey-Fuller (ADF) test: H0 is unit root (non-stationary).

    3. KPSS test: H0 is stationarity.

    4. 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.