# Conditional Recurrence Time

During my Master’s Thesis (pdf), I experimented with quantifications of Recurrence Plots. One of my ideas, which seems promising but is still immature, is the Conditional Recurrence Time (CRT) plot. It counts the lengths of pairs of white lines in a Recurrence Plot to characterize unstable periodic orbits (UPOs). This results in compact representations and new Recurrence Quantification Analysis (RQA) measures that allow classification of system dynamics.

### Counting Pairs of White Vertical Lines

In my experiments with clustering Recurrence Plots, I found features that are based on Recurrence Time (e.g. the entropy of the white vertical line lengths) very useful and robust with respect to observational noise. Inspired by a computer vision approach I had seen years before, I wondered if we could gain additional and more robust information by considering pairs of white vertical lines. Instead of counting the number $$P(l)$$ of lines of length $$l$$, I started counting the number $$P(l_2 \mid l_1)$$ of lines of length $$l_2$$ that were preceded by a line of length $$l_1$$. Hence the name Conditional Recurrence Time (we estimate, by counting, the probability of finding a line of length $$l_2$$, given that the previous line had length $$l_1$$). The principle is shown in the below Figure.

### Unstable Periodic Orbits

Besides adding robustness, the motivation behind counting pairs of lines is that Unstable Periodic Orbits (UPOs) are an important aspect of nonlinear dynamics. In [1], it is stated that “The localisation and quantification of unstable periodic orbits (UPOs) in chaotic attractors is very important as an orbit on a chaotic attractor is the closure of the set of UPOs which build the skeleton of the attractor.” Counting pairs of lines leads to peaks in the CRT histogram in the presence of UPOs. Counting single lines will also respond to the presence of UPOs, but the main diagonal of the CRT histogram won’t respond to all the other clutter in the plot. Furthermore, counting pairs increases the robustness with respect to noise, as explained below.

In the above Recurrence Plot, an UPO results in a region of evenly spaced diagonals. This will result in a large number of equal length line pairs. The Recurrence Plot shows three UPOs with periods of roughly 70, 140 and 210, respectively. These UPOs correspond to the peaks on the “main diagonal” of the CRT histogram.
A nice property is that binning is not necessary, as the line lengths are already discrete. However, trimming the histogram to a maximum line length is useful, because rare combinations of line lengths strongly increase the limits of the histogram. In general, log-transforming the histogram was found to be convenient for visualization, because the bin counts can vary by several orders of magnitude. The displayed values are $$\log_{10}(P(l_2 \mid l_1)+1)$$.

### CRT Plots for Rössler and Lorenz Systems

The CRT Plots of time series from different dynamical systems, such as the Lorenz and Rössler systems, showed very distinctive patterns, which motivated me to further evaluate CRT plots as a means to distinguish different dynamics.

For long (30k observations) time series from the Lorenz System, I also observed interesting small-scale structures. While in the Rössler System, the mass in the histogram was seemingly concentrated around simple peaks, these peaks exposed interesting structure for the Lorenz System.

### Quantification of CRT Plots

Since I was working on clustering Recurrence Plots, I was interested in a simple way to compare these histograms. In the style of RQA measures (which summarize the unconditional line length histograms), I defined some simple features, such as the weighted mean $$C_\text{mean}$$ of all pairs and the most frequent pair $$C_\text{mode}$$. Dr. Marwan proposed to try Lacunarity as an additional approach to describing the histograms.

\begin{aligned}
C_\text{mean} &= \frac{1}{\sum P } \sum_{l_1 = 1}^N \sum_{l_2 = 1}^N P(l_2 \mid l_1) \begin{pmatrix}l_1\\l_2\end{pmatrix} \\
C_\text{mode} &= \begin{pmatrix} l_1^* \\ l_2^* \end{pmatrix} = \text{argmax}_{l_1^*,l_2^*} P(l_2^* \mid l_1^*) \\
C_\text{entr} &= -\sum_{l_1, l_2}^N P(l_2 \mid l_1) \ln P(l_2 \mid l_1) \\
C_\text{lm} &= |\{ (l_1, l_2) \mid P(l_2 \mid l_1) > P(l_2 + i \mid l_1 + j) \text{ for } -5 \le i,j \le 5 \text{ and } \neg(i=0=j)\}|
\end{aligned}

The number $$C_\text{lm}$$ of local maxima, which is here defined in an overly simplistic and inflexible way, still turned out to be a good feature. It was intended to capture the degree to which the histogram is concentrated around individual peaks. All of these measures were designed in a rush (since I was approaching the end of my thesis) but nevertheless show some promising results. When describing Recurrence Plots of different systems using only the entropy and local maxima features, a good separation of different dynamics can be obtained. (For a description of the underlying data set, please refer to the pdf of my Master’s Thesis.)

### Benefits and Demonstration

Counting pairs of lines helps to reduce the impact of observational noise. If one or both of the lines in a pair are randomly disturbed by noise, the combination of the lengths is expected to be rare. This leads to small distortions all over the histogram, whereas the undisturbed pairs will still concentrate around the true structures and are expected to outvote the noisy ones.

I built a program for computing RQA measures and CRT plots. The below video is captured from the GUI. It gives an impression of how the CRT plot behaves when a) changing the recurrence threshold and b) adding observational noise. I think the plot is remarkably robust to observational noise.
Note also that the interesting information in this example is located in the first 200×200 bins of the histogram, regardless of how much additional observations from the Rössler time series we consider. The CRT Plot thus might be used as a summary of the Recurrence Plot.

Impact on an CRT plot of changing the recurrence threshold and adding observational noise.

### Summary

CRT plots seem to provide a compact signature for different nonlinear behaviors. They are robust with respect to noise and exhibit interesting large- and small-scale structures, probably related to Unstable Periodic Orbits and transitions between them. Ad-hoc quantification in the style of RQA measures gives promising results, although the proper interpretation of the plots is still unclear.

### References

[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.

### Software

Source code for the java implementation (including GUI) is available in my Github repository.