ts-stat-tests


Time Series Statistical Tests.

- https://github.com/chrimaho/ts-stat-tests/
- https://pypi.org/project/ts-stat-tests/

Time Series Statistical Tests

ts-stat-tests

PyPI version Python OS
Build Tests MyPy Tests Unit Tests codecov
Deploy Docs Publish Package CodeQL
License Downloads Code Style
Contributions

Motivation

Time Series Analysis has been around for a long time, especially for doing Statistical Testing. Some Python packages are going a long way to make this even easier than it has ever been before. Such as sktime and pycaret and pmdarima and statsmodels.

There are some typical Statistical Tests which are accessible in these Python (QS, Normality, Stability, etc). However, there are still some statistical tests which are not yet ported over to Python, but which have been written in R and are quite stable.

Moreover, there is no one single library package for doing time-series statistical tests in Python.

That’s exactly what this package aims to achieve.

A single package for doing all the standard time-series statistical tests.

Tests

Full credit goes to the packages listed in this table.

TypeNameSource PackageSource LanguageImplemented
CorrelationAuto-Correlation function (ACF)statsmodelsPython
CorrelationPartial Auto-Correlation function (PACF)statsmodelsPython
CorrelationCross-Correlation function (CCF)statsmodelsPython
CorrelationLjung-Box test of autocorrelation in residuals (LB)statsmodelsPython
CorrelationLagrange Multiplier tests for autocorrelation (LM)statsmodelsPython
CorrelationBreusch-Godfrey Lagrange Multiplier tests for residual autocorrelation (BGLM)statsmodelsPython
RegularityApproximate Entropyantropypython
RegularitySample Entropyantropypython
RegularityPermutation Entropyantropypython
RegularitySpectral Entropyantropypython
SeasonalityQSseastestsR
SeasonalityOsborn-Chui-Smith-Birchenhall test of seasonality (OCSB)pmdarimaPython
SeasonalityCanova-Hansen test for seasonal differences (CH)pmdarimaPython
SeasonalitySeasonal StrengthtsfeaturesPython
SeasonalityTrend StrengthtsfeaturesPython
SeasonalitySpikinesstsfeaturesPython
StabilityStabilitytsfeaturesPython
StabilityLumpinesstsfeaturesPython
StationarityAugmented Dickey-Fuller test for stationarity (ADF)statsmodelsPython
StationarityKwiatkowski-Phillips-Schmidt-Shin test for stationarity (KPSS)statsmodelsPython
StationarityRange unit-root test for stationarity (RUR)statsmodelsPython
StationarityZivot-Andrews structural-break unit-root test (ZA)statsmodelsPython
StationarityPhillips-Peron test for stationarity (PP)pmdarimaPython
StationarityElliott-Rothenberg-Stock (ERS) de-trended Dickey-Fuller testarchPython
StationarityVariance Ratio (VR) test for a random walkarchPython
NormalityJarque-Bera test of normality (JB)statsmodelsPython🔲
NormalityOmnibus test for normality (OB)statsmodelsPython🔲
NormalityShapiro-Wilk test for normality (SW)scipyPython🔲
NormalityD’Agostino & Pearson’s test for normalityscipyPython🔲
NormalityAnderson-Darling test for normalityscipyPython🔲
LinearityHarvey Collier test for linearity (HC)statsmodelsPython🔲
LinearityLagrange Multiplier test for linearity (LM)statsmodelsPython🔲
LinearityRainbow test for linearity (RB)statsmodelsPython🔲
LinearityRamsey’s RESET test for neglected nonlinearity (RR)statsmodelsPython🔲
HeteroscedasticityEngle’s Test for Autoregressive Conditional Heteroscedasticity (ARCH)statsmodelsPython🔲
HeteroscedasticityBreusch-Pagan Lagrange Multiplier test for heteroscedasticity (BPL)statsmodelsPython🔲
HeteroscedasticityGoldfeld-Quandt test for homoskedasticity (GQ)statsmodelsPython🔲
HeteroscedasticityWhite’s Lagrange Multiplier Test for Heteroscedasticity (WLM)statsmodelsPython🔲

Known limitations

  • These listed tests is not exhaustive, and there is probably some more that could be added. Therefore, we encourage you to raise issues or pull requests to add more statistical tests to this suite.
  • This package does not re-invent any of these tests. It merely calls the underlying packages, and calls the functions which are already written elsewhere.