Skip to main content

a highly specific test for periodicity of time series based on folding

Project description

Quick and dirty introduction to usage

For an extensive description and explanation, see [arXiv:1506.01287](

Very briefly, this test decides whether a given time series can be interpolated by a periodic function with the same number of local extrema as the time series, where only local extrema with a prominence higher than a given error allowance σ are taken into account. The method also returns the period length. It is not intended for experimental but for simulated data.

The method has two parameters that can be chosen straightforwardly:

  • The maximum allowed period length τ<sub>max</sub>: Choose this parameter reasonably low to limit the runtime and to avoid period lengths that are close to the length of the time series. Unless you know what you are doing, τ<sub>max</sub> should at least be half the length of the time series.
  • The error allowance σ: Choose this parameter to correspond to the maximum expected absolute numerical error of your simulation, e.g., the maximum absolute integration error of an adaptive integrator.

Instructions for building

The following describes how to use this source depending on how you want to use it:

A. As a Python module

Build and install the module by running (for example)

`sh python3 install --user `

This generates a Python module called periodicitytest, which contains one function called periodicitytest. It can be loaded, e.g., as follows:

`python from periodicitytest import periodicitytest `

For further documentation, see periodicitytest’s docstring.

B. As a standalone program

Build the program by running

`sh python3 `


`sh python3 test `

if you want to run the tests.

This generates an executable called periodicitytest in the folder bin. It takes the maximum period length τ<sub>max</sub> and the error allowance σ as an argument. The time series is read from STDIN.

Take a look at standalone.c if you want to modify input and output.

C. As a C library

The central function is contained and documented in search.h. For input and output it requires simple datatypes defined in basics_standalone.h and interval.h. It needs to compiled with -DSTANDALONE. Several costly assertions can be avoided by compiling with -DNDEBUG.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for periodicitytest, version 0.0.0
Filename, size File type Python version Upload date Hashes
Filename, size periodicitytest-0.0.0.tar.gz (17.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page