# Complex Systems, Emergence, and Multiscale Analysis: A Tutorial and Brief Survey
## 3 Adaptive Detrending, Denoising, Multiscale Decomposition, and Fractal Analysis
### Adaptive Fractal Analysis (AFA)  
In the past three decades, many efforts have been made to estimate \(H\), the most important parameter for random fractals. As a result, many excellent methods for estimating \(H\) have been proposed. Among them is the celebrated detrended fluctuation analysis (DFA) [151; 152]. It works as follows: To analyze a time series, \(x_{1},x_{2},x_{3},\cdots\), one first determines its mean \(\overline{x}\), then constructs a random walk process using Equation (76). By doing so, one has assumed that the data are like a noise process. One then partitions the random walk into non-overlapping segments of length \(l\) (therefore, the number of distinct segments is not larger than \(N/l\), where \(N\) is the length of the time series). One furthers determines the local trend in each segment by using the best linear or polynomial fitting. This procedure is schematically shown in Figure 27, where a short EEG signal is used as an example. Finally, one obtains the difference between the original \"walk\" and the local trend. Denote it by \(u(n)\). \(H\) is then estimated by  
\[F_{d}(l)=\Big{\langle}\sum_{i=1}^{l}u_{l}(i)^{2}\Big{\rangle}^{1/2}\sim l^{H} \tag{98}\]  
where the angle brackets is a short-hand notation for averages over all the segments. Although DFA is very good in many applications, when a signal has a strong nonlinear trend, such as an oscillatory component or a rhythmic activity, there may exist large discontinuities in adjacent segments of DFA (see Figure 27). These discontinuities can cause big problems. This problem can be readily solved by the adaptive fractal analysis (AFA) [149; 154; 157]. The difference with DFA is that we now have a globally, not only continuous but also almost everywhere, differentiable trend [155; 156]. Denote it by \(v(i)\). The difference between the original random walk process \(u(i)\) and \(v(i)\) can be used to accurately estimate \(H\). The formula is given by [154]  
\[F(w)=\Big{[}\frac{1}{N}\sum_{i=1}^{N}(u(i)-v(i))^{2}\Big{]}^{1/2}\sim w^{H}. \tag{99}\]  
Generalizing to a multifractal analysis, we obtain:  
\[F^{(q)}(w)=\Big{[}\frac{1}{N}\sum_{i=1}^{N}|u(i)-v(i)|^{q}\Big{]}^{1/q}\sim w^{ H(q)} \tag{100}\]  
Figure 27: Schematic of DFA. where \(q\) is a real number. Just as we have discussed earlier, positive \(q\) values highlight large values in \(|u(i)-v(i)|\), and negative \(q\) values highlight small values in \(|u(i)-v(i)|\). Equation (99) can readily be extended to long-range cross-correlation analysis [188] between two series: \(x(i),i=1\cdots,n\) and \(y(i),i=1\cdots,n\). Denote their trend signals corresponding to window size \(w\) by \(\text{trend\_}x^{(w)}(i),i=1\cdots,n\) and \(\text{trend\_}y^{(w)}(i)\), \(i=1\cdots,n\), respectively. Then we have  
\[F_{xy}(w)=\Big{[}\frac{1}{N}\sum_{i=1}^{N}(x(i)-\text{trend\_}x^{(w)}(i))\times (y(i)-\text{trend\_}y^{(w)}(i))\Big{]}^{1/2}\sim w^{H_{xy}}. \tag{101}\]  
Following the generalization from Equations (99)-(100), Equation (101) can also be readily extended to multifractal analysis. Let us now examine the fractal behavior of the power load data of Figure 26a using AFA. To cope with the nonstationary of the data, we partition the data into short windows, then we estimate \(H\) for each window. Recalling that the data are sampled 96 times a day, we choose the window size to be one month, containing \(96\times 30=2880\) sample points. To improve the resolution of the variation of \(H\), the adjacent windows overlap by half of the window length. Figure 28a shows an example of the scaling analysis using AFA, for an arbitrarily window. The curve is linear for scale up to \(w=2^{7}\) sample points. It is a little longer than a day. \(H\) can be estimated as the slope of the linear portion of the curve. The temporal variation of \(H\) is plotted in Figure 28b as the red curve. Interestingly, it has a seasonal variation. To check whether this variation may be correlated with the yearly temperature variation, we have also shown in Figure 28b a curve in black reflecting the temperature variation.