dfa: Detrended Fluctuation Analysis

Description Usage Arguments Details Value Author(s) Examples

Description

Functions for performing Detrended Fluctuation Analysis (DFA), a widely used technique for detecting long range correlations in time series. These functions are able to estimate several scaling exponents from the time series being analyzed. These scaling exponents characterize short or long-term fluctuations, depending of the range used for regression (see details).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
  dfa(time.series, window.size.range = c(10, 300),
    npoints = 20, do.plot = TRUE)

  getWindowSizes(x)

  getFluctuationFunction(x)

  ## S3 method for class 'dfa'
 plot(x, ...)

  ## S3 method for class 'dfa'
 estimate(x, regression.range = NULL,
    do.plot = FALSE, ...)

Arguments

time.series

The original time series to be analyzed.

npoints

The number of different window sizes that will be used to estimate the Fluctuation function in each zone.

window.size.range

Range of values for the windows size that will be used to estimate the fluctuation function. Default: c(10,300).

do.plot

logical value. If TRUE (default value), a plot of the Fluctuation function is shown.

...

Additional parameters.

x

A dfa object.

regression.range

Vector with 2 components denoting the range where the function will perform linear regression.

Details

The Detrended Fluctuation Analysis (DFA) has become a widely used technique for detecting long range correlations in time series. The DFA procedure may be summarized as follows:

  1. Integrate the time series to be analyzed. The time series resulting from the integration will be referred to as the profile.

  2. Divide the profile into N non-overlapping segments.

  3. Calculate the local trend for each of the segments using least-square regression. Compute the total error for each of the segments.

  4. Compute the average of the total error over all segments and take its root square. By repeating the previous steps for several segment sizes (let's denote it by t), we obtain the so-called Fluction function F(t).

  5. If the data presents long-range power law correlations: F(t) proportional t^alpha and we may estimate using regression.

  6. Usually, when plotting log(F(t)) Vs log(t) we may distinguish two linear regions. By regression them separately, we obtain two scaling exponents, alpha1 (characterizing short-term fluctuations) and alpha2 (characterizing long-term fluctuations).

Steps 1-4 are performed using the dfa function. In order to obtain a estimate of some scaling exponent, the user must use the estimate function specifying the regression range (window sizes used to detrend the series).

Value

A dfa object.

The getWindowSizes function returns the windows sizes used to detrend the time series

The getFluctuationFunction function returns the Fluctuation function of the DFA

Author(s)

Constantino A. Garcia

Examples

1
2
3
4
5
6
7
## Not run: 
 noise = rnorm(5000)
 dfa.analysis = dfa(time.series = noise, npoints = 10,
               window.size.range=c(10,1000), do.plot=FALSE)
 cat("Theorical: 0.5---Estimated: ", estimate(dfa.analysis),"\n")

## End(Not run)

nonlinearAnalysis documentation built on May 2, 2019, 6:11 p.m.