Investigating detrended fluctuation analysis with structural breaks

Detrended Fluctuation Analysis has been used in several fields of science to study the statistical properties of trend stationary and nonstationary time-series. Its application to financial data has produced important results concerning long-range correlations and long-memory. However, these results may be contaminated if the researcher attributes to nonstationary trends the effect of stationary trends with endogenous structural breaks. Our paper proposes a modified DFA model where boxes to determine local trends are replaced by endogenous structural break windows. We also allow local trends fitted by quadratic functions and use squared residuals in place of patchy standard deviations to study the magnitude of the power-law exponent. The results show that our modified DFA model performs better than the fixed length alternatives originally proposed, and is, therefore, a suitable model to fit with financial data. Consistently with previous findings, our results show positive long-range correlation in all indices with the higher value for emerging markets.


Introduction
Many researchers have attempted to model the statistical properties of stock market prices and returns. This has led to the proposal of a huge number of models and techniques capable of dealing with the peculiarities of financial data. One of these techniques, born in the context of statistical physics, is called Detrended Fluctuation Analysis. This technique has gained some popularity among researchers given its simplicity and the successful results achieved.
In spite of this, the use of this technique with financial data still needs some improvements, given the specificities of these data. One such specificity is the occurrence of structural breaks in time series that are relatively long. Structural breaks usually occur at irregular intervals and should not be defined exogenously in relation with the chronological sequence of the series.
In this paper we propose a modified DFA model that accommodates structural breaks which are determined endogenously on the basis of the observed data. After the computation of break dates, we define the patches on the basis of each irregular break interval then obtained.
The forecasts are then computed within each patch using a nonlinear deterministic trend to fit the data. themselves to evaluate the power-law assumption. Finally, in order to evaluate the performance of our model in comparison with alternative models similar to the conventional DFA, we perform both in-sample and out-of-sample forecast accuracy tests. Our model was tested with four stock market aggregated indexes published by Morgan Stanley Capital International (MSCI). The level of aggregation varies since the main purpose of this paper is to analyze and select the best fit in different contexts and levels of data aggregation. As we shall see, our modified DFA model yields in general better results than the fixed-length models tested as alternatives, confirming that accounting for endogenous structural breaks improves the overall fit of our data. Our results indicate the presence of positive long-range correlation in all indices.
The rest of the paper is organized as follows. In the next section we provide the background to the study and summarize some features of conventional detrended fluctuation analysis.
Next, we present in three steps our model of integrated price returns with structural breaks and the data used at each step for the four indexes under analysis. The following section discusses the main empirical results and section 5 compares the forecast accuracy of the models, both in-sample and out-of-sample, in order to ascertain whether our model performs better than the conventional model or not. In the final section we draw some conclusions of our study.

Background
Since the influential paper of Peng et al. [1] which introduced Detrended Fluctuation Analysis (DFA) to study the properties of DNA nucleotides, many empirical researchers have used this technique with applications to several fields of science. In finance there have been some applications too, but there is no evidence that the original model has been modified to accommodate financial data oddities. One such oddity concerns the occurrence of structural breaks that may be mistaken by stochastic non-stationarities in the data and lead to spurious results.
Peng et al. [1] argue that DFA permits the detection of long-range correlations embedded in a patchy landscape and avoids the spurious detection of apparent long-range correlations that are an artifact of patchiness . This mention is related to the replacement of the unique longrun trend embedded in the data by local trends within patches, but in fact stochastic trends and structural breaks are overlooked in this process. Others argue that DFA allows the distinction of intrinsic autocorrelation from that imposed by external nonstationary movements. Intrinsic autocorrelation is associated with memory effects in the underlying dynamic system, but the existence of nonstationary movements on their own should not be ignored. Therefore, rather than computing local forecasts within patches simply on the basis of deterministic trends, and ignoring local stochastic trends, we may utilize a general nonstationary framework and test whether the residuals obtained from regressing actual on fitted local values are stationary, i.e. actual and fitted values must be cointegrated both in mean and in variance.
Another advantage of detrended fluctuation analysis is that it can be used to assess multiscale autocorrelation [2]. Multiscale in this context refers to different data frequencies or resolutions, where higher frequencies are associated with finer scales and lower frequencies are associated with coarser scales. Fine scales typically involve noise problems that need to be purged while coarse scales may suffer from time aggregation problems. However, in the context of fractal geometry, detrended fluctuation analysis has been used to assess the statistical self-affinity of a time series at different times. Self-affinity occurs when a set can be decomposed into subsets that can be linearly mapped into the full set, with special cases being called self-similarity. In this way, fractal objects are defined as shapes made of parts similar to the whole in some way, such that different data scales would not lead to different results or structures, i.e. a fractal object is self-similar or self-affine at any scale.
In finance, Ref. [3] studies multifractal detrended fluctuation analysis in the German stock market using tick data for six stocks traded in the Deutsche Börse and concludes that the scaling exponent lies around 0.5 or less, indicating that no significant autocorrelations exist.
Ref. [4] analyses the multifractality degree of developed and emerging stock market indices.
Their results show that the multifractality degree is inversely associated with the stage of market development, with most developed markets exhibiting scaling exponents around 0.5 or less and emerging markets showing scaling exponents typically above 0.5, and imply that the multifractality degree may be used to assess stages of stock market development. Ref. [5] also uses multifractal detrended fluctuation analysis, along with multifractal spectrum analysis, to analyze 10-minute closing prices of the Chinese stock index futures market, and found that this market exhibits long-range correlations and multifractality, consistent with a scaling exponent higher than 0.5. Similar results for the Asian stock markets were obtained by [6] using coupling detrended fluctuation analysis. Finally, Ref. [7] combines detrended for the scaling exponent show that it exceeds 0.5 in most markets and the higher the value the less efficient is the underlying market. Therefore, we may conclude that emerging markets tend to be less efficient than developed markets but, although the empirical evidence is consistent across different studies, none of these actually proposes modifications to the underlying basic model to accommodate singularities of the financial market data.
The use of the DFA technique leads to objects that can be statistically treated as power-laws where the power-law exponent describes the type of long-range correlation and memory effects that characterize the specific data under study [8,9]. Taking full advantage of this relationship, one can define with precision what kind of time-series we are dealing with and what are the main features of our data. Under cointegration of the detrended walk, DFA can be used either with stationary and nonstationary data without misleading results [10,11,12]. As we show in the next section, this paper proposes a modified Detrended Fluctuation Analysis model, where the above-mentioned steps are going to be changed in order to accommodate structural breaks and obtain better estimates of the model parameters.

H istorical Price Returns
As noted above, the main purpose of this study is to analyze and select the best fit of the distributional signal of prices and returns using four stock market aggregated indexes  Emerging Markets index, in turn, has a correlation of 68% with the World index and 59% with the Pacific index. The lowest correlation occurs between the Pacific and the European indexes (35%) and between the Pacific and the World indexes (40%). All the correlations are significant at the 1% level. These results are not really unexpected, given the increasing degree of volatility contagion observed in financial markets over the past decades, especially in the western economies, and the bulky contribution of European stock markets to the global indexes [13].
The series depicted in Figure 1 show that the volatility of returns varies with time and there is a propensity to cluster the periods of high volatility, that is, high volatility periods follow other periods of high volatility and vice-versa (volatility clustering). Another stylized fact of In other studies, the returns were calculated as the difference of the logarithm of prices at two adjacent points in time, with a similar interpretation.
Throughout this section, and unless otherwise stated, correlation refers to the Pearson correlation coefficient.
many financial time-series is the negative correlation between the volatility of returns and prices, that is, high volatility occurs more frequently when prices drop (leverage effect). In our case, the linear correlation between volatility and prices is negative and statistically significant at the 1% level for the four aggregated indexes: World ( 34%), Emerging Markets ( 11%), Europe ( 30%) and Pacific ( 27%).
Asymmetry, and especially leptokurtosis, are also frequently found in the empirical distribution of stock market returns (leptokurtosis leads to fat or heavy tails). Kurtosis lies around 10 in all cases and, except for the European index, all our series exhibit negative skewness. Negative skewness means that the returns distribution has a long left-tail and, although positive returns are more likely to occur than negative returns, the tail is greater on the left-side. A Jarque-Bera [14] test of the null hypothesis of gaussianity is rejected at the 1% level in the distribution of returns of all our four indexes. Thus, alternative distributions that account for thicker tails may describe better the distribution of returns. The main descriptive statistics of the series are presented in Table 1.

Integrated Series and Structural B reaks
The second step entails the computation of the integrated series of price returns of the four aggregated indexes analyzed. Integration of price returns means to compute the cumulative sum or profile of the series after taking the first difference to its mean: , where x represents the mean value of the returns time-series. Hence, the standardized price series itself is the integrated signal of returns, or just called the integrated signal.
Denoting by d the number of times that a series needs to be differenced in order to remove all the stochastic trends that may exist in the data, then returns are stationary if they are integrated or order d equal to zero. Under these circumstances, prices, that is the cumulative sum of returns, are integrated of first-order, and are said to be nonstationary or unit root processes. The non-stationarity of prices implies that they have stochastic trends which can be captured, for example, using Perron [16] unit root tests with structural breaks. In our case, the Perron tests confirm that all the four price index series are nonstationary and integrated of first-order, which means that they hold one stochastic trend. The series of returns, on the other hand, are all trend stationary. Bai-Perron [17] methodology to determine m endogenous structural breaks was also applied and, within each break window (subsample), conventional ADF unit root tests were performed. The results are presented in Table 2.
In his seminal paper on unit roots with structural breaks, Perron [20] points out that the conventional unit root tests (e.g. ADF) are biased toward a false unit root null when the data are trend stationary with a structural break. A number of modified ADF unit root tests were then proposed by the researchers which allow for levels and trends that differ across single or multiple break dates.
Breaks can occur in different situations, such as: i) gradually (innovational outliers) or immediately (additive outliers), ii) consisting on a level shift, a trend break, or both, iii) the break date is known (exogenous) or unknown and estimated from the data (endogenous), and iv) the data are non-trending or trending. One can thus define an intercept break variable termed that takes the value 0 for all dates prior to the break, and 1 thereafter, a trend break variable named which takes the value 0 for all dates prior to the break and is a break date re-based trend for all subsequent dates, and a one-time break dummy variable given by which takes the value 1 only on the break date and 0 otherwise. 1( ) denotes the indicator function and T b the break date. 3 In this paper we define the break date as the first date of the new regime.  [17] tests of l +1 vs. l globally determined breaks. Perron [16] unit root test with an endogenous structural break in both the intercept and trend. All integrated signals (standardized prices) have a unit root with breaks. Conventional ADF unit root tests [18] without breaks were applied to each patch using MacKinnon [19] one-sided p-values. The ADF null was rejected at standard levels in a number of patches. ** Significant at the 1% level; * significant at the 5% level. Coeff.
ADF-Stat.  Bai and Perron [17] advise a number of strategies for dealing with the choice of endogenous structural breaks using general to specific procedures rather than methods based on information criteria, such as AIC, because, they argue, the latter tend to select very parsimonious models leading to tests with sometimes serious size distortions and/or power losses with data in the class of ARMA processes. Actually, recent research conducted by Hall et al. [21] shows that criteria of Yao [22] and LWZ [23] may underestimate by a factor of 3 the number of m true breaks that have an asymptotic effect on the minimized residual sum of squares and propose a modified penalty term for the information criteria in the context of structural break estimation.
We follow [17] to determine breakpoints and coefficients computed by LS with Breaks, using tests of l +1 vs. l globally determined breaks selected by sequential evaluation, trimming

0.15, HAC standard errors & covariance (Quadratic-Spectral kernel, Andrews bandwidth)
and allowing heterogeneous error distributions across breaks. Breakpoints are the start of the next regime. Under the null, the variable has l endogenous structural breaks in both the intercept and trend. A useful strategy is to first look at the max tests [17] to see if at least one break is present. In this case, then the number of breaks can be decided based upon a sequential examination of the statistics constructed using global minimizers for the break dates, i.e. select m such that the tests are insignificant for l m. As shown in Table 2, all the integrated signals (standardized prices) have a unit root with breaks.
Conventional ADF [18] unit root tests without breaks were also applied to each patch and the null was rejected at standard levels in some cases.
The ADF tests are based on the equation , where and denote, respectively, the intercept and slope of a linear deterministic trend, is the autocorrelation parameter of y t , and denotes a white noise process. The parameters c i are included in the model to capture any remaining serial correlation up to order k on the lefthand side variable. If = 1, then y t is a difference stationary process. In addition, if then y t is a random walk with drift. A random walk process is a unit root or nonstationary process I(d) with d = 1.

C umulative Sum of Price Returns
The integrated series of price returns for the four aggregated indexes here analyzed are depicted in Figure 2. Note that the periods of price decline correspond to the periods of higher volatility shown in Figure 1, upholding the presence of leverage effects in the stock market as mentioned before, together with the recent well-known economic recessions. The breakpoints we have identified using the Bai-Perron [17] methodology (see Table 2 and

Squared Residuals
After generating the cumulative sum of price returns and the underlying 2 nd -degree polynomial fits with structural breaks, we next proceed to the third step, wherein we compute the squared distance (or squared residuals) from the observed to the fitted values of the integrated series X t .
The residuals (or detrended walk) were estimated from , where represents the fitted series (local trend), that is, the piecewise sequence of quadratic regression fits for each patch. Residuals are stationary in mean, as indicated by conventional ADF tests without deterministic terms, not reported here. 4 Therefore, according to the Granger Representation Theorem [24] the actual and fitted series are cointegrated of first order, and hence we obtain nonspurious residuals. Despite this evidence, a Jarque-Bera [14] test of the null of gaussianity is rejected at the 1% level in the distribution of residuals in all cases. Alternative data distributions may be suggested by inspection of the squared residuals distributions represented in Figure 3.

Power-L aw
Outputs not reported are available from the authors upon request.
A natural candidate to replace the Gaussian distribution is the Zeta distribution modeled by Detrended Fluctuation Analysis (DFA) as suggested by Peng et al. [1]. This is also known as the power-law distribution [1,10] with scaling parameter where ( > 0) is the cumulative distribution function of squared residuals. Note that with . Detrended Fluctuation Analysis follows the same route described above to obtain the integrated price return signal. However, the non-overlapped patches are determined in a very different way, since endogenous breakpoints occurring at different lengths (such as in our case) are not considered in DFA and there is no real rational behind the choice of equally lengthened boxes as suggested by [1]. Another difference in our procedure is that we do calculate F(n) as the cumulative distribution function of the squared residuals rather than the average (over all the boxes) of the variances about the detrended walk for each box. In fact, the exponent describes the scaling properties of the entire distribution, including the cumulative distribution function or some other relevant statistics such as the root mean squared error used by [1].
The scaling parameter can be estimated as the slope of a normalized linear regression of the logarithm of F(n) against the logarithm of . If then the series is antipersistent. Anti-persistence means that larger fluctuations are followed by smaller fluctuations and vice-versa. If then the series has positive long-range dependence with persistent or long-memory behavior. If then the integrated price return series is white noise. This means that the autocorrelation function tends to zero and price returns have no significant long-memory. If then the integrated price return series is pink noise. The pink noise autocorrelation function does not decay exponentially as the lag length increases and memory tends to persist. Finally, when , there is longrange correlation that cannot be explained by a power-law. 5 Therefore, the value of the scaling parameter measures the degree of long-range correlation existing in the data [8]. very similar in the four market indexes ranging from 0.57 (World) to 0.67 (Emerging Markets). A Wald test for coefficient restrictions shows that all these estimates are significantly different from 0.5 and 1 at the 1% level. The estimates obtained for the scaling exponent indicate that squared residuals have positive long-range dependence with persistent or long-memory behavior. This behavior seems to be a little bit more mitigated in aggregated series such as the World index and aggravated in regional or sectorial indexes. Since squared fractional integrated models, such as the FIGARCH [25], may produce better estimates for long-memory volatility than those obtained by discrete integrated models, such as the I(0) (stationary) GARCH-type models, which assume no memory [25,26]. 6 However, a broader full discussion of this topic is outside of the scope of this paper.  years of data. The leading conclusion of these results is that researchers should be careful with sample size when dealing with detrended fluctuation analysis (or other models to assess long-range correlation), since small samples may bias the results and conclusions towards short-range correlation. Another problem may arise when the researcher opts to artificially split the full sample into a number of independent patches where the size of each patch is small. Therefore, using endogenous breaks to obtain non-overlapped and independent boxes may provide a relevant alternative to conventional detrended fluctuation analysis.

Forecast Accuracy
We now turn to evaluate the forecast accuracy of our modified model of detrended fluctuation analysis with endogenous structural breaks, using ex post in-sample and out-ofsample forecast accuracy gauges. We use three tests of in-sample forecast accuracy: Root Mean Squared Error (RMSE), Theil inequality coefficient (U) and Theil UII coefficient [27]. Carlo simulation or otherwise could be important to perform in future work.
In order to perform these tests, we computed the four above mentioned gauges for our model with endogenous structural breaks and for three alternatives following the recommendation of Peng et al. [1] where we split the full sample into several equal length patches using an arbitrary size known a priori for each patch. In our case we used the following window sizes to obtain local trends: 100, 300 and 600. The results are presented in Table 3. We first look at the Diebold-Mariano [28] out-of-sample forecast accuracy results displayed in the first column of each block in Table 3. The null hypothesis of equal forecast accuracy is rejected at the 1% level in all cases except one (test l: Breaks against l = 600 for the Emerging Markets index). Under rejection of the null it becomes evident that the models produce different forecast accuracies but the DM test itself does not indicate which model produces the best forecasts. In this case, after knowing that the models produce different levels of accuracy, we may rely on the in-sample tests to make the adequate selection.
Regarding the in-sample forecasts, the results presented above indicate that our model of DFA with endogenous structural breaks performs, in general, better than the alternatives of equal length patches (100, 300 and 600) except for the World index where the l = 600 model appears to perform slightly better. 7 Thus, in spite of some potential limitations caused by the level of World data aggregation, our model appears to outperform conventional models of DFA by imposing less restrictions and especially avoiding the prior selection of patch size.
Nevertheless, the model with structural breaks always performs better than the l = 100 and l = 300 alternatives.

Conclusions
The use of statistical tools to determine the distributional shape of some financial time-series has become widespread in the literature since the recognition of a few stylized features of these data. These features include volatility clustering, long-memory, fat tails, and leverage effect, among others, which overturns the usual Gaussian assumption. In statistical physics, some researchers have used the Riemann Zeta distribution to explain the statistical behavior of these phenomena. This is known in the literature as the power-law distribution which describes a large number of real phenomena. The same occurs with financial data.
Some models and techniques to deal with power-laws have been proposed in the literature.
One such technique is called Detrended Fluctuation Analysis and was originally suggested by Peng et al. [1] in a study of DNA nucleotides. Applications to financial data were also made but some oddities of these data may recommend a few modifications in the original DFA model. One such modification refers to the occurrence of structural breaks in financial data, which recommends that regularly spaced patches are replaced by irregularly spaced intervals where endogenously determined break dates are used as the starting date of a new window.
Another modification refers to the replacement of within patch standard errors by daily observations on squared residuals, in conformity with the idea that squared residuals are a proxy for volatility. Finally, the select accuracy criteria instead of pure visual inspection of overlapped results. Our process, therefore, is more robust and independent of individual researcher judgement than in the conventional DFA model.
Our results show that the modified DFA model performs in general better than the conventional one, where this judgement is made on the basis of pure analytic in-sample and out-of-sample tests. Therefore, structural breaks seem to contain relevant information for the construction of boxes into which the full sample should be split. Another relevant information concerns the determination of the sample size required to reach the crossover value 0.5. Although it changes with the level of data aggregation, we can say that at least four years of daily data are required to obtain stable estimates of the power-law exponent. As in some previous studies, the results obtained exhibit positive long-range correlation, which degree decreases with the level of index aggregation.