Programing DFA test in RStudio


I just star working with Rstudio.

At this moment me and my partner’s in Evora University need something specifics - DFA - Detrended Fluctuation Analysis. This test its available in R.

Now i present to you more information about the Test:

Description - Performs a detrended fluctuation analysis (DFA) and estimates the scaling exponent from the results. DFA is used to characterize long memory dependence in stochastic fractal time series.

Usage - DFA(x, detrend=“poly1”, sum.order=0, overlap=0, scale.max=trunc(length(x)/2), scale.min=NULL, scale.ratio=2, verbose=FALSE)


Your post doesn’t have a question or problem you are struggling with. Are you asking where to get this function? I’ve found it in fractal package. You can install it with install.packages("fractal").

After that you can type ?fractal::DFA in your console and it’ll show help in the help pane. From what I see, author of the package provided example of how to perform it:


## calculate the scaling exponent for a random 
## walk realization 
DFA.walk <- DFA(rnorm(1024), detrend="poly1", sum.order=1)

## print the results 

## plot a summary of the results 


Hi Mishabalyasin,

Thanks for the information.

José Abreu