Skip to content

pucicu/RP_Speed_Test

Repository files navigation

Comparison of calculation speed for recurrence plots/ recurrence quantification analysis for MATLAB, R, Python, and Julia

SWH file size GitHub Release

General

Measuring the calculation time for creating a recurrence plot (RP) and calculation of the standard recurrence quantification measures for the Rössler system with the standard parameters (a = 0.25, b = 0.25, and c = 4) and a sampling time of Δt = 0.05. The RPs were calculated using Euclidean norm and a threshold of ε = 1.2. Selected RQA measures are calculated and compared for the used tools.

Only the x-component of the Rössler system is used, after removing the first 1,000 points as transients. A simple time delay embedding with m = 3 and τ = 6 is applied. The RP and RQA calculations are implemented for MATLAB, R, Julia, Python, and a C++-based tool using the following packages/ tools

Software Package/ URL
MATLAB simple rp.m v1.2 code https://github.com/pucicu/rp
MATLAB CRP Toolbox v5.26(R36) code https://tocsy.pik-potsdam.de/CRPtoolbox
R crqa v2.0.2 https://github.com/morenococo/crqa
Julia DynamicalSystems.jl v1.4.0 https://juliadynamics.github.io/DynamicalSystems.jl/dev/
Julia RecurrenceMicrostatesAnalysis.jl 0.2.24 https://github.com/DynamicsUFPR/RecurrenceMicrostatesAnalysis.jl
Julia RQA_Samp https://github.com/pucicu/RQA_Samp
Python simple RP and RQA implementation (included)
Python pyunicorn v0.6.1 https://pypi.org/project/pyunicorn/
Python PyRQA v8.0.0 https://pypi.org/project/PyRQA/
Python AccRQA v0.9.1 https://pypi.org/project/accrqa/
C++ RQA_OpenMP v1.414 https://github.com/pucicu/RQA_OpenMP

Requirements

Software Requirements
MATLAB install the code from https://github.com/pucicu/rp as a subfolder rp
MATLAB install the code from https://tocsy.pik-potsdam.de/CRPtoolbox by calling the installer file install from the MATLAB commandline
R packages nonlinearTseries, crqa, abind, tictoc
Julia packages OrdinaryDiffEq, DelayEmbeddings, DynamicalSystems, DelimitedFiles, RecurrenceMicrostatesAnalysis, and RQA_Samp
Python packages PyRQA, pyunicorn, accrqa, numpy, scipy
OpenMP download the code from https://github.com/pucicu/RQA_OpenMP to a subfolder Libs and compile it as specified in the README.md

For Python, see file requirements.txt (you can use pip install -r requirements.txt to get the required Python packages).

Procedure

The recurrence analysis is performed on the time series obtained from the Rössler system with growing length, starting with N = 200 (ending at max. N = 500,000), increasing in steps to provide equidistant points along the x-axis in a log-log plot. The increase of length will be stopped when the calculation time exceeds 600 sec. For each selected length, the calculation time is measured 10 times and then averaged.

Not all RQA measures are available across all implementations (e.g., in simple Python code or in RQA_Samp). Network measure calculations were disabled in all examples.

The calculation time is measured for:

  • Recurrence Plot (RP) computation (where applicable), and
  • Recurrence Quantification Analysis (RQA).

Note: If RQA calculations require a precomputed RP, the RQA time includes the RP calculation time.

For calculations using the different implementations, individual scripts are available. These scripts can be executed in batch via the shell script run_software_test.sh.

For high-performance computing (HPC), SLURM scripts are provided. To enable HPC submission, set the flag SUBMIT_HPC=1 in the script run_software_test.sh.

Results

The results presented here were primarily computed on a single node of the "Foote" high-performance cluster at PIK. Each node is equipped with:

  • 1 × AMD EPYC 9554 Genoa processor (64 cores @ 3.1 GHz),
  • 768 GB RAM.

For GPU-based calculations (using the AccRQA and PyRQA packages), we utilised:

  • NVIDIA H100 HBM3 (80 GB, OpenCL 3.0, CUDA).

MPI-based calculations for AccRQA were executed across 128 compute nodes.

Recurrence plots (RPs) cannot be calculated using RQA_OpenMP, RQA_Samp, and RecurrenceMicrostates. Therefore, RP calculation times are not available for these implementations.

Computation speed for recurrence plots and recurrence quantification measures for the Rössler system.

Relative deviations in selected RQA measures for the Rössler system.

Copyright

Norbert Marwan
Potsdam Institute for Climate Impact Research
3/2026

License: GPLv3+

About

Code to get the calculation speed for recurrence plots/ recurrence quantification analysis using MATLAB, R, Python, and Julia code.

Topics

Resources

License

Stars

Watchers

Forks

Contributors