# Edge Cases in RQA

During my Master’s Thesis (pdfblog entry), I experimented with quantifications of Recurrence Plots. I found that different software for Recurrence Quantification Analysis (RQA) treats lines that extend beyond the borders of the Recurrence Matrix in different ways. I propose a minor improvement to RQA, which distinguishes lines of known and unknown length.

There is a subtlety in the computation of the line length histograms. There might be lines of unknown length, because the endpoint is located outside the Recurrence Matrix. These lines are subsequently referred to as indefinite, and all others as definite. Following the popular and rigorous definition in [1], indefinite lines should be ignored. However, many programs which compute RQA measures count these lines. I think I have a sensible proposal for which option should be preferred.

The idea is to exclude indefinite lines from all RQA measures except Determinism (DET), Laminarity (LAM), and Recurrence Rate (RR). The reason is that DET and LAM count the number of Recurrence Points that are part of lines with a minimum length (to filter noise). Since we can lower bound the length of the indefinite lines by the length of the portion inside the recurrence matrix, it is safe to include indefinite lines into DET and LAM. Likewise, the Recurrence Points on indefinite can of course be included in the computation of RR, since RR is the fraction of the Recurrence Matrix occupied by Recurrence Points.

$$\text{RR} = \frac{1}{N^2} \sum_{l=1}^N l(P_L(l)+P_L^*(l))$$
$$\text{DET} = \frac{\sum_{l=l_\text{min}}^N l (P_L(l)+P_L^*(l))}{N^2 \, \text{RR}}$$
$$\text{LAM} = \frac{\sum_{l=l_\text{min}}^N l (P_V(l)+P_V^*(l))}{N^2 \, \text{RR}}$$

Where $$P_L(l)$$ and $$P_L^*(l)$$ are the numbers of definite and indefinite lines of length $$l$$.

For long time series, the number of Recurrence Points on indefinite lines is usually small. For short and periodical input data however, indefinite lines might cause a considerable bias of the measures. Depending on the application, the user might not be willing to discard line structures from a small RP. Whichever stance is taken, a strict separation between indefinite and definite lines is proposed for clarification.

[1] N. Marwan, M. Carmen Romano, M. Thiel, and J. Kurths, “Recurrence plots for the analysis of complex systems,” Physics Reports, vol. 438, no. 5, pp. 237–329, 2007.