KPSS Stationarity Test: Null Hypothesis, Statistic, and Bandwidth
Learn what the KPSS test assumes, how its partial-sum statistic is calculated, how level and trend cases differ, and why bandwidth changes the result.
In this guideThe KPSS test asks whether stationarity is a defensible null
Short summary
The KPSS test puts level or trend stationarity in the null hypothesis. It detrends a series, accumulates the residuals, and scales their squared partial sums by an estimate of long-run variance. A large statistic can reject the selected stationarity model, but a non-rejection does not prove stationarity or a profitable mean-reversion trade.
The KPSS test asks whether stationarity is a defensible null
The Kwiatkowski–Phillips–Schmidt–Shin test, usually shortened to KPSS, reverses the null used by familiar Dickey–Fuller tests. Its null is that the series is stationary around the deterministic terms specified in the test. The alternative allows a stochastic trend, represented in the original setup by a random-walk component with positive innovation variance.
That choice changes how to read the result. A sufficiently large KPSS statistic is evidence against the selected level- or trend-stationarity null. A small statistic means the sample did not produce enough evidence to reject that null under the chosen setup. It does not prove that the process is stationary, that its mean is stable forever, or that a price will return to a useful trading level.
The broad stationarity and unit-root guide introduces the related concepts. The ADF and Phillips–Perron comparison explains two tests that instead place a unit root in the null. These are complementary questions, not interchangeable versions of one test.
The null removes the random-walk component
KPSS represents an observed series as
\[ y_t = d_t + r_t + \epsilon_t,\qquad r_t=r_{t-1}+u_t. \]
Here \(d_t\) is the deterministic part, \(r_t\) is a random-walk component, and \(\epsilon_t\) is a stationary error. For a level-stationarity test, \(d_t\) contains an intercept. For a trend-stationarity test, it contains an intercept and a linear time trend.
The null sets the innovation variance of the random walk to zero, \(\sigma_u^2=0\). Without that random walk, the series fluctuates around the specified constant or deterministic trend. The alternative allows \(\sigma_u^2>0\), so shocks can build into a stochastic trend rather than fade around the chosen deterministic path.
This is a maintained model, not a claim that every alternative must be a textbook random walk. Structural breaks, fractional persistence, nonlinear dynamics, changing variance, and deterministic terms chosen poorly can also make the null fit the sample badly. The test identifies tension with its stationarity setup; it does not identify a unique replacement model.
Partial sums turn persistent residuals into a large statistic
First regress the observations on the deterministic terms selected for the test and call the residuals \(\hat e_t\). Their cumulative partial sums are
\[ S_t=\sum_{j=1}^{t}\hat e_j. \]
The KPSS statistic is commonly written
\[ \eta=\frac{1}{n^2\hat{\omega}^{\,2}}\sum_{t=1}^{n}S_t^2, \]
where \(n\) is the sample size and \(\hat{\omega}^{\,2}\) estimates the residuals' long-run variance. A run of residuals with the same sign pushes \(S_t\) away from zero. Squaring the partial sums makes sustained departures contribute more than isolated sign changes.
The statistic is nonnegative. Larger cumulative departures, relative to the estimated long-run variance, make the stationarity null harder to maintain. The denominator is essential: residual serial dependence changes how much variation a partial sum should display even when the underlying process is stationary.
Choose level or trend stationarity before reading the statistic
The level version asks whether the series is stationary around a constant. The trend version first removes an intercept and linear time trend, then asks whether the remaining component is stationary. Common implementations label these cases mu and tau, but names and output conventions depend on the software.
The choice changes both the residuals and the reference distribution. A deterministic trend omitted from a trend-stationary series can leave a long residual pattern and inflate the statistic. Adding a trend without a reason changes the model being tested and can reduce the test's ability to detect some alternatives. Decide from the data definition and economic question, then report the choice rather than switching until one result looks favorable.
KPSS critical values use nonstandard asymptotic distributions, with different values for level and trend cases. Do not compare the statistic with an ordinary t or chi-square cutoff, and do not treat one memorized threshold as valid for every deterministic specification. Use the matching table or software output and state the significance level.
Some implementations report only a range for the p-value because they compare the statistic with a finite table of critical values. In that case, report the range the output supports instead of inventing extra decimal places. Include the level-or-trend case and the critical-value source so another reader can reproduce the decision.
<!-- learn:illustration -->

Long-run variance and bandwidth control the scale
A common long-run variance estimator uses weighted residual autocovariances:
\[ \hat{\omega}^{\,2}=\hat{\gamma}_0+2\sum_{j=1}^{\ell}w_j\hat{\gamma}_j. \]
Here, \(\hat{\gamma}_j=n^{-1}\sum_{t=j+1}^{n}\hat e_t\hat e_{t-j}\) defines the sample autocovariance at lag \(j\) with denominator \(n\); finite-sample conventions can differ across implementations.
With Bartlett weights, \(w_j=1-j/(\ell+1)\). The truncation bandwidth \(\ell\) decides how many residual autocovariances contribute and how quickly their weights fall. Implementations can use different kernels, bandwidth rules, and finite-sample conventions, so a reproducible result names them.
This bandwidth is not the number of lagged differences added to an ADF regression. In KPSS it controls the long-run variance estimate; in ADF, augmentation lags enter the regression itself. Software may label both settings with the word lag, so a bare value such as “lag 4” is not a reproducible description.
A bandwidth that is too short can leave meaningful short-run dependence out of the long-run variance estimate. A much longer one can add noisy sample autocovariances. Either choice can change the statistic and the test's size or power; there is no direction that applies to every observed residual pattern. Report the kernel and lag-selection rule, and check whether a reasonable prespecified alternative changes the interpretation.
This long-run variance adjustment is related to heteroskedasticity-and-autocorrelation-consistent covariance estimation. It does not make the KPSS test robust to every form of dependence, a structural break, or a bad deterministic specification. The Newey–West covariance guide covers the broader role and limits of HAC estimates.
Work through a small partial-sum calculation
Suppose a trend regression on six synthetic observations leaves residuals \(1,-1,0,0,-1,1\). They sum to zero and are orthogonal to a linear time trend, as fitted trend-regression residuals should be. Their partial sums are \(1,0,0,0,-1,0\), so the sum of squared partial sums is \(2\).
For an arithmetic illustration, use the denominator-\(n\) sample autocovariance convention and a Bartlett bandwidth of one. The residual variance term is \(\hat{\gamma}_0=4/6=2/3\). The lag-one autocovariance is \(\hat{\gamma}_1=-2/6=-1/3\), and its Bartlett weight is \(1/2\). Therefore
\[ \hat{\omega}^{\,2}=\frac{2}{3}+2\left(\frac{1}{2}\right)\left(-\frac{1}{3}\right)=\frac{1}{3}, \qquad \eta=\frac{2}{6^2(1/3)}=\frac{1}{6}\approx0.167. \]
This six-point calculation demonstrates the mechanics only. It is far too small to support the usual asymptotic KPSS decision, and its statistic must not be judged against a published critical value as if it were an empirical finding.
Pair KPSS with a unit-root-null test carefully
Running KPSS beside an ADF-type test can expose how much the conclusion depends on the null. Read the pair as evidence under two different models:
| ADF-type test | KPSS test | Careful reading |
|---|---|---|
| Rejects unit root | Does not reject stationarity | The results are compatible with stationarity around the chosen deterministic terms, but do not prove it |
| Does not reject unit root | Rejects stationarity | The evidence weighs against the selected stationary model and is consistent with persistent behavior, but does not prove a simple unit root |
| Does not reject | Does not reject | The sample may be inconclusive, including because both tests have limited power |
| Rejects | Rejects | Revisit breaks, deterministic terms, lag and bandwidth choices, and whether either test's maintained model is suitable |
The tests can use different lag corrections, deterministic specifications, samples, and finite-sample approximations. Align those choices where appropriate, record any unavoidable differences, and avoid turning the four cells into an automatic data-transformation rule. Neither non-rejection means the null is true.
Breaks and persistent alternatives can confuse the diagnosis
A one-time shift in the mean, a changing trend, or a variance break can make a stationary-within-regimes process look nonstationary over the full sample. Conversely, a root close to one can make finite data hard to distinguish from a unit root. Short samples, outliers, heavy tails, nonlinear adjustment, and fractional integration add further ways for the reference approximation to mislead.
Plot the level, the chosen deterministic fit, and the residuals before reporting the test. If a break is plausible, use a break-aware design whose null, break treatment, and critical values are stated. If multiple break dates or bandwidths were searched, disclose that selection; the smallest p-value from the search is not an untouched test result.
For a proposed pair or spread, KPSS does not test whether two assets are cointegrated. The Engle–Granger guide explains a residual-based cointegration procedure and its separate critical-value problem. The Johansen rank guide covers a system approach. A KPSS result on one price series cannot replace either analysis.
If you apply KPSS to residuals from an estimated hedge ratio, ARMA model, or chosen break date, those residuals come from an earlier fitting step. Parameter estimation and model selection can change the null distribution. The ordinary critical values should not be assumed valid for that whole pipeline; use a residual test calibrated for the fitted model or a bootstrap that repeats the estimation steps.
Report the setup and keep trading claims separate
State the variable and transformation, observation count, level or trend null, deterministic terms, long-run variance kernel, bandwidth rule, statistic, matching critical values or p-value, and significance level. Include a sensitivity check only if its alternatives were motivated and reported transparently; do not select the most marketable outcome after trying many windows and versions.
For market data, describe the sample dates, sampling frequency, session alignment, missing-value treatment, and whether the series is a price, return, residual, or spread. A failure to reject the KPSS null is not evidence that a spread will converge soon. Any mean-reversion strategy still needs a defined equilibrium, out-of-sample evaluation, live-safe signal timing, and realistic costs for spreads, funding, borrow, and execution.
A test on a log-price level asks a different question from a test on its return, which is a first difference of log price. Differencing can remove a stochastic trend under some models, but it also changes the variable being studied and does not establish a long-run relation between two assets. Choose the transformation from the estimand and model, then report it explicitly.
Kwiatkowski, Phillips, Schmidt, and Shin's 1992 paper90104-Y) formulates the test as an LM test of whether the random-walk component has zero variance. Newey and West's 1987 paper is a primary reference for positive-semidefinite HAC covariance estimation. For a unit-root-null comparison, see Dickey and Fuller's 1979 paper.
Common questions
Q1Does KPSS test the same null as ADF?
No. KPSS puts level or trend stationarity in the null. Standard ADF variants put a unit root in the null under their chosen deterministic terms.
Q2What do the level and trend versions mean?
The level version tests stationarity around a constant. The trend version first removes a deterministic linear trend and tests whether the remaining component is stationary.
Q3Why does bandwidth matter?
Bandwidth controls how many residual autocovariances enter the long-run variance estimate and how they are weighted. Different reasonable choices can change the statistic, so report the rule and avoid choosing it only for a preferred outcome.
Q4Does a non-significant result mean a spread is mean-reverting?
No. It says the selected stationarity null was not rejected by this sample and setup. It does not establish cointegration, a convergence horizon, or profitability after trading costs.
Sources and further reading
Report an issue
We’ll prepare an email with this article link. Mark receives the report only after you send it
Quick check
Read the guide? Check yourself with 3 questions
Question 01
What is the KPSS null hypothesis?
Choose an answer to see the explanation
Options glossary
A model-dependent tendency for a variable to move back toward a fixed or changing reference; it does not automatically imply stationarity or tradability.
Read the deeper guideHeteroskedasticityVariation in the conditional error variance across regressor values or states, invalidating an equal-variance covariance formula.
Read the deeper guide