# Recurrence plot

In descriptive statistics and chaos theory, a recurrence plot (RP) is a plot showing, for each moment $j$ in time, the times at which the state of a dynamical system returns to the previous state at $i$, i.e., when the phase space trajectory visits roughly the same area in the phase space as at time $j$. In other words, it is a plot of
    ${\vec {x}}(i)\approx {\vec {x}}(j),$
showing $i$ on a horizontal axis and $j$ on a vertical axis, where ${\vec {x}}$ is the state of the system (or its phase space trajectory).

## Background

Natural processes can have a distinct recurrent behaviour, e.g. periodicities (as seasonal or Milankovich cycles), but also irregular cyclicities (as El Niño Southern Oscillation, heart beat intervals). Moreover, the recurrence of states, in the meaning that states are again arbitrarily close after some time of divergence, is a fundamental property of deterministic dynamical systems and is typical for nonlinear or chaotic systems (cf. Poincaré recurrence theorem). The recurrence of states in nature has been known for a long time and has also been discussed in early work (e.g. Henri Poincaré 1890).

## Detailed description

One way to visualize the recurring nature of states by their trajectory through a phase space is the recurrence plot, introduced by Eckmann et al. (1987). Often, the phase space does not have a low enough dimension (two or three) to be pictured, since higher-dimensional phase spaces can only be visualized by projection into the two or three-dimensional sub-spaces. One frequently used tool to study the behaviour of such phase space trajectories is then the Poincaré map. Another tool, is the recurrence plot, which enables us to investigate many aspects of the m-dimensional phase space trajectory through a two-dimensional representation.
At a recurrence the trajectory returns to a location (state) in phase space it has visited before up to a small error $\varepsilon$ . The recurrence plot represents the collection of pairs of times of such recurrences, i.e., the set of $(i,j)$ with ${\vec {x}}(i)\approx {\vec {x}}(j)$, with $i$ and $j$ discrete points of time and ${\vec {x}}(i)$ the state of the system at time $i$ (location of the trajectory at time $i$). Mathematically, this is expressed by the binary recurrence matrix
    $R(i,j)={\begin{cases}1&{\text{if}}\quad \|{\vec {x}}(i)-{\vec {x}}(j)\|\leq \varepsilon \\0&{\text{otherwise}},\end{cases}}$
where $\|\cdot \|$ is a norm and $\varepsilon$ the recurrence threshold. An alternative, more formal expression is using the Heaviside step function $R(i,j)=\Theta (\varepsilon -D_{i,j})$ with $D_{i,j}=\|{\vec {x}}(i)-{\vec {x}}(j)\|$ the norm of distance vector between ${\vec {x}}(i)$ and ${\vec {x}}(j)$. Alternative recurrence definitions consider different distances $D_{i,j}$, e.g., angular distance, fuzzy distance, or .
The recurrence plot visualises $\mathbf {R}$ with coloured (mostly black) dot at coordinates $(i,j)$ if $R(i,j)=1$, with time at the $x$- and $y$-axes.
If only a univariate time series $u(t)$ is available, the phase space can be reconstructed, e.g., by using a time delay embedding (see Takens' theorem):
    ${\vec {x}}(i)=(u(i),u(i+\tau ),\ldots ,u(i+\tau (m-1)),$
where $u(i)$ is the time series (with $t=i\Delta t$ and $\Delta t$ the sampling time), $m$ the embedding dimension and $\tau$ the time delay. However, phase space reconstruction is not essential part of the recurrence plot (although often stated in literature), because it is based on phase space trajectories which could be derived from the system's variables directly (e.g., from the three variables of the Lorenz system) or from multivariate data.
The visual appearance of a recurrence plot gives hints about the dynamics of the system. Caused by characteristic behaviour of the phase space trajectory, a recurrence plot contains typical small-scale structures, as single dots, diagonal lines and vertical/horizontal lines (or a mixture of the latter, which combines to extended clusters). The large-scale structure, also called texture, can be visually characterised by homogenous, periodic, drift or disrupted. For example, the plot can show if the trajectory is strictly periodic with period $T$, then all such pairs of times will be separated by a multiple of $T$ and visible as diagonal lines.
The small-scale structures in recurrence plots contain information about certain characteristics of the dynamics of the underlying system. For example, the length of the diagonal lines visible in the recurrence plot are related to the divergence of phase space trajectories, thus, can represent information about the chaoticity. Therefore, the recurrence quantification analysis quantifies the distribution of these small-scale structures. This quantification can be used to describe the recurrence plots in a quantitative way. Applications are classification, predictions, nonlinear parameter estimation, and transition analysis. In contrast to the heuristic approach of the recurrence quantification analysis, which depends on the choice of the embedding parameters, some dynamical invariants as correlation dimension, K2 entropy or mutual information, which are independent on the embedding, can also be derived from recurrence plots. The base for these dynamical invariants are the recurrence rate and the distribution of the lengths of the diagonal lines. More recent applications use recurrence plots as a tool for time series imaging in machine learning approaches and studying spatio-temporal recurrences.
Close returns plots are similar to recurrence plots. The difference is that the relative time between recurrences is used for the $y$-axis (instead of absolute time).
The main advantage of recurrence plots is that they provide useful information even for short and non-stationary data, where other methods fail.

## Extensions

Multivariate extensions of recurrence plots were developed as cross recurrence plots and joint recurrence plots.
Cross recurrence plots consider the phase space trajectories of two different systems in the same phase space:
    $\mathbf {CR} (i,j)=\Theta (\varepsilon -\|{\vec {x}}(i)-{\vec {y}}(j)\|),\quad {\vec {x}}(i),\,{\vec {y}}(i)\in \mathbb {R} ^{m},\quad i=1,\dots ,N_{x},\ j=1,\dots ,N_{y}.$
The dimension of both systems must be the same, but the number of considered states (i.e. data length) can be different. Cross recurrence plots compare the occurrences of similar states of two systems. They can be used in order to analyse the similarity of the dynamical evolution between two different systems, to look for similar matching patterns in two systems, or to study the time-relationship of two similar systems, whose time-scale differ.
Joint recurrence plots are the Hadamard product of the recurrence plots of the considered sub-systems, e.g. for two systems ${\vec {x}}$ and ${\vec {y}}$ the joint recurrence plot is
    $\mathbf {JR} (i,j)=\Theta (\varepsilon _{x}-\|{\vec {x}}(i)-{\vec {x}}(j)\|)\cdot \Theta (\varepsilon _{y}-\|{\vec {y}}(i)-{\vec {y}}(j)\|),\quad {\vec {x}}(i)\in \mathbb {R} ^{m},\quad {\vec {y}}(i)\in \mathbb {R} ^{n},\quad i,j=1,\dots ,N_{x,y}.$
In contrast to cross recurrence plots, joint recurrence plots compare the simultaneous occurrence of recurrences in two (or more) systems. Moreover, the dimension of the considered phase spaces can be different, but the number of the considered states has to be the same for all the sub-systems. Joint recurrence plots can be used in order to detect phase synchronisation.