Why Test Stationarity Directly?
Unit-root tests such as the augmented Dickey–Fuller and Phillips–Perron tests use a unit root as their null hypothesis. The KPSS test reverses the testing perspective: its null is that the series is stationary around specified deterministic terms. This distinction matters because a failure to reject a unit-root null and a rejection of a stationarity null provide different evidence than either result alone.
KPSS is not a test of whether the sample looks smooth or whether its estimated trend is statistically significant. It asks whether deviations from a chosen deterministic component are consistent with a stationary process, allowing for short-run serial dependence. The choice between removing only a level and removing a level plus a linear trend is part of the test specification.
Model, Null, and Statistic
A standard representation for the KPSS null and alternative is
Here \(d_t\) is the deterministic component: \(d_t=\mu\) for the level version, or \(d_t=\mu+\beta t\) for the trend version. The component \(u_t\) is a zero-mean, weakly stationary disturbance with a finite, positive long-run variance. The component \(r_t\) is a random walk, with innovations \(\eta_t\) of mean zero and variance \(\sigma_\eta^2\), independent of \(u_t\) under the standard setup. The null is \(H_0:\sigma_\eta^2=0\), so there is no stochastic trend; the alternative is \(H_a:\sigma_\eta^2>0\).
For the chosen deterministic specification, estimate \(d_t\) by ordinary least squares and let \(\hat{u}_t\) be the residual for observation \(t\). Define the partial sum \(S_t=\sum_{j=1}^{t}\hat{u}_j\). The KPSS statistic is
where \(\hat{\omega}^{\,2}\) estimates the long-run variance of the stationary disturbance. Under the null, the statistic has a nonstandard limiting distribution, and its critical values differ between the level and trend versions. It is not compared with the usual \(t\), \(F\), or chi-square critical values.
Estimating the Long-Run Variance
The long-run variance is the sum of the disturbance’s autocovariances across all lags. It accounts for serial dependence that would be missed by using only the variance at lag zero. A practical estimate truncates and weights the sample autocovariances. One common choice is the Bartlett, or Newey–West, estimate:
The nonnegative integer \(\ell\) is the bandwidth, or maximum included lag. The Bartlett weights decline to zero at the truncation point. Setting \(\ell=0\) gives \(\hat{\omega}^{\,2}=\hat{\gamma}_0\), which is useful for hand calculations but may be inadequate when the residuals are serially correlated. In asymptotic use, bandwidth rules are chosen so that the bandwidth grows with the sample while remaining small relative to it; in practice, software defaults and finite-sample choices can affect the result.
Worked Calculations
Worked Example: Level Stationarity With a Zero-Lag Estimate
Suppose a hypothetical four-period series is \(10,12,11,13\). Test the level-stationarity null using the illustrative choice \(\ell=0\), so the long-run variance estimate is the residual variance defined with divisor \(n\). The fitted constant is the sample mean, \(\bar{x}=11.5\), and the residuals are \(-1.5,\,0.5,\,-0.5,\,1.5\). They sum to zero, as required after fitting an intercept.
The partial sums are \(S_1=-1.5\), \(S_2=-1.0\), \(S_3=-1.5\), and \(S_4=0\). Thus,
The lag-zero estimate is
Therefore,
For orientation, the commonly reported asymptotic 5% critical value for the level version is about \(0.463\). The calculated statistic is below it, so this calculation does not reject level stationarity at 5%. The sample is extremely small, and \(\ell=0\) is a simplifying choice; this comparison illustrates the arithmetic rather than supporting a reliable empirical conclusion.
Worked Example: Removing a Linear Trend
Consider the hypothetical observations \(y_t=13,12,17\) at times \(t=1,2,3\). For the trend-stationarity version, regress \(y_t\) on an intercept and time. The sample means are \(\bar{t}=2\) and \(\bar{y}=14\). The OLS slope is
The fitted values at times \(1,2,3\) are therefore \(12,14,16\), and the residuals are \(1,-2,1\). Their partial sums are \(S_1=1\), \(S_2=-1\), and \(S_3=0\), giving \(\sum_{t=1}^{3}S_t^2=1+1+0=2\). With \(\ell=0\),
The common asymptotic 5% critical value for the trend version is about \(0.146\). The statistic is below this reference value, so the trend-stationarity null is not rejected at 5% in this illustrative calculation. With only three observations, the asymptotic comparison is especially unreliable. The example also shows why the trend version uses residuals after fitting both an intercept and a slope, rather than residuals after subtracting the sample mean alone.
Worked Example: How the Bandwidth Can Change the Statistic
Consider the hypothetical residual sequence \(1,-1,1,-1\), which sums to zero and could arise after fitting an intercept. Its partial sums are \(1,0,1,0\), so \(\sum_{t=1}^{4}S_t^2=2\). With \(\ell=0\), \(\hat{\omega}^{\,2}=\hat{\gamma}_0=4/4=1\), and the statistic is \(2/[4^2(1)]=0.125\).
Now use \(\ell=1\). The lag-one sample autocovariance and its Bartlett weight are
The long-run variance estimate becomes
The statistic changes from \(0.125\) to \(0.500\) because the estimated serial dependence changes the denominator. The latter exceeds the common level-version 5% reference value of about \(0.463\), whereas the former does not. This four-point example is not a basis for a dependable test decision; it demonstrates why the bandwidth and the resulting long-run variance estimate must be reported and considered.
Why the Partial Sums Matter
The KPSS construction accumulates residuals over time. Under the stationarity null, residual partial sums fluctuate, but their scale is governed by the long-run variance. The factor \(n^2\) in the denominator and the estimate \(\hat{\omega}^{\,2}\) put the sum of squared partial sums on a scale with a nonstandard limiting distribution. If the series instead contains a stochastic trend, detrending does not generally remove its persistent movements: cumulative residuals tend to become large relative to the stationary-noise benchmark, pushing the statistic upward.
This explains both the direction of the test and its sensitivity to specification. A suitable deterministic component must be chosen before forming residuals. Omitting a genuine linear trend can make trend-stationary data look nonstationary; adding a trend when the intended null is level stationarity changes the test and its critical values. Serial dependence also matters: the lag-zero variance estimate alone can misrepresent the scale of cumulative fluctuations.
Using KPSS Alongside Unit-Root-Null Tests
KPSS is most informative when read alongside tests such as ADF or Phillips–Perron, which use a unit-root null. The tests have different null hypotheses, so their results are complementary rather than interchangeable. A common summary is:
| Unit-root-null test | KPSS stationarity-null test | Careful reading |
|---|---|---|
| Rejects unit root | Does not reject stationarity | Results are compatible with stationarity under the specified deterministic terms. |
| Does not reject unit root | Rejects stationarity | Results are compatible with persistent, nonstationary behavior. |
| Rejects unit root | Rejects stationarity | The tests disagree; specification, bandwidth, breaks, or finite-sample behavior may matter. |
| Does not reject unit root | Does not reject stationarity | Evidence is inconclusive; neither failure to reject establishes its null. |
This comparison does not create a mechanical decision rule. The tests may use different deterministic terms, lag or bandwidth choices, and finite-sample approximations. Results should be interpreted in light of those choices and the economic context. In particular, neither a KPSS rejection nor a unit-root-test nonrejection alone establishes the data-generating process.
Common Mistakes and Practical Checks
- Reversing the null. KPSS has a stationarity null, not a unit-root null. A large statistic is evidence against stationarity.
- Using the wrong deterministic specification. The level and trend versions use different residuals and different critical values. Do not compare a trend-version statistic with level-version critical values.
- Ignoring serial correlation. The long-run variance estimate is not automatically just the residual variance at lag zero. State the kernel and bandwidth or lag choice used.
- Calling nonrejection proof. Not rejecting stationarity means the test did not find sufficient evidence against it at the selected level; it does not prove the null true.
- Combining tests as if they had one null. ADF or Phillips–Perron nonrejection and KPSS rejection are statements about distinct null hypotheses. Report each result separately before drawing a qualified overall conclusion.
Check Your Understanding
Answer each question using the specified null and estimation choices.
- What is the null hypothesis of the level KPSS test, and how does it differ from the null of an ADF test?
- For residuals \(2,-1,-1\), calculate the partial sums and their sum of squares.
- Why can the KPSS statistic change when the bandwidth changes, even if the residuals stay the same?
- Which critical values should be used after residualizing on an intercept and linear time trend: level-version or trend-version values?
- If a unit-root-null test fails to reject and KPSS rejects stationarity, what is a careful interpretation of the combined evidence?