Software Open Access
Detrended Fluctuation Analysis
Published: Nov. 11, 2001. Version: 1.0.0
Please include the standard citation for PhysioNet:
(show more options)
Goldberger, A., Amaral, L., Glass, L., Hausdorff, J., Ivanov, P. C., Mark, R., ... & Stanley, H. E. (2000). PhysioBank, PhysioToolkit, and PhysioNet: Components of a new research resource for complex physiologic signals. Circulation [Online]. 101 (23), pp. e215–e220.
Introduction
The method of detrended fluctuation analysis has proven useful in revealing the extent of longrange correlations in time series. Briefly, the time series to be analyzed (with N samples) is first integrated. Next, the integrated time series is divided into boxes of equal length, n. In each box of length n, a least squares line is fit to the data (representing the trend in that box). The y coordinate of the straight line segments is denoted by y_{n}(k).
Next, we detrend the integrated time series, y(k), by subtracting the local trend, y_{n}(k), in each box. The rootmeansquare fluctuation of this integrated and detrended time series is calculated by the equation in dfa.png
This computation is repeated over all time scales (box sizes) to characterize the relationship between F(n), the average fluctuation, and the box size, n. Typically, F(n) will increase with box size. A linear relationship on a loglog plot indicates the presence of power law (fractal) scaling. Under such conditions, the fluctuations can be characterized by a scaling exponent, the slope of the line relating log F(n) to log n.
Software for DFA
The file dfa.c is the C language source for a program that performs detrended fluctuation analysis of a time series. Read about how to use this program here (or download this information in Unix man page format).
The instructions below assume that you already have a C compiler, such as gcc, and a make utility, such as GNU make. Most GNU/Linux and Unix systems have these already. Under MSWindows,we recommend the versions of gcc and make included in the free Cygwin development environment; under Mac OS X, use the versions included in Apple's XCode tools.
 Download dfa.c, Makefile, a sample input file (rrintervals), and the corresponding output file (rrdfa).
 Build dfa by typing:
make
 Test the compiled dfa by typing:
make check
 If dfa passes the test, install it by typing:
make install
If you wish to use some other C compiler, compile dfa.c and link it with the standard C math library, using whatever method is standard for your C compiler. See Makefile to see how to test the executable file that you compile.
Further information
Learn more about applications of DFA to physiologic time series in our tutorial, Fractal Mechanisms in Neural Control. Also see the references at the top of this page.
Two papers also available here discuss the effects of trends and nonstationarities on DFA.
As of August 2012, the two original papers describing the DFA method had been cited by about 1500 research articles.
This method was first proposed in: Peng CK, Buldyrev SV, Havlin S, Simons M, Stanley HE, Goldberger AL. Mosaic organization of DNA nucleotides. Phys Rev E 1994;49:16851689.
A detailed description of the algorithm and its application to physiologic signals can be found in: Peng CK, Havlin S, Stanley HE, Goldberger AL. Quantification of scaling exponents and crossover phenomena in nonstationary heartbeat time series. Chaos 1995;5:8287.
Access
Access Policy:
Anyone can access the files, as long as they conform to the terms of the specified license.
License (for files):
Open Data Commons Attribution License v1.0
Discovery
Topics:
complexity
Corresponding Author
Files
Total uncompressed size: 484.5 KB.
Access the files

Download the files using your terminal:
wget r N c np https://physionet.org/files/dfa/1.0.0/

Download the files using AWS command line tools:
aws s3 sync s3://physionetopen/dfa/1.0.0/ DESTINATION
Name  Size  Modified 

Makefile (download)  620 B  20190412 
citations.shtml (download)  95.5 KB  20190412 
dfa1.0.c (download)  15.5 KB  20190412 
dfa1.htm (download)  5.0 KB  20190412 
dfa.1 (download)  3.5 KB  20190412 
dfa.c (download)  15.5 KB  20190412 
dfa.png (download)  637 B  20190412 
rrdfa (download)  1.5 KB  20190412 
rrintervals (download)  346.8 KB  20190412 