Search arXiv⌕ Search

arXiv · 2604.08676

StationarityToolkit: Comprehensive Time Series Stationarity Analysis in Python

Abstract

Time-series stationarity is a property that statistical characteristics such as trend, variance, seasonality remain constant over time. It is considered fundamental to many forecasting and analysis methods. Different tests detect different types of non-stationarity: structural breaks or deterministic trends, clustered or time-dependent variance, stochastic or deterministic seasonality. A series might pass one test while failing another; single-test approaches seldom distinguish between conceptually different types of non-stationarity that require different types of tests and transformations. `StationarityToolkit` addresses this by providing a comprehensive Python library that runs 10 statistical tests across three categories: trend (4 tests), variance (4 tests), and seasonality (2 tests). Rather than a binary stationary/non-stationary verdict, users receive detailed diagnostics with actionable notes for each detection. The toolkit automatically infers the frequency of the data provided (requires datetime index), provides clear interpretations with test statistics and p-values, and supports an iterative test-transform-retest workflow essential for real-world data sets.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Bhanu Suraj Malla, Yuqing Hu. 2026-04-09. StationarityToolkit: Comprehensive Time Series Stationarity Analysis in Python. https://arxiv.org/abs/2604.08676

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Modeling cyclostationarity in time series using ASCA

Modern data analysis across diverse disciplines increasingly relies on time series. Many of these datasets exhibit cyclostationarity, where patterns approximately repeat in a regular manner, often across multiple time scales, such as daily, weekly or yearly cycles. In this context, statistical inference is essential to distinguish genuine underlying effects from random variability. While tools like Analysis of Variance (ANOVA) provide such inference, they often lack interpretability and struggle with the complexities of multivariate data. To address these limitations, we propose a unified pipeline for the exploratory analysis of cyclostationary times series using ANOVA Simultaneous Component Analysis (ASCA). ASCA is an extension of ANOVA that is able to work in both univariate and multivariate cases. Combining inference with the visualization capabilities of Principal Component Analysis (PCA), ASCA provides powerful options for interpretability. ASCA's capabilities have been well-established in the analysis of experimental data, but they remain largely unexplored for observational data like time series. Our workflow introduces an algorithmic approach to modeling time-dependent data using ASCA, enabling control over multiple cyclostationary time scales while also accounting for the specific challenges of this type of data, such as autocorrelation. Furthermore, we observed that ASCA provides a better separation of variability across factors than ANOVA in unbalanced designs due to its multivariate nature. We demonstrate the efficacy of this methodology through two real-world case studies: water temperature trends in mountain lakes in Sierra Nevada, Spain, and airborne pollen trends over 30 years recorded in the city of Granada, Spain.

stat.ME↗

Distributionally balanced sampling designs via tactical configurations

Distributionally balanced sampling designs are low-discrepancy probability designs obtained by minimizing the expected discrepancy between the auxiliary-variable distribution of a random sample and the target population distribution. Existing constructions rely on circular population sequences, which restrict the design space by forcing samples to be contiguous blocks of a sequence. We propose a new construction based on tactical configurations that removes this topological constraint. The resulting designs are fixed-size and have equal inclusion probabilities. We develop both a simple initialization valid for arbitrary population and sample sizes and a spatial initialization that yields a lower initial expected discrepancy, together with a simulated annealing algorithm for optimization within this class. In simulations and empirical examples, the proposed method outperforms state-of-the-art alternatives in terms of distributional fit and balance.

stat.ME↗

Bayesian Quantile Regression for Misclassified Binary Data with an Application to Spousal Violence Reporting

Survey responses on socially undesirable behaviors, such as self-reported spousal violence, are often subject to underreporting due to social stigma, fear of retaliation, and other reporting pressures. When such data are analyzed using standard econometric models that focus on conditional means, such as probit and logit models, the resulting estimates are likely to be biased and can obscure heterogeneity in covariate effects. To address these challenges, we propose a Bayesian binary quantile regression framework that accounts for misclassification and provides quantile-specific effects for the latent true response. The framework incorporates false-negative and false-positive probabilities to capture reporting errors and employs a novel partially collapsed Gibbs sampler for estimation. We also discuss the computation of covariate effects and marginal likelihood for Bayesian model comparison. Simulation studies under various settings (prior effective sample size, misclassification rates, and prior distribution) show that accounting for misclassification improves inference across quantiles relative to models that ignore reporting errors. We apply the framework to women's self-reported spousal violence and find that underreporting of spousal violence exceeds overreporting across quantiles, while model comparisons using marginal likelihood generally favor the quantile model with misclassification and yield different conclusions about the determinants of reported violence.

stat.ME↗