KPSS Test Calculator

Check stationarity with KPSS using level or trend. Tune lags, view plots, compare critical values. Save your report and reuse inputs for audits later.

Enter your time series

Paste numbers separated by spaces, commas, or new lines.

Example: 1.2, 1.4, 1.5, 1.7
Use manual lags to run sensitivity checks.

Example data table

t y Notes
10.20Early observation
20.30Small increase
30.28Minor pullback
40.35Continues upward drift
50.40Potential trend behavior
You can paste these y-values into the input to test behavior.

Formula used

1) Fit a regression and compute residuals et:

  • Level: yt = a + et
  • Trend: yt = a + b·t + et

2) Form cumulative sums St = Σi=1..t ei.

3) Estimate long-run variance with Bartlett weights:

s² = γ0 + 2·Σk=1..L(1 − k/(L+1))·γk,   γk = (1/n)·Σt=k+1..n etet−k

4) KPSS statistic:

KPSS = (1/n²)·Σt=1..nSt² / s²

How to use this calculator

  1. Paste your series values, then choose Level or Trend.
  2. Select Automatic lags first, then rerun with manual lags.
  3. Pick a significance level to match your reporting standard.
  4. Press Submit to see results above this form.
  5. Use CSV or PDF downloads to keep an audit trail.

Why KPSS complements unit-root testing

In many workflows, unit-root tests set nonstationarity as the default. KPSS reverses that logic by treating stationarity as the null. Using both perspectives reduces false confidence when a series is near a boundary, short, or affected by structural changes. Analysts often pair KPSS with an ADF result to triangulate whether differencing is needed, or whether a deterministic trend is sufficient for modeling.

Interpreting the statistic and critical values

The calculator reports the KPSS statistic, the long-run variance estimate, and a decision summary across common significance levels. Larger statistics indicate stronger evidence against the stationarity null. For level stationarity, the 5% reference value is commonly 0.463, while for trend stationarity it is commonly 0.146. If the statistic exceeds the chosen threshold, the series is flagged as inconsistent with the assumed stationarity form.

Lag choice and long-run variance stability

KPSS relies on a Newey–West style long-run variance, built from residual autocovariances and Bartlett weights. Too few lags can understate persistence and inflate rejections; too many can add noise and reduce power. This tool offers automatic lag rules and a manual override so you can stress-test conclusions. A practical check is to rerun the test across several lags and confirm that decisions remain stable.

Data preparation and common pitfalls

Small samples, missing values, and outliers can distort residual sums and long-run variance. Before testing, keep units consistent, remove obvious entry errors, and consider winsorizing extreme spikes if they are measurement artifacts. If you select a trend specification, the tool first detrends via regression, then tests the residuals. If the underlying process has breaks, interpret outcomes cautiously and complement with visual inspection.

Reporting results for reproducible analysis

For documentation, store the regression type, sample size, lag rule, and the final statistic with the decision level. The included exports produce a compact audit trail that can be attached to reports or notebooks. When comparing multiple series, keep the lag method consistent to avoid mixing variance estimators. Finally, cite the exact thresholds used so reviewers can replicate decisions without ambiguity. In production pipelines, re-test monthly and alert when a once-stationary metric begins failing the same specification repeatedly suddenly again.

FAQs

What does the KPSS test measure?

KPSS evaluates whether a series is consistent with stationarity around a level or a deterministic trend. The null is stationarity, and large statistics suggest the residuals are too persistent to match that null.

Which regression option should I choose?

Choose Level when the series fluctuates around a stable mean. Choose Trend when the mean changes smoothly over time. If unsure, run both and report how conclusions differ across the two assumptions.

How does the lag setting affect results?

Lags control the long-run variance estimate by capturing residual autocorrelation. Automatic rules provide a starting point, while manual lags let you test sensitivity. Different lags can change the variance estimate and therefore the statistic.

Why can KPSS disagree with ADF or PP tests?

These tests reverse hypotheses. ADF or PP treat a unit root as the null, while KPSS treats stationarity as the null. Near-unit-root behavior, short samples, or breaks can make the tests point in different directions.

What data length works best?

Longer samples improve reliability because residual sums and autocovariances stabilize. With very small samples, results can be volatile and sensitive to lag choice. If you have fewer than about 30 observations, interpret decisions cautiously.

Can I export results for reporting?

Yes. After calculation, use the CSV or PDF buttons to download parameters, intermediate estimates, and the final decision summary. Keep exports with your dataset so colleagues can reproduce the same specification later.

Related Calculators

Moving Average CalculatorSeasonal Decomposition ToolTime Series Forecast ToolPartial Autocorrelation ToolStationarity Test ToolADF Test CalculatorHolt Winters ToolSeasonal Index CalculatorDifferencing CalculatorAnomaly Detection Tool

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.