MF-DFA
   HOME

TheInfoList



OR:

In
stochastic processes In probability theory and related fields, a stochastic () or random process is a mathematical object usually defined as a family of random variables in a probability space, where the index of the family often has the interpretation of time. Stoc ...
,
chaos theory Chaos theory is an interdisciplinary area of Scientific method, scientific study and branch of mathematics. It focuses on underlying patterns and Deterministic system, deterministic Scientific law, laws of dynamical systems that are highly sens ...
and
time series analysis In mathematics, a time series is a series of data points indexed (or listed or graphed) in time order. Most commonly, a time series is a sequence taken at successive equally spaced points in time. Thus it is a sequence of discrete-time data. ...
, detrended fluctuation analysis (DFA) is a method for determining the statistical
self-affinity In mathematics, a self-similar object is exactly or approximately similarity (geometry), similar to a part of itself (i.e., the whole has the same shape as one or more of the parts). Many objects in the real world, such as coastlines, are stat ...
of a signal. It is useful for analysing
time series In mathematics, a time series is a series of data points indexed (or listed or graphed) in time order. Most commonly, a time series is a sequence taken at successive equally spaced points in time. Thus it is a sequence of discrete-time data. ...
that appear to be long-memory processes (diverging correlation time, e.g. power-law decaying
autocorrelation function Autocorrelation, sometimes known as serial correlation in the discrete time case, measures the correlation of a signal with a delayed copy of itself. Essentially, it quantifies the similarity between observations of a random variable at differe ...
) or
1/f noise Pink noise, noise, fractional noise or fractal noise is a signal or process with a frequency spectrum such that the power spectral density (power per frequency interval) is inversely proportional to the frequency of the signal. In pink nois ...
. The obtained exponent is similar to the
Hurst exponent The Hurst exponent is used as a measure of long-term memory of time series. It relates to the autocorrelations of the time series, and the rate at which these decrease as the lag between pairs of values increases. Studies involving the Hurst expo ...
, except that DFA may also be applied to signals whose underlying statistics (such as mean and variance) or dynamics are
non-stationary In mathematics and statistics, a stationary process (also called a strict/strictly stationary process or strong/strongly stationary process) is a stochastic process whose statistical properties, such as mean and variance, do not change over time. M ...
(changing with time). It is related to measures based upon spectral techniques such as
autocorrelation Autocorrelation, sometimes known as serial correlation in the discrete time case, measures the correlation of a signal with a delayed copy of itself. Essentially, it quantifies the similarity between observations of a random variable at differe ...
and
Fourier transform In mathematics, the Fourier transform (FT) is an integral transform that takes a function as input then outputs another function that describes the extent to which various frequencies are present in the original function. The output of the tr ...
.
Peng Peng may refer to: * Peng (surname) (彭), a Chinese name * Peng (state) (大彭), a state during the late Shang dynasty * Peng (mythology) (鵬), a legendary Chinese creature * ''Peng!'', 1992 album by Stereolab * ''PENG!'', a 2005 comic * P.Eng. ...
et al. introduced DFA in 1994 in a paper that has been cited over 3,000 times as of 2022 and represents an extension of the (ordinary) fluctuation analysis (FA), which is affected by non-stationarities. Systematic studies of the advantages and limitations of the DFA method were performed by PCh Ivanov et al. in a series of papers focusing on the effects of different types of nonstationarities in real-world signals: (1) types of trends; (2) random outliers/spikes, noisy segments, signals composed of parts with different correlation; (3) nonlinear filters; (4) missing data; (5) signal coarse-graining procedures and comparing DFA performance with moving average techniques (cumulative citations > 4,000).Â
Datasets
generated to test DFA are available on PhysioNet.


Definition


Algorithm

Given: a
time series In mathematics, a time series is a series of data points indexed (or listed or graphed) in time order. Most commonly, a time series is a sequence taken at successive equally spaced points in time. Thus it is a sequence of discrete-time data. ...
x_1, x_2, ..., x_N. Compute its average value \langle x\rangle = \frac 1N \sum_^N x_t. Sum it into a process X_t=\sum_^t (x_i-\langle x\rangle). This is the cumulative sum, or profile, of the original time series. For example, the profile of an i.i.d.
white noise In signal processing, white noise is a random signal having equal intensity at different frequencies, giving it a constant power spectral density. The term is used with this or similar meanings in many scientific and technical disciplines, i ...
is a standard
random walk In mathematics, a random walk, sometimes known as a drunkard's walk, is a stochastic process that describes a path that consists of a succession of random steps on some Space (mathematics), mathematical space. An elementary example of a rand ...
. Select a set T = \ of integers, such that n_1 < n_2 < \cdots < n_k, the smallest n_1 \approx 4, the largest n_k \approx N/4, and the sequence is roughly distributed evenly in log-scale: \log(n_2) - \log(n_1) \approx \log(n_3) - \log(n_2) \approx \cdots. In other words, it is approximately a
geometric progression A geometric progression, also known as a geometric sequence, is a mathematical sequence of non-zero numbers where each term after the first is found by multiplying the previous one by a fixed number called the ''common ratio''. For example, the s ...
. For each n \in T, divide the sequence X_t into consecutive segments of length n. Within each segment, compute the
least squares The method of least squares is a mathematical optimization technique that aims to determine the best fit function by minimizing the sum of the squares of the differences between the observed values and the predicted values of the model. The me ...
straight-line fit (the local trend). Let Y_, Y_, ..., Y_ be the resulting piecewise-linear fit. Compute the
root-mean-square deviation The root mean square deviation (RMSD) or root mean square error (RMSE) is either one of two closely related and frequently used measures of the differences between true or predicted values on the one hand and observed values or an estimator on th ...
from the local trend (local fluctuation):F( n, i) = \sqrt.And their root-mean-square is the total fluctuation: :F( n ) = \sqrt. (If N is not divisible by n, then one can either discard the remainder of the sequence, or repeat the procedure on the reversed sequence, then take their root-mean-square.) Make the log-log plot \log n - \log F(n).


Interpretation

A straight line of slope \alpha on the log-log plot indicates a statistical
self-affinity In mathematics, a self-similar object is exactly or approximately similarity (geometry), similar to a part of itself (i.e., the whole has the same shape as one or more of the parts). Many objects in the real world, such as coastlines, are stat ...
of form F(n) \propto n^. Since F(n) monotonically increases with n, we always have \alpha > 0. The scaling exponent \alpha is a generalization of the
Hurst exponent The Hurst exponent is used as a measure of long-term memory of time series. It relates to the autocorrelations of the time series, and the rate at which these decrease as the lag between pairs of values increases. Studies involving the Hurst expo ...
, with the precise value giving information about the series self-correlations: * \alpha<1/2: anti-correlated * \alpha \simeq 1/2: uncorrelated,
white noise In signal processing, white noise is a random signal having equal intensity at different frequencies, giving it a constant power spectral density. The term is used with this or similar meanings in many scientific and technical disciplines, i ...
* \alpha>1/2: correlated * \alpha\simeq 1: 1/f-noise,
pink noise Pink noise, noise, fractional noise or fractal noise is a signal (information theory), signal or process with a frequency spectrum such that the power spectral density (power per frequency interval) is inversely proportional to the frequenc ...
* \alpha>1: non-stationary, unbounded * \alpha\simeq 3/2:
Brownian noise In science, Brownian noise, also known as Brown noise or red noise, is the type of signal noise produced by Brownian motion, hence its alternative name of random walk noise. The term "Brown noise" does not come from brown, the color, but after ...
Because the expected displacement in an uncorrelated random walk of length N grows like \sqrt, an exponent of \tfrac would correspond to uncorrelated white noise. When the exponent is between 0 and 1, the result is
fractional Gaussian noise In probability theory, fractional Brownian motion (fBm), also called a fractal Brownian motion, is a generalization of Brownian motion. Unlike classical Brownian motion, the increments of fBm need not be independent. fBm is a continuous-time Gaus ...
.


Pitfalls in interpretation

Though the DFA algorithm always produces a positive number \alpha for any time series, it does not necessarily imply that the time series is self-similar.
Self-similarity In mathematics, a self-similar object is exactly or approximately similar to a part of itself (i.e., the whole has the same shape as one or more of the parts). Many objects in the real world, such as coastlines, are statistically self-similar ...
requires the log-log graph to be sufficiently linear over a wide range of n. Furthermore, a combination of techniques including
maximum likelihood estimation In statistics, maximum likelihood estimation (MLE) is a method of estimation theory, estimating the Statistical parameter, parameters of an assumed probability distribution, given some observed data. This is achieved by Mathematical optimization, ...
(MLE), rather than least-squares has been shown to better approximate the scaling, or power-law, exponent. Also, there are many scaling exponent-like quantities that can be measured for a self-similar time series, including the divider dimension and
Hurst exponent The Hurst exponent is used as a measure of long-term memory of time series. It relates to the autocorrelations of the time series, and the rate at which these decrease as the lag between pairs of values increases. Studies involving the Hurst expo ...
. Therefore, the DFA scaling exponent \alpha is not a
fractal dimension In mathematics, a fractal dimension is a term invoked in the science of geometry to provide a rational statistical index of complexity detail in a pattern. A fractal pattern changes with the Scaling (geometry), scale at which it is measured. It ...
, and does not have certain desirable properties that the
Hausdorff dimension In mathematics, Hausdorff dimension is a measure of ''roughness'', or more specifically, fractal dimension, that was introduced in 1918 by mathematician Felix Hausdorff. For instance, the Hausdorff dimension of a single point is zero, of a line ...
has, though in certain special cases it is related to the box-counting dimension for the graph of a time series.


Generalizations


Generalization to polynomial trends (higher order DFA)

The standard DFA algorithm given above removes a linear trend in each segment. If we remove a degree-n polynomial trend in each segment, it is called DFAn, or higher order DFA. Since X_t is a cumulative sum of x_t-\langle x\rangle , a linear trend in X_t is a constant trend in x_t-\langle x\rangle , which is a constant trend in x_t (visible as short sections of "flat plateaus"). In this regard, DFA1 removes the mean from segments of the time series x_t before quantifying the fluctuation. Similarly, a degree n trend in X_t is a degree (n-1) trend in x_t . For example, DFA1 removes linear trends from segments of the time series x_t before quantifying the fluctuation, DFA1 removes parabolic trends from x_t , and so on. The Hurst R/S analysis removes constant trends in the original sequence and thus, in its detrending it is equivalent to DFA1.


Generalization to different moments (multifractal DFA)

DFA can be generalized by computing F_q( n ) = \left(\frac\sum_^ F(n, i)^q\right)^ then making the log-log plot of \log n - \log F_q(n), If there is a strong linearity in the plot of \log n - \log F_q(n), then that slope is \alpha(q). DFA is the special case where q=2. Multifractal systems scale as a function F_q(n) \propto n^. Essentially, the scaling exponents need not be independent of the scale of the system. In particular, DFA measures the scaling-behavior of the second moment-fluctuations. Kantelhardt et al. intended this scaling exponent as a generalization of the classical Hurst exponent. The classical Hurst exponent corresponds to H=\alpha(2) for stationary cases, and H=\alpha(2)-1 for nonstationary cases.


Applications

The DFA method has been applied to many systems, e.g. DNA sequences; heartbeat dynamics in sleep and wake,  sleep stages, rest and exercise, and across circadian phases; locomotor gate and wrist dynamics, neuronal oscillations, speech pathology detection, and animal behavior pattern analysis.


Relations to other methods, for specific types of signal


For signals with power-law-decaying autocorrelation

In the case of power-law decaying auto-correlations, the
correlation function A correlation function is a function that gives the statistical correlation between random variables, contingent on the spatial or temporal distance between those variables. If one considers the correlation function between random variables ...
decays with an exponent \gamma: C(L)\sim L^\!\ . In addition the
power spectrum In signal processing, the power spectrum S_(f) of a continuous time signal x(t) describes the distribution of Power (physics), power into frequency components f composing that signal. According to Fourier analysis, any physical signal can be ...
decays as P(f)\sim f^\!\ . The three exponents are related by: * \gamma=2-2\alpha * \beta=2\alpha-1 and * \gamma=1-\beta. The relations can be derived using the
Wiener–Khinchin theorem In applied mathematics, the Wiener–Khinchin theorem or Wiener–Khintchine theorem, also known as the Wiener–Khinchin–Einstein theorem or the Khinchin–Kolmogorov theorem, states that the autocorrelation function of a wide-sense-stationary ...
. The relation of DFA to the power spectrum method has been well studied. Thus, \alpha is tied to the slope of the power spectrum \beta and is used to describe the color of noise by this relationship: \alpha = (\beta+1)/2.


For fractional Gaussian noise

For
fractional Gaussian noise In probability theory, fractional Brownian motion (fBm), also called a fractal Brownian motion, is a generalization of Brownian motion. Unlike classical Brownian motion, the increments of fBm need not be independent. fBm is a continuous-time Gaus ...
(FGN), we have \beta \in 1,1, and thus \alpha \in ,1/math>, and \beta = 2H-1, where H is the
Hurst exponent The Hurst exponent is used as a measure of long-term memory of time series. It relates to the autocorrelations of the time series, and the rate at which these decrease as the lag between pairs of values increases. Studies involving the Hurst expo ...
. \alpha for FGN is equal to H.


For fractional Brownian motion

For
fractional Brownian motion In probability theory, fractional Brownian motion (fBm), also called a fractal Brownian motion, is a generalization of Brownian motion. Unlike classical Brownian motion, the increments of fBm need not be independent. fBm is a continuous-time Gaus ...
(FBM), we have \beta \in ,3, and thus \alpha \in ,2/math>, and \beta = 2H+1, where H is the
Hurst exponent The Hurst exponent is used as a measure of long-term memory of time series. It relates to the autocorrelations of the time series, and the rate at which these decrease as the lag between pairs of values increases. Studies involving the Hurst expo ...
. \alpha for FBM is equal to H+1. In this context, FBM is the cumulative sum or the
integral In mathematics, an integral is the continuous analog of a Summation, sum, which is used to calculate area, areas, volume, volumes, and their generalizations. Integration, the process of computing an integral, is one of the two fundamental oper ...
of FGN, thus, the exponents of their power spectra differ by 2.


See also

* * * * *


References


External links


Tutorial on how to calculate detrended fluctuation analysis
{{Webarchive, url=https://web.archive.org/web/20190203115306/https://www.nbtwiki.net/doku.php?id=tutorial:detrended_fluctuation_analysis_dfa , date=2019-02-03 in Matlab using the
Neurophysiological Biomarker Toolbox The Neurophysiological Biomarker Toolbox (NBT) is an open source MATLAB toolbox for the computation and integration of neurophysiological biomarkers (e.g., biomarkers based on EEG or MEG recordings). The NBT toolbox has so far been used in ...
.
FastDFA
MATLAB MATLAB (an abbreviation of "MATrix LABoratory") is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementat ...
code for rapidly calculating the DFA scaling exponent on very large datasets.
Physionet
A good overview of DFA and C code to calculate it.
MFDFA
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (prog ...
implementation of (Multifractal) Detrended Fluctuation Analysis. Autocorrelation Fractals