mfdfa {fractalRegression} | R Documentation |
Multifractal Detrended Fluctuation Analysis
Description
Fast function for computing multifractal detrended fluctuation analysis (MF-DFA), a widely used method for estimating the family of long-range temporal correlations or scaling exponents in time series data. MF-DFA is also a form of multifractal analysis that indicates the degree of interaction across temporal scales.
Usage
mfdfa(x, q, order, scales, scale_ratio)
Arguments
x |
A real valued vector (i.e., time series data) to be analyzed. |
q |
A real valued vector indicating the statistical moments (q) to use in the analysis. q must span negative and positive values e.g., -3:3, otherwise and error may be produced. |
order |
is an integer indicating the polynomial order used for detrending the local windows (e.g, 1 = linear, 2 = quadratic, etc.). There is not pre-determined limit on the order of the polynomial order but the user should avoid using a large polynomial on small windows. This can result in overfitting and non-meaningful estimates. |
scales |
An integer valued vector indicating the scales one wishes to resolve
in the analysis. Best practice is to use scales which are evenly spaced in
the logarithmic domain e.g., |
scale_ratio |
A scaling factor by which successive window sizes
were created. The default is 2 but should be addressed according to how
scales were generated for example using |
Details
Details of the algorithm are specified in detail in Kantelhardt et al. (2001; 2002) and visualized nicely in Kelty-Stephen et al. (2016).
Selecting the range of values for q is important. Note that MF-DFA estimates for q = 2 are equivalent to DFA. Larger values of q (q > 2) emphasize larger residuals and smaller values of q (q < 2) emphasis smaller residuals (Kelty-Stephen et al., 2016). For most biomedical signals such as physiological and kinematic, a q range of -5 to 5 is common (Ihlen, 2010). However, in some cases, such as when time series are short (< 3000), it can be appropriate to limit the range of q to positive only. Kelty-Stephen et al. (2016) recommend a positive q range of 0.5 to 10 with an increment of 0.5.
While it is common to use only linear detrending with DFA and MF-DFA, it is important to inspect the trends in the data to determine if it would be more appropriate to use a higher order polynomial for detrending, and/or compare the DFA and MF-DFA output for different polynomial orders (see Ihlen, 2012; Kantelhardt et al., 2001).
General recommendations for choosing the min and max scale are a scale_min = 10 and scale_max = (N/4), where N is the number of observations. See Eke et al. (2002), Gulich and Zunino (2014), Ihlen (2012), and for additional considerations and information on choosing the correct parameters.
Value
The output of the algorithm is a list that includes:
-
log_scale
The log scales used for the analysis -
log_fq
The log of the fluctuation functions for each scale and q -
Hq
The q-order Hurst exponent (generalized Hurst exponent) -
Tau
The q-order mass exponent -
q
The q-order statistical moments -
h
The q-order singularity exponent -
Dh
The dimension of the q-order singularity exponent
References
Ihlen, E. A. F. (2012). Introduction to Multifractal Detrended Fluctuation Analysis in Matlab. Frontiers in Physiology, 3. https://doi.org/10.3389/fphys.2012.00141
Kantelhardt, J. W., Koscielny-Bunde, E., Rego, H. H., Havlin, S., & Bunde, A. (2001). Detecting long-range correlations with detrended fluctuation analysis. Physica A: Statistical Mechanics and its Applications, 295(3-4), 441-454.
Kantelhardt, J. W., Zschiegner, S. A., Koscielny-Bunde, E., Havlin, S., Bunde, A., & Stanley, H. E. (2002). Multifractal detrended fluctuation analysis of nonstationary time series. Physica A: Statistical Mechanics and its Applications, 316(1-4), 87-114.
Kelty-Stephen, D. G., Palatinus, K., Saltzman, E., & Dixon, J. A. (2013). A Tutorial on Multifractality, Cascades, and Interactivity for Empirical Time Series in Ecological Science. Ecological Psychology, 25(1), 1-62. https://doi.org/10.1080/10407413.2013.753804
Kelty-Stephen, D. G., Stirling, L. A., & Lipsitz, L. A. (2016). Multifractal temporal correlations in circle-tracing behaviors are associated with the executive function of rule-switching assessed by the Trail Making Test. Psychological Assessment, 28(2), 171-180. https://doi.org/10.1037/pas0000177
Examples
noise <- rnorm(5000)
scales <- c(16,32,64,128,256,512,1024)
mf.dfa.white.out <- mfdfa(
x = noise, q = c(-5:5),
order = 1,
scales = scales,
scale_ratio = 2)
pink.noise <- fgn_sim(n = 5000, H = 0.9)
mf.dfa.pink.out <- mfdfa(
x = pink.noise,
q = c(-5:5),
order = 1,
scales = scales,
scale_ratio = 2)