Keywords

1 Motivation

The need to quantify relevant features of time series is present in any discipline. Economics is not an exception as in other fields of investigation dealing with complex systems, has a twofold consideration of the ontological nature of time-dependent signals. On one side they are considered as the expression of a ‘hidden’ dynamical system obeying some (largely unknown) constitutive laws which the investigator tries to observe from time series features (this is the approach technologists call ‘reverse engineering’); on the other side, a time series is nothing else than a trajectory of a system observed within a temporal frame in which the system itself reacts to contingent events happening in time. The difference between the two aspects is as different as a physical essay on thermal conduction (the problem at the basis of Fourier spectral analysis) and the Robinson Crusoe novel where the plot evolves based on the interaction between the character and the external events. In complex systems we have both physical laws (often ‘hidden’) that drive the system to change and random noise (exogenous or endogenous) that interacts with the system. The tricky point is that when dealing with complex systems we need to adopt both aspects: the heartbeat of a person (the series of the time intervals between subsequent beats) is dependent on both physical features of the spreading of electric signals across the myocardium and the environmental contingencies occurring in time (e.g. wake/sleep, emotions, metabolic changes, etc.). Strictly speaking, to consider a series as a proper ‘time-dependent’ signal needs both constitutive (e.g. physical laws) and contingent (environmental perturbations) drivers. As a matter of fact, in an ideal pendulum trajectory there is no real time course: the oscillatory behaviour is invariant in time and the system repeats at regular intervals exactly the same path; this is why it can be described by a circle in a phase space, i.e. by a figure with no beginning and no end that can be traversed an infinite number of times. On the other hand, the relative motions of an ensemble of particles at equilibrium have no time-dependent properties and can be described by a static probability distribution of space occupation. In economics this fact is immediate to grasp: an economic system governed by some constitutive ‘rules’ is continuously challenged by environmental solicitations coming from largely unpredictable contingencies happening in time that influence its trajectory. This state of affairs heavily impinges on the data analysis tools more apt to describe such a blend of constitutive and context dependent features.

The ‘perfect’ tool must have the three following basic features:

  1. 1.

    It must be free from any stationarity assumption (the sensitivity to detect tipping-points is of utmost importance).

  2. 2.

    It must be able to deal with both quantitative and symbolic variables.

  3. 3.

    It must be able to deal with very short series.

The above requirements contribute to a fourth ‘corollary’: the mathematics must be as simple as possible.

The recurrence plot approach fulfils the above three requirements, and the mathematics at the basis of the method is the simplest one: nothing more than Pythagoras’ theorem in many dimensions. Basically, we deal with a distance matrix between subsequent epochs in a time series and mark as a ‘recurrence’ any pair of epochs whose distance is below a given threshold (radius). The number of such recurrences and their disposition in time generate a set of quantitative descriptors able to fully characterize the studied system. These properties made recurrence plots (RP) and their quantitative extension (recurrence quantification analysis [RQA]) the method of choice in fields as diverse as biomolecular sequence analysis (where time is substituted by the linear order of monomers along polymer chains), engineering, physiology, psychology, text analysis and clearly economics.

In Sect. 10.4 it can be observed how this approach is useful in detecting spatio-temporal recurrent patterns of dynamical regimes of economic time series. Some indications on the nature of business cycles (i.e. deterministic or stochastic) as well as on the nature of macroeconomic variables and the economy are reported.

2 Recurrence Plot: Introduction

To introduce RQA it is mandatory to understand what exactly a recurrence plot is and how it was built. The phase space is the space that permits geometrical description of the dynamical evolution of complex nonlinear systems. The dimension of the phase space is the number of variables necessary to describe the state of the system in an instant. An equivalent phase space can be built by time delay embedding procedure from a time series data.

Let x i be the orbit of a dynamical system, and let us consider the so-called delayed vectors denoted as

$$\displaystyle \begin{aligned} \boldsymbol{x}_{i} = (x_{i},x_{i+1}, \ldots,x_{i+(m-1)}), \end{aligned} $$
(10.1)

where m is the embedding dimension (see 7.2).

Fixed a 𝜖 > 0, for all coordinates (i, j), we can define the function

$$\displaystyle \begin{aligned} R_{i,j}(\varepsilon)=\mathcal{H} \left( \varepsilon - \parallel \boldsymbol{x }_{i} - \boldsymbol{x }_{j} \parallel \right) \quad i,j=1, \ldots , N. \end{aligned} $$
(10.2)

Definition 10.1 (Recurrence Plot [1])

A recurrence plot (RP) is a matrix of dots in a N × N square, where the coordinates (i, j) are displayed if R i,j(ε) = 1, i.e. the distance between x i and x j is less than ε.

Therefore, the RP of x i ≈x j shows, for a given t, the indices of times at which a phase-space trajectory visits the same area in the phase space. The diagonal is called line of identity (LOI), while vertical segments represent phase-space trajectories that remain in the same phase-space region for some time, whereas diagonal lines represent trajectories that run parallel for some time. Thus, the RP enables us to investigate the m-dimensional phase-space trajectory through a two-dimensional representation of its recurrences. Large scale structures in RP can be classified as homogeneous, periodic, drift and disrupted (see Fig. 10.1). Small scale structures (isolated dots, diagonal lines and vertical/horizontal lines and rectangular regions) are the basis of a quantitative analysis of the RPs.

Fig. 10.1
figure 1

Recurrence plots coupled with their time series for different systems. Top panels: Signals. Bottom panels: RP. From left to right we consider a white noise, the logistic map with periodic (μ = 3.5) and chaotic (μ = 4) behaviour, and an auto-regressive process

3 Recurrence Quantification Analysis

Recurrence quantification analysis (RQA) describes quantitatively the recurrence plot. ‘Recurrence’ is defined as the ability of a dynamic system to return to the proximity of the initial point in phase space, and, consequently, RQA was developed by C. Webber and J. Zbilut [12] to understand the behaviour of the phase-space trajectory of dynamical systems. RQA can be defined as a graphical, statistical and analytical tool for the study of nonlinear dynamical systems, and it is successfully used in a multitude of different disciplines from physiology [15, 16] to earth science [17] and economics [9, 10].

3.1 RQA Measures

In the RQA, the following measures can be defined.

  1. S.1

    Recurrence (REC), i.e. the density of recurrence points in a recurrence plot (RP). This measure counts those pairs of points whose spacing is below a predefined cut-off distance. Its value is a function of the periodicity of the systems: the more periodic the signal dynamics, the higher the REC.

  2. S.2

    Determinism (DET) measures the number of diagonals and indicates the duration of stable interactions that is graphically represented by the recurrence points in the RP, whose forming lines are parallel to the line of identity (LOI). However, it must be noted that high values of DET ‘might be an indication of determinism in the studied system, but it is just a necessary condition, not a sufficient one’ (Marwan [2]).

  3. S.3

    Maximal deterministic line (MAXLINE) measures the length of the said line found in the computation of DET. According to Eckmann et al. [1], line lengths on RP are directly related to the inverse of the largest positive Lyapunov exponent, and therefore small MAXLINE values are ‘indicative of randomlike behaviour’. ‘In a purely periodic signal, lines tend to be very long, so MAXLINE is large’ [4]. Last but not least, there is a positive probability that white noise processes can have a high MAXLINE, although this is unlikely.

  4. S.4

    Entropy (ENT) is the Shannon entropy measured in bits because of the base-2 logarithm, which are the bins over the diagonals. ‘ENT quantifies the distribution of the diagonal line lengths. The larger the variation in the lengths of the diagonals, the more complex the deterministic structure of the RP’ [4].

  5. S.5

    Trend (TREND) is the regression between the density of recurrence points parallel to the LOI and its distance to the LOI. As TREND measures how quickly a recurrence point departs from the main diagonal, it aims to detect nonstationarity.

  6. S.6

    Laminarity (LAM), analogous to DET, measures the number of recurrence points that form vertical lines and indicates the amount of laminar phases (intermittency) in the system.

  7. S.7

    Trapping time (TT) measures the average length of the vertical lines, therefore showing how long the system remains in a specific state.

Remark 10.1

With regard to the RP, points on the LOI are excluded from the measures S.1, S.2 and S.3 because they are trivially recurrent. REC, DET, ENT, MAXLINE and TREND are sensitive to parallel trajectories along different segments of the time series. LAM and TT are able to find chaos–chaos transitions. The ratio of determinism is represented by the lengths of diagonal lines.

3.2 RQA Epoch by Epoch Correlation Index

We start from the definition of a rolling window because, as mentioned in Webber [3], ‘one of the most useful applications of recurrence quantifications is to examine long time series of data using a small moving window traversing the data. For example, in retrospective studies it is possible to study subtle shifts in dynamical properties just before a large event occurs’.

Slight changes and transition in the dynamics of complex systems can be studied when RQA measures are calculated separately on rolling and overlapping segments. Dynamical transitions like periodic-chaos or chaos–chaos transitions can be observed with this approach.

Definition 10.2 (Rolling Window)

Let us set \(\mathcal {I} = \{1, \dotsc , n \} \subseteq \mathbb {N} \) and, for each \((k,i) \in \mathbb {N}^{*} \times \mathbb {N}^{*}\) with k < n and i ≤ n − k + 1.

A discrete time rolling or sliding window is

$$\displaystyle \begin{aligned} \mathcal{I}_{k,i} = \{i, \dotsc, i+k-1 \} \left( \subset \mathbb{N} \right), \end{aligned} $$
(10.3)

where k and i are, respectively, the size and the window’s index.

Remark 10.2

It can be noted that the number of windows of size k, as defined in Eq. (10.3), is q = n − k + 1(≥ 2).

Definition 10.3 (Recurrence Quantification Epoch [13])

When a time series is divided into a series of windows or epochs of smaller length, the resulting RQA on those multiple sub-series is called recurrence quantification epoch (RQE).

Remark 10.3

When performing the RQE, it can happen that some windows may overlap. For example, Webber [11] partitioned a time series of 227,957 points in shorter windows (or epochs), each 1.024 seconds long, and ‘adjacent windows were offset by 256 points (75% overlap), fixing the time resolution to 256 ms’.

Definition 10.4 (Sampling)

For each \( (k,i,l) \in \mathbb {N}^{*} \times \mathbb {N}^{*} \times \mathbb {N}^{*}\) we denote \(S^{l}_{k,i}\) the l-th RQA measure of the epoch as

$$\displaystyle \begin{aligned} S_{k,i} = \lbrace S_{t} \mid t \in \mathcal{I}_{k,i} \rbrace. \end{aligned} $$
(10.4)

Definition 10.5 (RQE Correlation Index)

For each l ≠ m, we denote ρ l, m the Spearman’s correlation coefficient between \(S^{l}_{k,i}\) and \(S^{m}_{k,i}\).

Therefore, there are \( p= \binom L 2 \) pairs of correlations ρ l, m and q × p pair of epoch correlations \( \rho _{k,i}^{l,m} \) so that the product

$$\displaystyle \begin{aligned} P (\mathit{ RQE })_{k,i}=\prod_{\substack{l,m=1 \\ l \neq m}}^{L} \big(1+ \rho_{k,i}^{l,m}\big) \end{aligned} $$
(10.5)

can be defined as the RQE correlation index for the rolling window \(\mathcal {I}_{k,i}\), and it varies between 0 and 2p.

Definition 10.6 (RQE Absolute Correlation Index)

The product

$$\displaystyle \begin{aligned} P_{abs}(\mathit{ RQE })_{k,i}=\prod_{\substack{l,m=1 \\ l \neq m}}^{L} \big(1+ \vert \rho_{k,i}^{l,m} \vert \big) \end{aligned} $$
(10.6)

can be defined as the RQE absolute correlation index for the rolling window \(\mathcal {I}_{k,i}\), and it varies between 1 and 2p.

4 RQA Applications

RQA is meant to be an efficient and relatively simple tool in nonlinear analysis because it allows the identification of the hidden structure of the time series as well as sudden phase changes. For the first purpose, we run PCA over RQA measures Sect. 10.4.1; for the second, we propose a correlation index based on RQA with the final aim to obtain an indicator for early detection of recessions Sect. 10.4.2.

4.1 Principal Component Analysis (PCA) on RQA

The recurrence quantification analysis (RQA) introduces few parameters as synthetic descriptors of the global complexity of the signal, while it is possible to exalt the minor components present in it by filtering out the redundant information through principal component analysis (PCA). The descriptors obtained by the RQA could be re-dimensioned through applying the principal component analysis (PCA) technique. PCA is a common statistical technique that provides the possibility to (1) reduce the dimension of a data set without consistent loss of information and (2) to separate the different and independent features of the data. The PCA procedure describes the original data set with a lower number of parameters called main components (PC1, PC2).

For example, the combined use of the RQA and PCA is a useful method in clinical applications [14, 15]. In economics the PCA has been applied to recurrence measures estimated from business cycle data [8]. Thanks to that, it was possible to observe that RQA could distinguish differences between income, capital, investment and consumption (see Chap. 17).

4.2 RQE Correlation Index on a Sample Signal

As suggested in Orlando et al. [7], in order to test whether the aforementioned correlation index can help to understand changes in a time series, we start by considering a known signal. Let us simulate a random signal distributed as \( \varepsilon \sim \mathcal {N}(\mu ,\,\sigma ^{2}) \), and let us change its mean and variance as in Table 10.1 and shown in Fig. 10.2.

Fig. 10.2
figure 2

Clockwise from the top left corner: original sample signal N(0, 1), sample signal with changes in mean, sample signal with changes in variance and resulting final signal with changed mean and variance

Table 10.1 Perturbed random signal according to a given μ and σ 2. For example, for the first interval, 100 points have been randomly generated from a \(\mathcal {N}(0,1)\) distribution. For the second interval, 40 points have been randomly generated from a \(\mathcal {N}(1,1)\) distribution, and so on

Now let us apply the RQA to both the original and transformed signals by using the parameters in Table 10.2. The resulting correlations for the original signal and the final signal are displayed in Figs. 10.3 and 10.4, respectively. It is worth noting that the RQE absolute correlation (10.6) is able to detect 9 of the 10 intervals appearing in Table 10.1 (one being clouded by the windowing filtering).

Fig. 10.3
figure 3

Original test signal (above) versus Spearman correlations (below). RQE absolute correlation (in blue) is displayed next to correlation (red). Difference in the x-axis numbering between the picture above and below is due to the windowing mechanism

Fig. 10.4
figure 4

Altered test signal (above) versus Spearman correlations (below). RQE absolute correlation (in blue) is displayed next to correlation (red). See how the RQE correlation calculated as in Eq. 10.6 is closer than the other, and it is able to detect more fine changes in the times series. The difference in the x-axis between the picture above and below is due to the windowing mechanism

Table 10.2 RQA parameters of the perturbed signal

In Orlando et al. [9], the index was tested on the income time series as generated from a Kaldor–Kalecki model [5, 6] with similar results.