Skip to content

rqa

rqa(sim, options?): object

Defined in: packages/pleco-xa/src/sequence/rqa.js:26

Recurrence quantification analysis (RQA).

Implements the methods of Serrà, Serra & Andrzejak (2009): dynamic programming over a self- or cross-similarity matrix, maximizing alignment value, with optional chess-knight moves and gap penalties.

Unlike DTW, alignment paths here are MAXIMIZED, so the input must measure similarity, not distance.

Validated against committed reference fixtures (exact path agreement + score max).

(number[] | Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>)[]

Similarity matrix, shape (N, M), non-negative, N ≥ 2 and M ≥ 2.

boolean = true

also return the optimal path

number = 1

penalty for extending a gap (must be ≥ 0)

number = 1

penalty for introducing a gap (must be ≥ 0)

boolean = true

allow (−1,−2)/(−2,−1) moves

object

score[n][m] is the cumulative value of the best alignment ending at (n, m). When backtrack is true, path is an array of [n, m] pairs (possibly empty when there is no positive alignment at all).

optional path?: number[][]

score: Float64Array<ArrayBufferLike>[]