Skip to content
All library documents

Using the Two-Sample Kolmogorov–Smirnov Test to Track Non-Stationarity

Article MQL5 articles

Summary

The article presents the two-sample Kolmogorov–Smirnov test as a distribution-free way to compare financial return samples from different periods. It explains the null hypothesis that both samples share a distribution, the maximum gap between their empirical cumulative distribution functions, and how the resulting statistic is assessed against a critical value or p-value. It also distinguishes the two-sample test from the one-sample version and stresses that the empirical distributions should use ungrouped observations.

The proposed use is to treat repeated test rejections as signs that a return series’ distribution has shifted, then adjust the rolling amount of data used for indicators: accumulate observations until homogeneity is rejected, discard the older window, and begin again. The article reports that minute data showed stronger non-stationarity than five-minute data, while noting that differing sample sizes partly explain the contrast. The available text omits much of the analysis, and the test’s interpretation as a stationarity indicator is limited: comparing two samples does not by itself establish full time-series stationarity, especially with dependent observations.

Key ideas

  • The test compares two empirical cumulative distribution functions using their largest absolute difference.
  • A rejection suggests the compared samples may come from different distributions, without specifying the form of either distribution.
  • The article proposes using rejection points to reset the data window used to calculate indicators.
  • Its reported comparison found more frequent distribution changes in minute data than in five-minute data, with sample size as a confounding factor.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.