StatsOrdinalPatterns.jl
  • Ordinal Patterns
  • Spatial Ordinal Patterns
  • Generalized Ordinal Patterns
  • API
  • ComplexityMeasures.jl API

Distribution-free tests for serial and spatial dependence, built on ordinal patterns.

Ordinal patterns replace the values of a data set by the rank order within small windows. The resulting frequencies say a great deal about the dependence structure while staying invariant under monotone transformations and robust to outliers. This package turns that idea into fast tests and control charts for time series, count data and spatial grids.

Get started View on GitHub

StatsOrdinalPatterns.jl logo

What the package covers

Three pattern families, each with descriptive statistics, hypothesis tests and sequential monitoring.

Ordinal Patterns

Serial dependence in continuous time series. Seven chart statistics, asymptotic and bootstrap inference, and EWMA control charts.

Generalized Ordinal Patterns

Discrete and rounded data where ties occur. Cayley permutations keep the ties intact instead of breaking them artificially.

Spatial Ordinal Patterns

Dependence on gridded data, read off the rank order inside small neighbourhoods such as a 2×2 block.

Reproducible papers

A growing set of published studies, replicated from source and re-executed every time the site is built. Weiß (2022) and Weiß and Testik (2023) are available now.

A test in five lines

Simulate an AR(1) series and ask whether its ordinal pattern frequencies are consistent with white noise.

using StatsOrdinalPatterns, Random

Random.seed!(1)
x = zeros(500)
for t in 2:500
    x[t] = 0.5 * x[t-1] + randn()
end

test_op(x; chart_choice=Persistence())
OPTestResult
  Chart:            Persistence()
  Statistic:        0.0663
  ─────────────────────────────
  Asymptotic test
    Critical value: 0.037
    p-value:        0.0005
    Reject H₀:      true

The result object carries the statistic, the critical value, the p-value and the decision. Swapping test_op for test_op_bootstrap replaces the asymptotic critical value by a bootstrap one and lifts the restriction to pattern lengths m = 2 and m = 3.

Installation

The package is not registered yet, so install it directly from GitHub.

using Pkg
Pkg.add(url = "https://github.com/AdaemmerP/StatsOrdinalPatterns.jl")

Where to go next

Work through a tutorial, or look up a function in the reference.

Time series tutorial Spatial tutorial API reference

 

Website generated with Quarto and QuartoDocBuilder.jl