## 2 Methods
### RP-Based Representation of the HRV Signal  
The RP was introduced by [PERSON] et al. [27] as an advanced tool of nonlinear data analysis to explore the recurrence features and irregularity properties of time series dynamic information in the phase space [22]. In order to visualize how the trajectory of the time series recurs roughly the same area in the phase space, a multidimensional representation of the series is firstly required. For that purpose, [PERSON]'s time delay theorem has been widely used [45]. Thus, considering the HRV signal as the time series \(s(n)=\{s(1),s(2),\ldots,s(N)\}\) of length \(N\) samples, it can be embedded into an \(m\)-dimensional space as  
\[\mathbf{\vec{X}}=\left\{ \begin{array}{c}\vec{x}_{1}\\ \vec{x}_{2}\\ \cdot\\ \cdot\\ \cdot\\ \vec{x}_{k}\end{array} \right\}=\left\{ \begin{array}{ccccc}s(1)&s(1+\tau)& \ldots&s(1+(m-1)\tau)\\ s(2)&s(2+\tau)&\ldots&s(2+(m-1)\tau)\\ \cdot&\cdot&\cdot&\cdot\\ \cdot&\cdot&\cdot&\cdot\\ s(k)&s(k+\tau)&\ldots&s(k+(m-1)\tau)\end{array} \right\}, \tag{1}\]  
where \(k\) represents the \(k\)-th point on the trajectory of the time series (\(k=1,2,\ldots,N-(m-1)\tau\)), \(\tau\) is the delay time, and \(m\) is the embedding dimension. More precisely, the parameters involved in Equation (1) can be described as follows:  
* \(\mathbf{\vec{X}}\) represents the phase space trajectory matrix. * \(\vec{x}_{i}\) denotes individual state vectors within the phase space. * \(\vec{s}_{i}\) refers to the time series values at different time points. * \(\tau\) is the time delay, determining the temporal separation between consecutive elements in each state vector. * \(m\) represents the embedding dimension, indicating the number of components in each state vector. * \(k\) signifies the number of state vectors constructed from the time series. These parameters collectively define the reconstruction of the phase space from a univariate time series, which is fundamental for the creation of RPs. The matrix structure illustrates how successive time-delayed values are organized to form multidimensional state vectors, capturing the system's dynamics in a higher-dimensional space. \begin{table}
\begin{tabular}{l l l l} \hline
**Class/DB** & **Apnea-ECG** & **MIT-BIH** & **UCD-DB** \\ \hline Apnea & 10,373 & 2841 & 3977 \\ Normal & 15,971 & 1472 & 6359 \\ Total & 26,344 & 4313 & 10,336 \\ \hline \end{tabular}
\end{table} 
Table 1: Distribution per class and database (one minute-length recordings). The optimal selection of both parameters \(\tau\) and \(m\) is a key step to obtain a fully representative RP of the time series recurrence. To this respect, if \(\tau\) is too large, the points in the trajectory might be disconnected and no recurrences could be observed. Contrarily, if \(\tau\) is too small, redundant information for the same states of the trajectory could be captured and the reconstructed attractor would be compressed along the identity line [46; 47]. Also, if \(m\) is too small, the geometry of the phase space is partly folded and, if \(m\) is too large, a rounding error due to excessive partitions could contaminate the attractor [48]. Different approaches can be found in the literature to optimize the selection of these two parameters. In the present work, the well-known methods of average mutual information and false-nearest neighbors were used [49], reporting optimal values of \(m=3\) and \(\tau=2\), respectively. However, several tests using further values of \(m\) and \(\tau\) have been performed, finding no notable differences respect to the values mentioned before. Thereafter, the distance between every point \(\vec{x}_{k}\) and the remaining ones in the phase space must be computed, thus resulting in the squared matrix:  
\[D(i,j)=||\vec{x}_{i}-\vec{x}_{j}||, \tag{2}\]  
where \(i\) and \(j\) range from i to \(N-(m-1)\tau\times N-(m-1)\tau\), and the function \(||\cdot||\) represents the Euclidean norm.