detrending moving average algorithm for multifractals

12
arXiv:1005.0877v2 [q-fin.ST] 8 Jun 2010 PRE/MFDMA 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 2 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 (Dated: June 9, 2010) The detrending moving average (DMA) algorithm is a widely used technique to quantify the long-term correlations of non-stationary time series and the long-range correlations of fractal sur- faces, 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 higher-dimensional multifractals, which is a generalization of the DMA method. The performance of the one-dimensional and two-dimensional MFDMA methods is investi- gated 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 out- performs the multifractal detrended fluctuation analysis (MFDFA). 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. PACS numbers: 05.45.Df, 05.40.-a, 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 frac- tals and multifractals. The classic method is the Hurst analysis or rescaled range analysis (R/S) for time se- ries [4, 5] and fractal surfaces [6]. The wavelet trans- form module maxima (WTMM) method is a more pow- erful 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 fluctua- tion analysis (DFA), which has the advantages of easy implementation and robust estimation even for short sig- nals [17–19]. The DFA method was originally invented to study the long-range dependence in coding and noncod- ing 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 meth- ods were also generalized to analyze high-dimensional fractals and multifractals [26]. A more recent method is based on the moving aver- age (MA) or mobile average technique [27], which was * [email protected] first proposed by Vandewalle and Ausloos to estimate the Hurst exponent of self-affinity signals [28] and further developed to the detrending moving average (DMA) by considering the second-order difference between the orig- inal signal and its moving average function [29]. Because the DMA method can be easily implemented to estimate the correlation properties of non-stationary series with- out any assumption, it is widely applied to the analysis of real-world time series [30–37] and synthetic signals [38– 40]. Recently, Carbone extended the one-dimensional DMA method to higher dimensions to estimate the Hurst exponents of higher-dimensional fractals [41, 42]. Exten- sive numerical experiments unveil that the performance of the DMA method are comparable to the DFA method with slightly different priorities under different situations [39, 43]. In this paper, we extend the DMA method to mul- tifractal detrending moving average (MFDMA), which is designed to analyze multifractal time series and multifractal surfaces. Further extensions to higher- dimensional versions are straightforward. The perfor- mance of the MFDMA algorithms is investigated us- ing synthetic multifractal measures with known multi- fractal properties. We also compare the performance of MFDMA with MFDFA, and find that MFDMA is supe- rior to MFDFA for multifractal analysis. The paper is organized as follows. In Sec. II, we de- scribe the algorithm of one-dimensional MFDMA and show the results of numerical simulations. We also ap- ply the one-dimensional MFDMA to analyze the time

Upload: izzat

Post on 17-Aug-2015

23 views

Category:

Documents


0 download

DESCRIPTION

The detrending moving average (DMA) algorithm is a widely used technique to quantify thelong-term correlations of non-stationary time series and the long-range correlations of fractal surfaces,

TRANSCRIPT

arXiv:1005.0877v2 [q-fin.ST] 8 Jun 2010PRE/MFDMADetrendingmovingaveragealgorithmformultifractalsGao-FengGu1, 2andWei-Xing Zhou1, 2, 3, 4, 5, 1School of Business, East ChinaUniversityof ScienceandTechnology, Shanghai 200237, China2ResearchCenterforEconophysics, EastChinaUniversityof ScienceandTechnology, Shanghai 200237, China3School of Science, East ChinaUniversityof ScienceandTechnology, Shanghai 200237, China4EngineeringResearchCenterof Process Systems Engineering(Ministryof Education),East ChinaUniversityof Science andTechnology, Shanghai 200237, China5Research Center onFictitious Economics &DataScience,Chinese Academy of Sciences, Beijing 100080, China(Dated: June9,2010)The detrendingmovingaverage (DMA) algorithmis awidelyusedtechniquetoquantifythelong-termcorrelationsof non-stationarytimeseriesandthelong-rangecorrelationsof fractal sur-faces,which contains a parameterdetermining the positionof the detrending window. We developmultifractal detrendingmovingaverage(MFDMA)algorithmsfortheanalysisof one-dimensionalmultifractal measuresandhigher-dimensional multifractals, whichisageneralizationof theDMAmethod. The performance of the one-dimensional and two-dimensional MFDMA methods is investi-gated using synthetic multifractalmeasures with analytical solutionsfor backward (= 0), centered( = 0.5),andforward(= 1) detrending windows. Wend that theestimatedmultifractalscalingexponent(q) and the singularityspectrumf() areingoodagreement withthe theoreticalvalues.Inaddition, thebackwardMFDMAmethodhasthebest performance, whichprovidesthemostaccurateestimates of thescalingexponents withlowest error bars, whilethecenteredMFDMAmethodhastheworseperformance. ItisfoundthatthebackwardMFDMAalgorithmalsoout-performsthemultifractaldetrendeductuationanalysis(MFDFA).Theone-dimensionalbackwardMFDMAmethodisappliedtoanalyzingthetimeseriesof Shanghai StockExchangeCompositeIndexanditsmultifractal natureisconrmed.PACSnumbers: 05.45.Df,05.40.-a, 05.10.-a,89.75.DaI. INTRODUCTIONFractals andmultifractals are ubiquitous innaturalandsocial sciences[13]. Therearealargenumberofmethods developed to characterize the properties of frac-talsandmultifractals. TheclassicmethodistheHurstanalysis or rescaledrange analysis (R/S) for time se-ries [4, 5] andfractal surfaces [6]. Thewavelet trans-formmodulemaxima(WTMM)methodisamorepow-erful tool toaddressthemultifractality[711], evenforhigh-dimensional multifractal measures inthe elds ofimagetechnologyandthree-dimensionalturbulence[1216]. Anotherpopularmethodisthedetrendeductua-tionanalysis (DFA), whichhas theadvantagesof easyimplementation and robust estimation even for short sig-nals [1719]. The DFA method was originally invented tostudythelong-rangedependenceincodingandnoncod-ingDNAnucleotidessequence[20] andthenappliedtotimeseriesinvariouselds[2124]. TheDFAalgorithmwas extended to analyze the multifractal time series,which is termed as multifractal detrended uctuationanalysis(MFDFA)[25]. TheseDFAandMFDFAmeth-ods were also generalizedto analyze high-dimensionalfractalsandmultifractals[26].Amorerecentmethodisbasedonthemovingaver-age(MA) or mobileaveragetechnique[27], [email protected] proposedbyVandewalle andAusloos toestimatethe Hurst exponent of self-anity signals [28] and furtherdevelopedtothedetrendingmovingaverage(DMA)byconsidering the second-order dierence between the orig-inal signal and its moving average function [29]. Becausethe DMA method can be easily implemented to estimatethecorrelationpropertiesof non-stationaryserieswith-out any assumption, it is widely applied to the analysis ofreal-worldtimeseries[3037] andsyntheticsignals[3840]. Recently, Carbone extendedthe one-dimensionalDMA method to higher dimensions to estimate the Hurstexponents of higher-dimensional fractals [41,42]. Exten-sivenumerical experimentsunveil thattheperformanceof theDMA method are comparable to the DFA methodwith slightly dierent priorities under dierent situations[39,43].Inthis paper, weextendthe DMAmethodtomul-tifractal detrendingmovingaverage(MFDMA), whichis designed to analyze multifractal time series andmultifractal surfaces. Further extensions to higher-dimensional versions are straightforward. The perfor-mance of the MFDMAalgorithms is investigated us-ingsynthetic multifractal measures withknownmulti-fractalproperties. WealsocomparetheperformanceofMFDMAwithMFDFA,andndthatMFDMAissupe-riortoMFDFAformultifractalanalysis.Thepaperisorganizedasfollows. InSec. II, wede-scribe the algorithmof one-dimensional MFDMAandshowtheresultsof numerical simulations. Wealsoap-plythe one-dimensional MFDMAtoanalyzethe time2seriesof intradayShanghai StockExchangeCompositeIndex(SSEC). InSec. III, wedescribethealgorithmoftwo-dimensional MFDMAandreporttheresultsof nu-mericalsimulationsaswell. WediscussandconcludeinSec.IV.II. ONE-DIMENSIONALMULTIFRACTALDETRENDINGMOVINGAVERAGEANALYSISA. AlgorithmStep1. Consideratimeseriesx(t), t =1, 2, , N.Weconstructthesequenceofcumulativesumsy(t) =t

i=1x(i), t = 1, 2, , N. (1)Step2. Calculatethemovingaveragefunctiony(t)inamovingwindow[35], y(t) =1n(n1)(1)

k=(n1)y(t k), (2)where n isthewindow size,x isthelargest integer notgreater thanx, xis thesmallest integer not smallerthanx, andisthepositionparameterwiththevaluevaryingintherange[0, 1]. Hence, themovingaveragefunctionconsiders (n1)(1) datapoints inthepast and(n 1)points inthefuture. Weconsiderthreespecial casesinthis paper. Therstcase=0refers to thebackward moving average [39],in which themovingaveragefunctiony(t) is calculatedover all thepast n 1datapoints of thesignal. Thesecondcase = 0.5 corresponds tothecentered moving average [39],wherey(t) contains half past and half future informationineachwindow. Thethirdcase=1iscalledthefor-wardmovingaverage,wherey(t)considersthetrendofn 1datapointsinthefuture.Step 3. Detrend the signal series by removing the mov-ing average functiony(i) from y(i), and obtain the resid-ualsequence(i)through(i) = y(i) y(i), (3)wheren (n 1)iN (n 1).Step 4. The residual series (i) is dividedinto Nndisjoint segments with the same size n, where Nn=N/n 1. Eachsegment canbe denotedbyvsuchthatv(i)=(l + i)for1in, wherel =(v 1)n.Theroot-mean-squarefunctionFv(n)withthesegmentsizencanbecalculatedbyF2v(n) =1nn

i=12v(i). (4)Step 5. The qth order overall uctuation functionFq(n)isdeterminedasfollows,Fq(n) =

1NnNn

v=1Fqv(n)

1q, (5)whereqcantakeanyrealvalueexceptforq= 0. Whenq= 0,wehaveln[F0(n)] =1NnNn

v=1ln[Fv(n)], (6)accordingtoLH ospitalsrule.Step6. Varyingthevaluesof segmentsizen, wecandeterminethepower-lawrelationbetweenthefunctionFq(n)andthesizescalen,whichreadsFq(n) nh(q). (7)Accordingtothestandardmultifractalformalism,themultifractal scalingexponent(q)canbeusedtochar-acterizethemultifractalnature,whichreads(q) = qh(q) Df, (8)whereDfisthefractaldimensionofthegeometricsup-port of the multifractal measure [25]. For time seriesanalysis,wehaveDf=1. Ifthescalingexponentfunc-tion (q) is a nonlinear function of q, the signal hasmultifractal nature. It is easytoobtainthe singular-ity strength function (q)and themultifractal spectrumf()viatheLegendretransform [44]

(q) = d(q)/dqf(q) = q (q). (9)B. NumericalexperimentsIn the numerical experiments, we generate one-dimensionalmultifractalmeasuretoinvestigatetheper-formanceofMFDMA,which iscompared withMFDFA.Weapplythep-model, amultiplicativecascadingpro-cess, tosynthesizethemultifractal measure[45]. Start-ingfromameasureuniformlydistributedonanin-terval [0, 1]. In the rst step, the measure is redis-tributedontheinterval,1,1= p1tothersthalfand1,2= p2= (1p1) to the second half. One partitionsit into two sub-lines with the same length. In the (k+1)-th step,themeasure k,ion each of the2klinesegmentsisredistributedintotwoparts,wherek+1,2i1= k,ip1andk+1,2i=k,ip2. Werepeat theprocedurefor 14times and nally generate the one-dimensional multi-fractal measurewiththelength214. Inthispaper, wepresent the results whenthe parameters are p1=0.3andp2= 0.7. Theresultsforotherparameters arequal-itativelythesame.31011021031010105100nFq(n) (a)MFDMA,=0MFDMA,=0.5MFDMA,=1MFDFA4 3 2 1 0 1 2 3 48642024q(q) (b)MFDMA,=0MFDMA,=0.5MFDMA,=1MFDFA4 3 2 1 0 1 2 3 40.40.200.20.4q(q) (c)MFDMA,=0MFDMA,=0.5MFDMA,=1MFDFA0.4 0.6 0.8 1 1.2 1.4 1.600.20.40.60.81f() (d)MFDMA,=0MFDMA,=0.5MFDMA,=1MFDFAFIG. 1. (Color online)Multifractal analysisof theone-dimensional multifractal binomial measureusingthethreeMFDMAalgorithmsandtheMFDFAapproach. (a)Power-lawdependenceoftheuctuationfunctionsFq(n)withrespecttothescalenforq=4, q=0, andq=4. Thestraightlinesarethebestpower-lawtstothedata. Theresultshavebeentranslatedverticallyforbettervisibility. (b)Multifractal massexponents(q)obtainedfromtheMFDMAandMFDFAmethodswiththetheoretical curveshownasasolidline. (c)Dierences(q)betweentheestimatedmassexponentsandtheirtheoreticalvaluesforthefouralgorithms. (d)Multifractal spectraf()withrespecttothesingularitystrengthforthefourmethods.Thecontinuouscurveisthetheoreticalmultifractalspectrum.We calculate the uctuation function Fq(n) of the syn-thetical multifractal measure using the MFDMAandMFDFAmethods, andpresenttheuctuationfunctionFq(n)inFig.1(a). WendthatthefunctionFq(n)wellscales with the scale size n. Using the least squares ttingmethod, weobtaintheslopesh(q)forMFDMA(=0,=0.5and=1)andMFDFArespectively,whichareillustratedinTableI. ItisfoundthattheerrorbarsofthethreeMFDMAalgorithmsareall smallerthantheMFDFA method,which implies that it is easier to deter-minethescalingrangesfortheMFDMAalgorithms. Inmostcases, thealgorithmsunderestimatetheh(q) val-uesandthebackwardMFDMAapproach givesthebestestimates. Thereis aninterestingfeatureinFig. 1(a)showingevidentlog-periodicoscillationsintheMFDFAFq(n) curves, which isintrinsic for themultifractal bino-mialmeasure[46].We plot the multifractal scalingexponents (q) ob-tainedfromMFDMA(=0, =0.5and=1)andTABLEI. TheMFDMAexponents h(q) for q =4, -2, 0,2, and4of theone-dimensional syntheticmultifractal mea-surewiththeparameters p1 =0.3andp2 =0.7usingtheMFDMA(=0, =0.5and=1)andMFDFAmethods.Thenumbers intheparentheses arethestandarderrors oftheregressioncoecientestimatesusingthet-testatthe5%signicancelevel.qMFDMAMFDFA Analytic = 0 = 0.5 = 1-4 1.505(4) 1.401(12) 1.496(2) 1.490(17) 1.499-2 1.354(3) 1.249(8) 1.337(4) 1.326(9) 1.3590 1.114(4) 1.022(5) 1.096(5) 1.074(6) 1.1262 0.874(6) 0.788(3) 0.859(5) 0.804(11) 0.8934 0.749(9) 0.667(4) 0.736(6) 0.670(15) 0.753MFDFAinFig.1(b). Thetheoreticalformulaof(q)ofthemultifractal measuregeneratedbythep-model dis-4101102103104103102101100101nFq(n) (a)q=4q=2q=0q=2q=40.3 0.4 0.5 0.6 0.7 0.80.50.60.70.80.91f() (b)Real dataShuffled data4 2 0 2 44202q(q)FIG. 2. (Coloronline)Multifractal analysisof the5-minreturntimeseriesof theSSECindexusingthebackwardMFDMAmethod. (a) Power-lawdependenceof theuctuationfunctions F(n) withrespect tothescale n. Thesolidlines aretheleast-squareststothedata. Theresultscorrespondingtoq=2, q=0, q=2andq=4havebeentranslatedverticallyforclarity. (b)Multifractal spectraf()of therawreturnseriesof SSECanditsshuedseries. Inset: Multifractal scalingexponents(q)asafunctionofq.cussedabovecanbeexpressed by[44]th(q) = ln(pq1 + pq2)ln 2, (10)which has been illustrated in Fig. 1(b) as well. In order toquantitatively evaluate the performance of MFDMA andMFDFA, we calculate the relative estimation errors of thenumerical values of (q) in reference to the correspondingtheoreticalvaluesth(q)(q) = (q) th(q), (11)whichareshowninFig. 1(c). When0