## 2 Materials and Methods
### Feature Engineering  
To obtain HRV features, we analyzed real (i.e., without missing values values), non-interpolated, and interpolated (i.e., with different percentage of artificial missing values values) 5 min ECG time series. We analyze time domain HRV features, frequency, and non-linear domains. Time domain analysis usually contains various statistical variables of the duration time series. The frequency domain analysis investigates the power spectrum of RR-intervals time series in order to assess the cardiac autonomic balance (i.e., sympathetic and parasympathetic nervous systems activity). Additionally, non-linear HRV features try to capture the non-periodic behaviour of the HRV and the complexity that exists inside the RR-interval dynamics. The variables that we include in our analysis, in both time and frequency domain, are defined as:  
* Time domain:
* HR mean: mean values of heart rate (HR) computed as showed in Equation (9). \[HR_{mean}=\frac{1}{N-1}\sum_{i=1}^{N-1}60/(R_{i+1}-R_{i}),\] (9) where N is the number of beats and R is the time when the beats happened.
* RMSSD: root mean square of the successive RR-intervals differences (Equation (10)) represents the strength of the autonomic nervous system (specifically the parasympathetic branch) at a given time.  
Figure 4: Difference between linear interpolation on time and duration. Red solid line refers to real variation of the timing between beats (RR-intervals) time series, green dashed line refers to the on-duration approach, and green dot dash line refers to the on-time approach.  
\[RMSSD=\sqrt{\frac{1}{N-1}\sum_{i=1}^{N-1}[(R_{i+1}-R_{i})-(R_{i}-R_{i-1})]^{2}},\] (10) where N is the number of beats and R is the time when the beats happened.
* SDNN: standard deviation of RR-intervals (Equation (11)). It reflects the cyclic components responsible for variability in the RR-intervals time series. The SDNN is the \"gold standard\" for medical stratification of both morbidity and mortality [16]. \[SDNN=\sqrt{\frac{1}{N-1}\sum_{i=1}^{N}(RR_{i}-\overline{RR})^{2}},\] (11) where N is the number of beats and RR is the intervals between two consecutive R and \(\overline{RR}\) is the mean of RR-intervals in the time series.
* PNN50: the ratio between NN50 (i.e., number of pairs of successive RR intervals that differ by more than 50 ms) and the total number of RR-intervals (Equation (12)). \[PNN50=\frac{NN50_{count}}{N_{RR-intervals}}\] (12)
* Frequency domain:
* Power spectral density (PSD): describes the distribution of power into frequency components composing that signal. The Lomb-Scargle periodogram for PSD estimation was found to be the most appropriate method to analyze RR-interval data [5; 6]. VLF (power in very-low-frequency ranges, i.e., \(\leq\)0.04 Hz), LF (power in low-frequency ranges, i.e., 0.04-0.15 Hz), HF (Power in high-frequency ranges, i.e., 0.15, 0.4 Hz), LF/HF ratio (ratio between LF and HF expressed as ms\({}^{2}\)), and total power (Power in all the frequency ranges, i.e., \(\leq\)0.4) were obtained by the sum of the power in the relevant frequency range in the spectrum.
* Non-linear HRV features:
* Poincare plot: it is a type of recurrence plot used to quantify self-similarity in processes. A Poincare plot is a graph of RR interval (\(RR_{n}\)) against the previous one (\(RR_{n}-1\)). From this scatter plot, it is possible to quantitatively analyze the variance of two consecutive RR-intervals by fitting an ellipse to the plotted shape. \(SD1\) is the standard deviation of Poincare plot perpendicular to the line-of-identity, while \(SD2\) is the standard deviation of the Poincare plot along the line-of-identity.