Skip to content

labepi/ordinalpatterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ordinalPatterns

Ordinal Patterns Transformations

This is the repository for the R package ordinalPatterns, which provides functions for the Ordinal Patterns Transformations, a symbolic representation of time series, originally proposed by Bandt and Pompe (2002, doi:10.1103/PhysRevLett.88.174102), that is able to capture the underlying time series dynamics.

This package provides efficient functions, through implementations in C++ with the Rcpp package, for the main time series transformation and their derived transformations: the Ordinal Patterns Probability Distribution, discussed in Rosso et al (2007, doi:10.1103/PhysRevLett.99.154102) and the Ordinal Patterns Transition Graph, detailed in Borges et al. (2019, doi:10.1016/j.amc.2019.06.068). Functions for extracting information theory measures from these transformations and for their visualization are also proposed.

In this new version, the ordinalpatterns package enables parallel execution via OpenMP threads. The parallel implementation was added to the "op" function in C++ to parallelize the OP computation. To perform the execution with parallel threads, it only needs the inclusion of the parameter threads=N, where N is the number of threads to execute in parallel. The default value for N is 1.

Dependencies

This package depends on the OpenMP multi-procrssing API.

The GCC compiler already supports OpenMP since version 4.2.

However, for compiling with the Clang compiler, it may be necessary to install the OpenMP support.

For Linux/Debian users:

sudo apt-get install libomp-dev

For Mac users:

brew install libomp

Installation

This package can be installed with devtools:

library(devtools)
devtools::install_github("labepi/ordinalpatterns")

Otherwise, for a cleaner installation, this package can be installed with remotes:

library(remotes)
remotes::install_github("labepi/ordinalpatterns")

How to use

# generating a synthetic time series
x <- rnorm(1000)

# computing the Ordinal Patterns Probability Distribution
xpd <- op_pd(x, D = 3, tau = 1, threads=2)

# computing information theoretic metrics
# Shannon's permutation entropy
permutation_entropy(xpd$probabilities)
statistical_complexity(xpd$probabilities)
fisher_information(xpd$probabilities)

About

R Package for the Ordinal Patterns Transformations

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors