PHYSICAL REVIEW E 82, 011136 共2010兲 Detrending moving average algorithm for multifractals Gao-Feng Gu (顾高峰兲1,2 and Wei-Xing Zhou (周炜星兲1,2,3,4,5,* 1 School of Business, East China University of Science and Technology, Shanghai 200237, China Research Center for Econophysics, East China University of Science and Technology, Shanghai 200237, China 3 School of Science, East China University of Science and Technology, Shanghai 200237, China 4 Engineering Research Center of Process Systems Engineering (Ministry of Education), East China University of Science and Technology, Shanghai 200237, China 5 Research Center on Fictitious Economics & Data Science, Chinese Academy of Sciences, Beijing 100080, China 共Received 8 June 2010; published 27 July 2010兲 2 The detrending moving average 共DMA兲 algorithm is a widely used technique to quantify the long-term correlations of nonstationary time series and the long-range correlations of fractal surfaces, which contains a parameter determining the position of the detrending window. We develop multifractal detrending moving average 共MFDMA兲 algorithms for the analysis of one-dimensional multifractal measures and higherdimensional multifractals, which is a generalization of the DMA method. The performance of the onedimensional and two-dimensional MFDMA methods is investigated using synthetic multifractal measures with analytical solutions for backward 共 = 0兲, centered 共 = 0.5兲, and forward 共 = 1兲 detrending windows. We find that the estimated multifractal scaling exponent 共q兲 and the singularity spectrum f共␣兲 are in good agreement with the theoretical values. In addition, the backward MFDMA method has the best performance, which provides the most accurate estimates of the scaling exponents with lowest error bars, while the centered MFDMA method has the worse performance. It is found that the backward MFDMA algorithm also outperforms the multifractal detrended fluctuation analysis. The one-dimensional backward MFDMA method is applied to analyzing the time series of Shanghai Stock Exchange Composite Index and its multifractal nature is confirmed. DOI: 10.1103/PhysRevE.82.011136 PACS number共s兲: 05.40.⫺a, 05.45.Df, 05.10.⫺a, 89.75.Da I. INTRODUCTION Fractals and multifractals are ubiquitous in natural and social sciences 关1–3兴. There are a large number of methods developed to characterize the properties of fractals and multifractals. The classic method is the Hurst analysis or rescaled range analysis 共R/S兲 for time series 关4,5兴 and fractal surfaces 关6兴. The wavelet transform module maxima method is a more powerful tool to address the multifractality 关7–11兴, even for high-dimensional multifractal measures in the fields of image technology and three-dimensional turbulence 关12–16兴. Another popular method is the detrended fluctuation analysis 共DFA兲, which has the advantages of easy implementation and robust estimation even for short signals 关17–19兴. The DFA method was originally invented to study the longrange dependence in coding and noncoding DNA nucleotides sequence 关20兴 and then applied to time series in various fields 关21–24兴. The DFA algorithm was extended to analyze the multifractal time series, which is termed as multifractal detrended fluctuation analysis 共MFDFA兲 关25兴. These DFA and MFDFA methods were also generalized to analyze highdimensional fractals and multifractals 关26兴. Moreover, based on the DFA method, Podobnik and Stanley recently proposed the method called detrended cross-correlation analysis to investigate the cross correlations between two time series 关27兴, which was generalized to analyze multifractal time series 关28兴. A more recent method is based on the moving average or mobile average technique 关29兴, which was first proposed by *[email protected] 1539-3755/2010/82共1兲/011136共8兲 Vandewalle and Ausloos to estimate the Hurst exponent of self-affinity signals 关30兴 and further developed to the detrending moving average 共DMA兲 by considering the secondorder difference between the original signal and its moving average function 关31兴. Because the DMA method can be easily implemented to estimate the correlation properties of nonstationary series without any assumption, it is widely applied to the analysis of real-world time series 关32–39兴 and synthetic signals 关40–42兴. Recently, Carbone and co-workers extended the one-dimensional DMA method to higher dimensions to estimate the Hurst exponents of higherdimensional fractals 关43,44兴. Extensive numerical experiments unveil that the performance of the DMA method is comparable to the DFA method with slightly different priorities under different situations 关41,45兴. In this paper, we extend the DMA method to multifractal detrending moving average 共MFDMA兲, which is designed to analyze multifractal time series and multifractal surfaces. Further extensions to higher-dimensional versions are straightforward. The performance of the MFDMA algorithms is investigated using synthetic multifractal measures with known multifractal properties. We also compare the performance of MFDMA with MFDFA, and find that MFDMA is superior to MFDFA for multifractal analysis. The paper is organized as follows. In Sec. II, we describe the algorithm of one-dimensional MFDMA and show the results of numerical simulations. We also apply the onedimensional MFDMA to analyze the time series of intraday Shanghai Stock Exchange Composite 共SSEC兲 Index. In Sec. III, we describe the algorithm of two-dimensional MFDMA and report the results of numerical simulations as well. We discuss and conclude in Sec. IV. 011136-1 ©2010 The American Physical Society PHYSICAL REVIEW E 82, 011136 共2010兲 GAO-FENG GU AND WEI-XING ZHOU II. ONE-DIMENSIONAL MULTIFRACTAL DETRENDING MOVING AVERAGE ANALYSIS determine the power-law relation between the function Fq共n兲 and the size scale n, which reads A. Algorithm Fq共n兲 ⬃ nh共q兲 . Step 1. Consider a time series x共t兲, where t = 1 , 2 , . . . , N. We construct the sequence of cumulative sums According to the standard multifractal formalism, the multifractal scaling exponent 共q兲 can be used to characterize the multifractal nature, which reads t y共t兲 = 兺 x共i兲, t = 1,2, . . . ,N. 共1兲 共q兲 = qh共q兲 − D f , i=1 Step 2. Calculate the moving average function ỹ共t兲 in a moving window 关37兴, 共n−1兲共1−兲 ỹ共t兲 = 1 兺 y共t − k兲, n k=−共n−1兲 共2兲 where n is the window size, x is the largest integer not greater than x, x is the smallest integer not smaller than x, and is the position parameter with the value varying in the range 关0,1兴. Hence, the moving average function considers 共n − 1兲共1 − 兲 data points in the past and 共n − 1兲 points in the future. We consider three special cases in this paper. The first case = 0 refers to the backward moving average 关41兴, in which the moving average function ỹ共t兲 is calculated over all the past n − 1 data points of the signal. The second case = 0.5 corresponds to the centered moving average 关41兴, where ỹ共t兲 contains half-past and half-future information in each window. The third case = 1 is called the forward moving average, where ỹ共t兲 considers the trend of n − 1 data points in the future. Step 3. Detrend the signal series by removing the moving average function ỹ共i兲 from y共i兲 and obtain the residual sequence ⑀共i兲 through ⑀共i兲 = y共i兲 − ỹ共i兲, 共3兲 where n − 共n − 1兲 ⱕ i ⱕ N − 共n − 1兲. Step 4. The residual series ⑀共i兲 is divided into Nn disjoint segments with the same size n, where Nn = N / n − 1. Each segment can be denoted by ⑀v such that ⑀v共i兲 = ⑀共l + i兲 for 1 ⱕ i ⱕ n, where l = 共v − 1兲n. The root-mean-square function Fv共n兲 with the segment size n can be calculated by n F2v共n兲 1 = 兺 ⑀2v共i兲. n i=1 共4兲 Step 5. The qth-order overall fluctuation function Fq共n兲 is determined as follows: Fq共n兲 = 再 N 1 n q 兺 F 共n兲 Nn v=1 v 冎 1/q , 共5兲 where q can take any real value except for q = 0. When q = 0, we have N ln关F0共n兲兴 = 1 n 兺 ln关Fv共n兲兴, Nn v=1 共6兲 according to L’Hôspital’s rule. Step 6. Varying the values of segment size n, we can 共7兲 共8兲 where D f is the fractal dimension of the geometric support of the multifractal measure 关25兴. For time series analysis, we have D f = 1. If the scaling exponent function 共q兲 is a nonlinear function of q, the signal has multifractal nature. It is easy to obtain the singularity strength function ␣共q兲 and the multifractal spectrum f共␣兲 via the Legendre transform 关46兴 ␣共q兲 = d共q兲/dq, f共q兲 = q␣ − 共q兲. 共9兲 B. Numerical experiments In the numerical experiments, we generate onedimensional multifractal measure to investigate the performance of MFDMA, which is compared with MFDFA. We apply the p model, a multiplicative cascading process, to synthesize the multifractal measure 关47兴. Start from a measure uniformly distributed on an interval 关0,1兴. In the first step, the measure is redistributed on the intervals 1,1 = p1 to the first half and 1,2 = p2 = 共1 − p1兲 to the second half. One partitions it into two sublines with the same length. In the 共k + 1兲th step, the measure k,i on each of the 2k line segments is redistributed into two parts, where k+1,2i−1 = k,i p1 and k+1,2i = k,i p2. We repeat the procedure for 14 times and finally generate the one-dimensional multifractal measure with the length 214. In this paper, we present the results when the parameters are p1 = 0.3 and p2 = 0.7. The results for other parameters are qualitatively the same. We calculate the fluctuation function Fq共n兲 of the synthetical multifractal measure using the MFDMA and MFDFA methods and present the fluctuation function Fq共n兲 in Fig. 1共a兲. We find that the function Fq共n兲 well scales with the scale size n. Using the least-squares fitting method, we obtain the slopes h共q兲 for MFDMA 共 = 0, = 0.5, and = 1兲 and MFDFA, respectively, which are illustrated in Table I. It is found from the table that the error bars of the three MFDMA algorithms are all smaller than the MFDFA method, which implies that it is easier to determine the scaling ranges for the MFDMA algorithms. In most cases, the algorithms underestimate the h共q兲 values and the backward MFDMA approach gives the best estimates. There is an interesting feature in Fig. 1共a兲 showing evident logarithmicperiodic oscillations in the MFDFA Fq共n兲 curves, which is intrinsic for the multifractal binomial measure 关48兴. We plot the multifractal scaling exponents 共q兲 obtained from MFDMA 共 = 0, = 0.5, and = 1兲 and MFDFA in Fig. 1共b兲. The theoretical formula of 共q兲 of the multifractal measure generated by the p model discussed above can be expressed by 关46兴 011136-2 PHYSICAL REVIEW E 82, 011136 共2010兲 DETRENDING MOVING AVERAGE ALGORITHM FOR… 10 0 4 10 (a) (b) 2 0 τ(q) Fq (n) MFDMA,θ=0 MFDMA,θ=0.5 MFDMA,θ=1 MFDFA −5 −2 −4 MFDMA,θ=0 MFDMA,θ=0.5 MFDMA,θ=1 MFDFA −6 10 −10 1 2 10 10 −8 −4 3 10 n 0.4 −3 −2 −1 0 1 q 2 (d) 0.8 f (α) ∆τ(q) 0.2 0 −0.4 −4 4 1 (c) −0.2 3 MFDMA,θ=0 MFDMA,θ=0.5 MFDMA,θ=1 MFDFA −3 −2 −1 0.6 0.4 MFDMA,θ=0 MFDMA,θ=0.5 MFDMA,θ=1 MFDFA 0.2 0 q 1 2 3 0 0.4 4 0.6 0.8 1 α 1.2 1.4 1.6 FIG. 1. 共Color online兲 Multifractal analysis of the one-dimensional multifractal binomial measure using the three MFDMA algorithms and the MFDFA approach. 共a兲 Power-law dependence of the fluctuation functions Fq共n兲 with respect to the scale n for q = −4, q = 0, and q = 4. The straight lines are the best power-law fits to the data. The results have been translated vertically for better visibility. 共b兲 Multifractal mass exponents 共q兲 obtained from the MFDMA and MFDFA methods with the theoretical curve shown as a solid line. 共c兲 Differences ⌬共q兲 between the estimated mass exponents and their theoretical values for the four algorithms. 共d兲 Multifractal spectra f共␣兲 with respect to the singularity strength ␣ for the four methods. The continuous curve is the theoretical multifractal spectrum. th共q兲 = − ln共pq1 + pq2兲 , ln 2 共10兲 which has been illustrated in Fig. 1共b兲 as well. In order to quantitatively evaluate the performance of MFDMA and MFDFA, we calculate the relative estimation errors of the numerical values of 共q兲 in reference to the corresponding theoretical values th共q兲, ⌬共q兲 = 共q兲 − th共q兲, 共11兲 which are shown in Fig. 1共c兲. When 0 ⬍ q ⱕ 4, all the four methods underestimate the 共q兲 exponents. In contrast, when −4 ⱕ q ⬍ 0, these methods overestimate the scaling exponents with a few exceptions for the backward MFDMA case. It is evident that the backward MFDMA method 共 = 0兲 gives the most accurate estimation of the exponents, the forward MFDMA method 共 = 1兲 has the second best performance, and the centered MFDMA method 共 = 0.5兲 performs worst. We stress that both the backward and the forward MFDMA methods outperform the MFDFA approach. According to the Legendre transform, we can numerically calculate the singularity strength functions ␣共q兲 and the multifractal spectrum functions f共␣兲 with Eq. 共9兲 for the four methods, which are depicted in Fig. 1共d兲. We also show the TABLE I. The MFDMA exponents h共q兲 for q = −4, −2, 0, 2, and 4 of the one-dimensional synthetic multifractal measure with the parameters p1 = 0.3 and p2 = 0.7 using the MFDMA 共 = 0, = 0.5, and = 1兲 and MFDFA methods. The numbers in the parentheses are the standard errors of the regression coefficient estimates using the t test at the 5% significance level. MFDMA q =0 = 0.5 =1 MFDFA Analytical −4 −2 0 2 4 1.505共4兲 1.354共3兲 1.114共4兲 0.874共6兲 0.749共9兲 1.401共12兲 1.249共8兲 1.022共5兲 0.788共3兲 0.667共4兲 1.496共2兲 1.337共4兲 1.096共5兲 0.859共5兲 0.736共6兲 1.490共17兲 1.326共9兲 1.074共6兲 0.804共11兲 0.670共15兲 1.499 1.359 1.126 0.893 0.753 011136-3 PHYSICAL REVIEW E 82, 011136 共2010兲 GAO-FENG GU AND WEI-XING ZHOU 1 1 (a) 10 10 10 −1 q=−4 q=−2 q=0 q=2 q=4 −2 −3 10 (b) 0.9 0 f (α) Fq (n) 10 Real data Shuffled data 1 10 2 10 n 3 0.8 2 0.7 τ (q) 10 0 −2 0.6 −4 −4 0.5 0.3 4 10 0.4 0.5 −2 α 0 q 2 0.6 4 0.7 0.8 FIG. 2. 共Color online兲 Multifractal analysis of the 5 min return time series of the SSEC Index using the backward MFDMA method. 共a兲 Power-law dependence of the fluctuation functions F共n兲 with respect to the scale n. The solid lines are the least-squares fits to the data. The results corresponding to q = −4, q = −2, q = 0, q = 2, and q = 4 have been translated vertically for clarity. 共b兲 Multifractal spectra f共␣兲 of the raw return series of the SSEC Index and its shuffled series. Inset: multifractal scaling exponents 共q兲 as a function of q. theoretical singularity spectrum as a continuous curve for comparison, where the singularity strength function ␣共q兲 can be calculated as follows: ␣th共q兲 = − pq1 ln p1 + pq2 ln p2 共pq1 + pq2兲ln 2 , 共12兲 and the multifractal spectrum is f th共q兲 = − qpq1 ln p1 + qpq2 ln p2 共pq1 + pq2兲ln 2 + ln共pq1 + pq2兲 . ln 2 共13兲 It also shows that the order of the algorithm performance is the following: backward MFDMA, forward MFDMA, MFDFA, and centered MFDMA. We also apply the four methods to the synthetic signals with different sample sizes 共210 and 218兲 and obtain similar results. return series of the SSEC Index has multifractal nature. The nonlinearity of the 共q兲 curve in the inset confirms the presence of multifractality in the return series. We shuffle the return time series and reconstruct a surrogate index. We then perform backward MFDMA analysis of the surrogate index. The results are also illustrated in Fig. 2共b兲. We find that the singularity spectrum shrinks much and the 共q兲 function is almost linear, which implies that the fat-tailedness of the returns plays a minor role in producing the observed multifractality and the correlation structure is the main cause of multifractality. This observation is quite interesting since it is different from the conclusion that the fat-tailedness of the returns is the main origin of multifractality according to the MFDFA method 关49兴. III. TWO-DIMENSIONAL MULTIFRACTAL DETRENDING MOVING AVERAGE ANALYSIS C. Application to intraday SSEC Index time series We now apply the one-dimensional backward MFDMA method to the study of the multifractal properties of 5 min return series of the SSEC Index within the time period from January 2003 to April 2008. The number of data points is about 105. In Fig. 2共a兲, we present the fluctuation function Fq共n兲 with respect to the scale n. It is found that the function Fq共n兲 and the scale n have a sound power-law relation. The MFDMA exponents h共q兲 can be estimated by the slopes of the straight lines illustrated in Fig. 2共a兲 for different q’s. Using the least-squares fitting method, we have h共−4兲 = 0.660⫾ 0.005, h共−2兲 = 0.624⫾ 0.002, h共0兲 = 0.591⫾ 0.001, h共2兲 = 0.531⫾ 0.003, and h共4兲 = 0.493⫾ 0.008. Since h共2兲 is close to 0.5, it is confirmed that the return time series of the SSEC Index is almost uncorrelated, which is consistent with the earlier empirical results. Figure 2共b兲 shows the multifractal spectrum f共␣兲 of return series of the SSEC Index. The strength of multifractality can be characterized by the span of the multifractal singularity strength function, that is, ⌬␣ = ␣max − ␣min. If ⌬␣ is large, the return series owns multifractality, while the return series is almost monofractal if ⌬␣ gets close to zero. We observe in the figure that ⌬␣ = 0.72− 0.39= 0.33, which means that the A. Algorithm The two-dimensional MFDMA algorithm is used to investigate possible multifractal properties of surfaces, which can be denoted by a two-dimensional matrix X共i1 , i2兲 with i1 = 1 , 2 , . . . , N1 and i2 = 1 , 2 , . . . , N2. The algorithm is described as follows: Step 1. Calculate the sum Y共i1 , i2兲 in a sliding window with size n1 ⫻ n2, where n1 ⱕ i1 ⱕ N1 − 共n1 − 1兲1 and n2 ⱕ i2 ⱕ N2 − 共n2 − 1兲2. The two position parameters 1 and 2 vary in the range 关0,1兴. Specifically, we extract a submatrix Z共u1 , u2兲 with size n1 ⫻ n2 from the matrix X, where i1 − n1 + 1 ⱕ u1 ⱕ i1 and i2 − n2 + 1 ⱕ u2 ⱕ i2. We can calculate the sum Y共i1 , i2兲 of Z as follows: n1 Y共i1,i2兲 = n2 兺 兺 Z共j1, j2兲. 共14兲 j1=1 j2=1 Step 2. Determine the moving average function Ỹ共i1 , i2兲, where n1 ⱕ i1 ⱕ N1 − 共n1 − 1兲1 and n2 ⱕ i2 ⱕ N2 − 共n2 − 1兲2. We first extract a submatrix W共k1 , k2兲 with size n1 ⫻ n2 from the matrix X, where k1 − 共n1 − 1兲共1 − 1兲 ⱕ k1 ⱕ k1 + 共n1 − 1兲1 and k2 − 共n2 − 1兲共1 − 2兲 ⱕ k2 ⱕ k2 + 共n2 − 1兲2. 011136-4 DETRENDING MOVING AVERAGE ALGORITHM FOR… PHYSICAL REVIEW E 82, 011136 共2010兲 Then we calculate the cumulative sum W̃共m1 , m2兲 of W, cascading process to synthesize the two-dimensional multifractal measure. The process begins with a square, and we partition it into four subsquares with the same size. We then assign four proportions of measure p1, p2, p3, and p4 to them 共such that p1 + p2 + p3 + p4 = 1兲. Each subsquare is further partitioned into four smaller squares and the measure is reassigned with the same proportions. The procedure is repeated ten times and we finally generate the two-dimensional multifractal measure with size 1024⫻ 1024. In the paper, the model parameters are p1 = 0.1, p2 = 0.2, p3 = 0.3, and p4 = 0.4. In Fig. 3共a兲, we depict the fluctuation functions Fq共n兲 of the two-dimensional multifractal measure for three MFDMA algorithms with = 0, = 0.5, and = 1 described in Sec. III A and the two-dimensional MFDFA method 关26兴. We find that every Fq共n兲 function scales excellently as a power law of n. Linear least-squares regressions of ln关Fn共q兲兴 against ln共n兲 for each q give the estimates of h共q兲. Table II shows the resultant values of h共q兲 for q = −4, −2, 0, 2, and 4. Similar to the results of the one-dimensional MFDMA and MFDFA methods, we find that the three two-dimensional MFDMA algorithms give better power-law scaling relations than the MFDFA algorithm with smaller standard errors in the parentheses except for the forward MFDMA with = 1 when q = −4. Compared with the theoretical values in the last column of Table II, the backward MFDMA with = 0 gives the most accurate estimates and thus has the best performance. In Fig. 3共b兲, we plot the multifractal scaling exponents 共q兲 estimated from the three MFDMA algorithms and the MFDFA method. The theoretical results are also shown for comparison, which are calculated as follows: m2 m1 W̃共m1,m2兲 = 兺 兺 W共d1,d2兲, 共15兲 d1=1 d2=1 where 1 ⱕ m1 ⱕ n1 and 1 ⱕ m2 ⱕ n2. The moving average function Ỹ共i1 , i2兲 can be calculated as follows; n Ỹ共i1,i2兲 = n 1 2 1 兺 兺 W̃共m1,m2兲. n1n2 m1=1 m2=1 共16兲 Step 3. Detrend the matrix by removing the moving average function Ỹ共i1 , i2兲 from Y共i1 , i2兲 and obtain the residual matrix ⑀共i1 , i2兲 as follows: ⑀共i1,i2兲 = Y共i1,i2兲 − Ỹ共i1,i2兲, 共17兲 where n1 ⱕ i1 ⱕ N1 − 共n1 − 1兲1 and n2 ⱕ i2 ⱕ N2 − 共n2 − 1兲2. Step 4. The residual matrix ⑀共i1 , i2兲 is partitioned into Nn1 ⫻ Nn2 disjoint rectangle segments of the same size n1 ⫻ n2, where Nn1 = 共N1 − n1共1 + 1兲兲 / n1 and Nn2 = 共N2 − n2共1 + 2兲兲 / n2. Each segment can be denoted by ⑀v1,v2 such that ⑀v1,v2共i1 , i2兲 = ⑀共l1 + i1 , l2 + i2兲 for 1 ⱕ i1 ⱕ n1 and 1 ⱕ i2 ⱕ n2, where l1 = 共v1 − 1兲n1 and l2 = 共v2 − 1兲n2. The detrended fluctuation Fv1,v2共n1 , n2兲 of segment ⑀v1,v2共i1 , i2兲 can be calculated as follows: n F2v ,v 共n1,n2兲 1 2 n 1 1 2 2 = 兺 兺 ⑀ 共i1,i2兲. n1n2 i1=1 i2=1 v1,v2 共18兲 Step 5. The qth-order overall fluctuation function Fq共n兲 is calculated as follows: Fq共n兲 = 再 Nn Nn 1 2 1 Fq 共n1,n2兲 兺 兺 Nn1Nn2 v1=1 v2=1 v1,v2 冎 1/q , 共19兲 where n2 = 21 共n21 + n22兲 and q can take any real values except for q = 0. When q = 0, we have Nn Nn 1 2 1 ln关F0共n兲兴 = 兺 兺 ln关Fv1,v2共n1,n2兲兴, Nn1Nn2 v1=1 v2=1 共20兲 according to L’Hôspital’s rule. Step 6. Varying the segment sizes n1 and n2, we are able to determine the power-law relation between the fluctuation function Fq共n兲 and the scale n, Fq共n兲 ⬃ nh共q兲 . th共q兲 = − 共21兲 In this paper, we particularly adopt n = n1 = n2 and = 1 = 2 for the isotropic implementation of the two-dimensional MFDMA algorithm. Applying Eqs. 共8兲 and 共9兲, we can obtain the multifractal scaling exponent 共q兲, the singularity strength function ␣共q兲, and the multifractal spectrum f共␣兲, respectively. For the two-dimensional multifractal measures, we have D f = 2 in Eq. 共8兲. B. Numerical experiments In order to investigate the performance of the twodimensional MFDMA methods, we adopt the multiplicative ln共pq1 + pq2 + pq3 + pq4兲 . ln 2 共22兲 According to Fig. 3共b兲, we find that the four 共q兲 curves estimated from the MFDMA and MFDFA methods are also close to the theoretical values. To have a better visibility, we plot the difference functions ⌬共q兲 = 共q兲 − th共q兲 in Fig. 3共b兲. For positive values of q, the algorithms underestimate the 共q兲 values. It is clear that the backward MFDMA with = 0 performs best, the forward MFDMA with = 1 performs worst, and the MFDFA outperforms the centered MFDMA with = 0.5. For negative values of q, most ⌬ values are larger than zero. We find that the backward MFDMA has the best performance, the MFDFA has the worse performance, and the performance of the centered and forward MFDMA methods are comparable to each other. These findings are further confirmed by the results illustrated in Fig. 3共d兲 for the multifractal spectra. IV. DISCUSSION AND CONCLUSION In this paper, we have developed the detrending moving average techniques to make them suitable for the analysis of multifractal measures in one and two dimensions. Extensions to higher dimensions are straightforward. The performance of these MFDMA algorithms is tested based on numerical experiments of synthetic multifractal measures with known theoretical multifractal properties generated according to multiplicative cascading processes. We also present the re- 011136-5 PHYSICAL REVIEW E 82, 011136 共2010兲 GAO-FENG GU AND WEI-XING ZHOU MFDMA,θ=0 MFDMA,θ=0.5 MFDMA,θ=1 MFDFA −5 10 (a) (b) 5 τ(q) Fq (n) 0 −5 MFDMA,θ=0 MFDMA,θ=0.5 MFDMA,θ=1 MFDFA −10 10 −10 1 2 10 −4 10 n f (α) ∆τ(q) 1 2 3 4 1.5 0 −0.1 −0.5 −4 0 q (d) 0.1 −0.4 −1 (c) 0.2 −0.3 −2 2 0.3 −0.2 −3 MFDMA,θ=0 MFDMA,θ=0.5 MFDMA,θ=1 MFDFA −3 −2 −1 1 MFDMA,θ=0 MFDMA,θ=0.5 MFDMA,θ=1 MFDFA 0.5 0 q 1 2 3 0 4 1.5 2 α 2.5 3 FIG. 3. 共Color online兲 Multifractal analysis of the two-dimensional multifractal measure using the three MFDMA algorithms and the MFDFA approach. 共a兲 Power-law dependence of the fluctuation functions Fq共n兲 with respect to the scale n for q = −4, q = 0, and q = 4. The straight lines are the best power-law fits to the data. The results have been translated vertically for better visibility. 共b兲 Multifractal mass exponents 共q兲 obtained from the MFDMA and MFDFA methods with the theoretical curve shown as a solid line. 共c兲 Differences ⌬共q兲 between the estimated mass exponents and their theoretical values for the four algorithms. 共d兲 Multifractal spectra f共␣兲 with respect to the singularity strength ␣ for the four methods. The continuous curve is the theoretical multifractal spectrum. sults of MFDFA for comparison. Our main conclusion is that the backward MFDMA with the parameter = 0 exhibits the best performance when compared with the centered MFDMA, forward MFDMA, and MFDFA, because it gives better power-law scaling in the fluctuation functions and more accurate estimates of the multifractal scaling exponents and the singularity spectrum. For the one-dimensional MFDMA version, we find that MFDMA gives a more reliable regression in the log-log plot of the fluctuation function Fq共n兲 with respect to the scale n than MFDFA. Comparing with the theoretical formulas of 共q兲 and f共␣兲, the backward MFDMA performs best, the centered MFDMA performs worst, and the forward MFDMA outperforms the MFDFA. The backward MFDMA with = 0 is applied to the analysis of the return time series of the SSEC Index and confirms that the return series exhibits multifractal nature, which is not caused by the fat-tailedness of the return distribution. For the two-dimensional MFDMA version, we also find that MFDMA gives a more reliable regression than MFDFA when testing on the two-dimensional synthetic multifractal measure. The estimates of 共q兲 and f共␣兲 well agree with the theoretical values for the backward MFDMA with = 0, which is the best estimator. The centered and forward TABLE II. The MFDMA exponents h共q兲 for q = −4, −2, 0, 2, and 4 of the two-dimensional synthetic multifractal measure with the parameters p1 = 0.1, p2 = 0.2, p3 = 0.3, and p4 = 0.4 using the MFDMA 共 = 0, = 0.5, and = 1兲 and MFDFA methods. The numbers in the parentheses are the standard errors of the regression coefficient estimates using the t test at the 5% significance level. MFDMA q =0 = 0.5 =1 MFDFA Analytical −4 −2 0 2 4 2.850共7兲 2.534共6兲 2.114共10兲 1.829共19兲 1.688共25兲 2.857共11兲 2.505共14兲 2.041共13兲 1.751共10兲 1.615共10兲 2.860共42兲 2.503共22兲 2.017共15兲 1.720共10兲 1.586共11兲 2.780共20兲 2.461共23兲 2.064共20兲 1.769共30兲 1.616共43兲 2.849 2.577 2.176 1.869 1.705 011136-6 PHYSICAL REVIEW E 82, 011136 共2010兲 DETRENDING MOVING AVERAGE ALGORITHM FOR… MFDMA methods with = 0.5 and = 1 give a better estimation than MFDFA in the negative range of q’s, while they are worse than MFDFA for positive q. Technically, it is crucial to emphasize that the window size 共n for one-dimensional MFDMA or n1 ⫻ n2 for twodimensional MFDMA兲 used to determine the moving average function 关ỹ共i兲 for one-dimensional version or Ỹ共i1 , i2兲 for two-dimensional version兴 in step 2 must be identical to the partitioning segment size in step 4. If the window size is not equal to the segment size, the fluctuation function Fq共n兲 does not show power-law dependence on the scale n, and the multifractal scaling exponent 共q兲 and the multifractal spectrum f共␣兲 estimated from the MFDMA remarkably deviate from the theoretical ones. Finally, we would like to stress that there are tremendous potential applications of the backward MFDMA method in We acknowledge financial support from the Fundamental Research Funds for the Central Universities and the Program for New Century Excellent Talents in University 共Grant No. NCET-07-0288兲. 关1兴 B. B. Mandelbrot, The Fractal Geometry of Nature 共W. H. Freeman, New York, 1983兲. 关2兴 B. B. Mandelbrot, Fractals and Scaling in Finance 共Springer, New York, 1997兲. 关3兴 D. Sornette, Critical Phenomena in Natural Sciences—Chaos, Fractals, Self-Organization and Disorder: Concepts and Tools, 2nd ed. 共Springer, Berlin, 2004兲. 关4兴 H. E. Hurst, Trans. Am. Soc. Civ. Eng. 116, 770 共1951兲. 关5兴 B. B. Mandelbrot and J. R. Wallis, Water Resour. Res. 5, 242 共1969兲. 关6兴 J. Alvarez-Ramirez, J. C. Echeverria, and E. Rodriguez, Physica A 387, 6452 共2008兲. 关7兴 M. Holschneider, J. Stat. Phys. 50, 963 共1988兲. 关8兴 J.-F. Muzy, E. Bacry, and A. Arnéodo, Phys. Rev. Lett. 67, 3515 共1991兲. 关9兴 E. Bacry, J.-F. Muzy, and A. Arnéodo, J. Stat. Phys. 70, 635 共1993兲. 关10兴 J.-F. Muzy, E. Bacry, and A. Arnéodo, Phys. Rev. E 47, 875 共1993兲. 关11兴 J.-F. Muzy, E. Bacry, and A. Arnéodo, Int. J. Bifurcation Chaos 4, 245 共1994兲. 关12兴 A. Arnéodo, D. Decoster, and S. G. Roux, Eur. Phys. J. B 15, 567 共2000兲. 关13兴 N. Decoster, S. G. Roux, and A. Arnéodo, Eur. Phys. J. B 15, 739 共2000兲. 关14兴 S. G. Roux, A. Arnéodo, and N. Decoster, Eur. Phys. J. B 15, 765 共2000兲. 关15兴 P. Kestener and A. Arneodo, Phys. Rev. Lett. 91, 194501 共2003兲. 关16兴 P. Kestener and A. Arneodo, Phys. Rev. Lett. 93, 044501 共2004兲. 关17兴 M. Taqqu, V. Teverovsky, and W. Willinger, Fractals 3, 785 共1995兲. 关18兴 A. Montanari, M. S. Taqqu, and V. Teverovsky, Math. Comput. Modell. 29, 217 共1999兲. 关19兴 B. Audit, E. Bacry, J.-F. Muzy, and A. Arnéodo, IEEE Trans. Inf. Theory 48, 2938 共2002兲. 关20兴 C.-K. Peng, S. V. Buldyrev, S. Havlin, M. Simons, H. E. Stanley, and A. L. Goldberger, Phys. Rev. E 49, 1685 共1994兲. 关21兴 G.-F. Gu and W.-X. Zhou, Physica A 383, 497 共2007兲. 关22兴 G.-F. Gu, W. Chen, and W.-X. Zhou, Eur. Phys. J. B 57, 81 共2007兲. 关23兴 G.-F. Gu, W. Chen, and W.-X. Zhou, Physica A 387, 5182 共2008兲. 关24兴 Z.-Q. Jiang, W. Chen, and W.-X. Zhou, Physica A 388, 433 共2009兲. 关25兴 J. W. Kantelhardt, S. A. Zschiegner, E. Koscielny-Bunde, S. Havlin, A. Bunde, and H. E. Stanley, Physica A 316, 87 共2002兲. 关26兴 G.-F. Gu and W.-X. Zhou, Phys. Rev. E 74, 061104 共2006兲. 关27兴 B. Podobnik and H. E. Stanley, Phys. Rev. Lett. 100, 084102 共2008兲. 关28兴 W.-X. Zhou, Phys. Rev. E 77, 066211 共2008兲. 关29兴 A. Carbone, Science and Technology for Humanity 共TIC-STH兲 IEEE, 2009 共IEEE, Piscataway, NJ兲, p. 691–696. 关30兴 N. Vandewalle and M. Ausloos, Phys. Rev. E 58, 6832 共1998兲. 关31兴 E. Alessio, A. Carbone, G. Castelli, and V. Frappietro, Eur. Phys. J. B 27, 197 共2002兲. 关32兴 A. Carbone and G. Castelli, Proc. SPIE 5114, 406 共2003兲. 关33兴 A. Carbone, G. Castelli, and H. E. Stanley, Physica A 344, 267 共2004兲. 关34兴 A. Carbone, G. Castelli, and H. E. Stanley, Phys. Rev. E 69, 026105 共2004兲. 关35兴 P. A. Varotsos, N. V. Sarlis, H. K. Tanaka, and E. S. Skordas, Phys. Rev. E 71, 032102 共2005兲. 关36兴 A. Serletis and A. A. Rosenberg, Physica A 380, 325 共2007兲. 关37兴 S. Arianos and A. Carbone, Physica A 382, 9 共2007兲. 关38兴 R. Matsushita, I. Gleria, A. Figueiredo, and S. D. Silva, Phys. Lett. A 368, 173 共2007兲. 关39兴 A. Serletis and A. A. Rosenberg, Chaos, Solitons Fractals 40, 2007 共2009兲. 关40兴 A. Carbone and H. E. Stanley, Physica A 340, 544 共2004兲. 关41兴 L. M. Xu, P. C. Ivanov, K. Hu, Z. Chen, A. Carbone, and H. E. Stanley, Phys. Rev. E 71, 051101 共2005兲. 关42兴 D. Serletis, Chaos, Solitons Fractals 38, 921 共2008兲. 关43兴 A. Carbone, Phys. Rev. E 76, 056703 共2007兲. 关44兴 C. Türk, A. Carbone, and B. M. Chiaia, Phys. Rev. E 81, 026706 共2010兲. multifractal analysis due to the better performance of this algorithm compared with the extensively used MFDFA approach. The MFDMA algorithms are easy to implement 关50兴. Possible applications include time series 共one dimensional兲, fracture surfaces, landscapes, clouds, and many other images possessing self-similar properties 共two dimensional兲, temperature and concentration fields 共three dimensional兲, and strange attractors in nonlinear dynamics 共higher dimensional兲. ACKNOWLEDGMENTS 011136-7 PHYSICAL REVIEW E 82, 011136 共2010兲 GAO-FENG GU AND WEI-XING ZHOU 关45兴 A. Bashan, R. Bartsch, J. W. Kantelhardt, and S. Havlin, Physica A 387, 5080 共2008兲. 关46兴 T. C. Halsey, M. H. Jensen, L. P. Kadanoff, I. Procaccia, and B. I. Shraiman, Phys. Rev. A 33, 1141 共1986兲. 关47兴 C. Meneveau and K. R. Sreenivasan, Phys. Rev. Lett. 59, 1424 共1987兲. 关48兴 W.-X. Zhou and D. Sornette, Physica A 388, 2623 共2009兲. 关49兴 W.-X. Zhou, EPL 88, 28004 共2009兲. 关50兴 See supplementary material at http://link.aps.org/supplemental/ 10.1103/PhysRevE.82.011136 for the MATLAB codes implementing the one- and two-dimensional MFDMA algorithms. 011136-8