# Multifractal Characterization and Modeling of Blood Pressure Signals
## 2 Data and Methodology
### Data Pre-Processing
#### 2.2.3 Addressing Non-Stationarities  
A random process is said to be _stationary_ if its statistical properties do not change over time. More precisely, for a random process \(X(t)\), the following two definitions hold. **Definition 4** (Strict-Sense Stationary). : _A random process \(X(t)\) is said to be strict-sense stationary (SSS) if all its finite order distribution are time invariant, i.e., the joint CDF of \(X(t_{1})\), \(X(t_{2})\), \(\ldots\), \(X(t_{k})\) is the same as for \(X(t_{1}+\alpha)\), \(X(t_{2}+\alpha)\), \(\ldots\), \(X(t_{k}+\alpha)\) for any \(k\), any \(t_{1},t_{2},\ldots\), \(t_{k}\), and any timeshift \(\alpha\). Hence, for a SSS process, the first-order distribution is independent of \(t\), and the second-order distribution, i.e., the distribution of any two samples \(X(t_{1})\) and \(X(t_{2})\), depends only on the distance or lag \(\tau=t_{1}-t_{2}\)._  
**Definition 5** (Wide-Sense Stationary). : _A random process \(X(t)\) is said to be wide-sense (or weak-sense) stationary (WSS) if its mean and auto-correlation function are time invariant, i.e., \(\mathbb{E}(X(t))=\mu\) and \(R_{X}(t_{1},t_{2})\) is only a function of the distance or lag \(|t_{1}-t_{2}|\)._  
Hence, stationarity refers to time invariance of some, or all, of the statistics of a random process (e.g., mean, auto-correlation, \(n\)-th order distribution). It is worth noting that in real-world signals, it is difficult to find a true SSS or WSS signal due to the presence of transient, drift, cycle, polynomial or quasi-periodic trends. However, some random phenomena can exhibit a steady-state behavior after the transient. For example, a random walk is not stationary [49]. DFA is a powerful tool for analyzing the long-range correlations in a real-world signal since it incorporates polynomial detrending routines in its main core, and it has been shown to outperform pre-existing methods, such as \(\text{R}-\text{S}\) analysis [50; 51], fluctuation analysis [52] or other methods to study the auto-correlation of a signal, such as the decay of the Fourier spectrum [53] or the decay of the auto-correlation function [35]. However, real-world time series such as physiological measurements or even rainfalls and river water flows can be affected by other types of trends such as seasonalities and, more specifically, periodic or quasi-periodic trends [40] that make the signals non-stationary with the appearance of crossovers in the scaling function of the DFA (periodic or quasi-periodic trends). Besides apparent crossovers, a non-stationarity reveals a Hurst exponent \(\text{H}>1\) in the DFA scaling function with no clear interpretation in the fractal theory, being for one-dimensional self-affine processes the H exponent related to the fractal dimension \((D=2-\text{H})\) that has to be positive. As an example, in Figure 2, it the log-log plot representing the scaling function \(F_{2}(s)\) for the BPd signal treated only with outlier removal phase and low-pass filtering can be appreciated. The high value of the Hurst exponent \(\text{H}>1\) denotes the presence of non-stationarities not removed by the third order DFA, i.e., DFA3. Notwithstanding, the DFA is able to address polynomial trends--see Section 2.1--and many detrending techniques aiming to study real-world signals are proposed, such as the ones based on empirical mode decomposition, singular value decomposition, Fourier spectrum (Fourier detrended MFDFA), etc.--see [35; 54] for further information. In this work, we concatenate three methods to obtain a near-stationary signal:  
1. The log transformation, where each sample \(X(k)\) is substituted by \(\log(X(k))\)[55] in order to stabilize the overall variance of the signal;
2. The subtraction from the signal of the overall trend obtained by a median filter with a time window \[Y_{M}(k)= \begin{cases}\text{median}[X(k-(n-1)/2:k+(n-1)/2)]&\text{if $n$ is odd}\\ \text{median}[X(k-n/2,\ldots,k+(n/2)-1)]&\text{if $n$ is even}\end{cases}