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).
Parameters
Section titled “Parameters”(number[] | Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>)[]
Similarity matrix, shape (N, M), non-negative, N ≥ 2 and M ≥ 2.
options?
Section titled “options?”backtrack?
Section titled “backtrack?”boolean = true
also return the optimal path
gapExtend?
Section titled “gapExtend?”number = 1
penalty for extending a gap (must be ≥ 0)
gapOnset?
Section titled “gapOnset?”number = 1
penalty for introducing a gap (must be ≥ 0)
knightMoves?
Section titled “knightMoves?”boolean = true
allow (−1,−2)/(−2,−1) moves
Returns
Section titled “Returns”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).
optionalpath?:number[][]
score:
Float64Array<ArrayBufferLike>[]