File Exchange

image thumbnail

Detrended Fluctuation Analysis

version 1.1 (506 KB) by

Detrended Fluctuation Analysis,fractal analysis



View License

it is consitent with the program provided by Oxford Univ
Interest readers can visit that page
and download a complied DFA program that runs much faster.

In stochastic processes, chaos theory and time series analysis, detrended fluctuation analysis (DFA) is a method for determining the statistical self-affinity of a signal. It is useful for analysing time series that appear to be long-memory processes.
Reference: Peng C-K, Havlin S, Stanley HE, Goldberger AL. Quantification of scaling exponents and crossover phenomena in nonstationary heartbeat time series. Chaos 1995;5:82-87.

Comments and Ratings (20)

Madalin Gurzu

Hello, can someone please tell me what values i have to use for win lenght, and order? Thank you!


uday (view profile)

How can I implement two dimensional DFA using this code. Thank you

Laya Das

How can one obtain the distribution of the scaling exponent obtained from DFA? How to obtain the standard deviation (that I have seen in many papers employing DFA) of the estimate?


Ali (view profile)

Dear Guan,

Thank your for the program.
Can you please tell me what is the Alpha value for the DATA1 that exists in the download submission?

wang hongwu

Dear Guan
do you have the MF_DFA code?

Dear Guan
i have a signal of 700 points,what necessary changes should i make in the program..pls reply soon..

Dear Guan,

Please let me know if I can have the input as row vector? I am having time series of different length and when I run, I am getting values more than 1.Do I need to change the value of n accordingly?

Dear Guan Weye;
There is sample frequency that works better with DFA?

Dear Guan Wenye;
Thanks for you answer. I do have time series of diferent lengths. However, I find cross-overs. I am not sure whether I should take just one cross-over, the one that has the best fit for all the experiments. In other words, I am taking just boxes size up to 200ms. thanks Erika

Guan Wenye

Guan Wenye (view profile)

To Erika Rodriguez :
you can use time series of different lengths if the length is long enough to have statistical value.

Dear Guan;
I should use the same size of n (n<=10,000) if I am comparing the DFA values in different types of lesions in spinal cord.

Dear Guan, the function output "function output1 = DFA (DATA, win_length, order)" with which data have to enter: DATE, win_length, order??

The file dfm.m seems to be truncated at 26 lines leaving the for-loop unfinished.

Guan Wenye

Guan Wenye (view profile)

hi meysam abed
it is consitent with the program provided by oxford univ
i have checked with it

meysam abed

dear Guan have you checked your DFA code with the code in and it's sample data with results???

Guan Wenye

Guan Wenye (view profile)

to mehak gandhi :it would definitely runs faster if you code it in C or Fortran

mehak gandhi

is the program supposed to run slow

Guan Wenye

For fewer points, you may get incorrect result :).

Srav U

this may be a stupid question...but why do you need a minimum of 2000 data points?



add some description

MATLAB Release
MATLAB 7.1.0 (R14SP3)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today