Kernel Two-Sample and Independence Tests for Non-Stationary Random\n Processes

Felix Laumann, Julius von Kügelgen, Mauricio Barahona · DOI

Abstract

Two-sample and independence tests with the kernel-based MMD and HSIC have shown remarkable results on i.i.d. data and stationary random processes. However, these statistics are not directly applicable to non-stationary random processes, a prevalent form of data in many scientific disciplines. In this work, we extend the application of MMD and HSIC to non-stationary settings by assuming access to independent realisations of the underlying random process. These realisations - in the form of non-stationary time-series measured on the same temporal grid - can then be viewed as i.i.d. samples from a multivariate probability distribution, to which MMD and HSIC can be applied. We further show how to choose suitable kernels over these high-dimensional spaces by maximising the estimated test power with respect to the kernel hyper-parameters. In experiments on synthetic data, we demonstrate superior performance of our proposed approaches in terms of test power when compared to current state-of-the-art functional or multivariate two-sample and independence tests. Finally, we employ our methods on a real socio-economic dataset as an example application.

Introduction

In fields such as epidemiology, economics, and climate science, data often arrives as non-stationary time series, where statistical properties like mean or variance change over time. Traditional statistical tests for comparing groups (two-sample tests) or checking relationships (independence tests) typically assume data is independent and identically distributed (i.i.d.) or stationary. Standard workarounds, such as differencing or power transformations, are often cumbersome and struggle with complex non-linearities. This paper addresses the challenge of performing these tests directly on raw, non-stationary processes by treating independent realizations as high-dimensional samples.

Methodology

The proposed approach shifts the perspective on time-series data through three key steps:

  1. High-Dimensional Mapping: A single realization of a random process measured over a fixed temporal grid is treated as one sample from a high-dimensional multivariate distribution.
  2. Kernel Embedding: Distributions are embedded into Reproducing Kernel Hilbert Spaces (RKHS). The Maximum Mean Discrepancy (MMD) is used for two-sample testing, while the Hilbert-Schmidt Independence Criterion (HSIC) is used for independence testing.
  3. Power Maximization: Test power is optimized by splitting data into training and test sets to find kernel hyperparameters (e.g., Gaussian bandwidth $\sigma$) that maximize the test statistic relative to its variance.

Experimental Results

The methods were evaluated on synthetic non-stationary processes and real-world socio-economic data. In synthetic tests, the MMD-based approach significantly outperformed state-of-the-art functional data analysis methods, such as Pomann et al. (2016).

Comparison of MMD-based two-sample test against Pomann et al. (2016) for mean and variance shifts across different sample sizes.

As shown in the figure above, the proposed baseline method achieves higher rejection rates of the null hypothesis ($H_0$) for both mean and variance shifts as the sample size ($m, n$) increases, consistently exceeding the performance of existing benchmarks.

Furthermore, the researchers demonstrated that explicit optimization of kernel hyperparameters through test power maximization significantly boosts the ability to detect subtle shifts in the process.

Impact of test power maximization on MMD performance for mean and variance shifts.

This optimization is particularly effective for mean shifts, where the maximized test power (dotted lines) reaches 100% rejection much faster than the baseline or competing methods. While hyperparameter optimization helped for mean shifts, it didn't consistently improve results for variance shifts, suggesting areas for future refinement.

Discussion and Conclusion

A key insight of this work is that while a single time series is internally dependent, multiple independent realizations can be treated as i.i.d. samples in high-dimensional space. The results indicate that the number of independent realizations ($m, n$) is more critical for test power than the density of temporal measurements ($T$).

When applied to UN Sustainable Development Goal (SDG) data, the tests revealed that only 38 of 76 targets showed homogeneous trajectories between high- and low-income countries over the last 20 years. It also successfully identified specific dependencies, such as the link between social protection systems and informal employment.

In conclusion, this framework provides a flexible, non-parametric approach to testing non-stationary processes without requiring restrictive stationarity assumptions, provided that multiple independent realizations of the process are available.

Summary updated

BibTeX
@misc{laumann2020kernel,
  author = {Felix Laumann and Julius von Kügelgen and Mauricio Barahona},
  title = {{Kernel Two-Sample and Independence Tests for Non-Stationary Random\textbackslash\{\}n Processes}},
  year = {2020},
  eprint = {2010.00271},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2010.00271},
}
Figure