DFA                 package:fractal                 R Documentation

_D_e_t_r_e_n_d_e_d _f_l_u_c_t_u_a_t_i_o_n _a_n_a_l_y_s_i_s

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

       x: a vector containing a uniformly-sampled real-valued time
          series.

 detrend: a character string denoting the type of detrending to use on
          each block of the time series. Supported types are:

          '"_p_o_l_y'__K_'"' specifies a polynomial fit where _K_ is an
               integer denoting the order of the polynomial. For
               example, if 'detrend="poly2"', a second order polynomial
               of the form x(t)=b0 + b1*t + b2*t^2 will be used to fit
               the data in each block using least squares. The
               polynomial order must be positive or zero.

          '"_b_r_i_d_g_e"' specifies bridge detrending. A line connecting the
               endpoints of each block is subtracted.

          '"_n_o_n_e"' instructs the function to not detrend the data. .in
               -5

               Default: '"poly1"'.

 overlap: the overlap of blocks in partitioning the time data expressed
          as a fraction in [ 0,1). A positive overlap will slow down
          the calculations slightly with the (possible) effect of
          generating less biased results. Default: '0'.

scale.max: an integer denoting the maximum block size to use in
          partitioning the data. Default: 'trunc(length(x)/2)'.

scale.min: an integer denoting the minimum block size to use in
          partitioning the data. Default: for polynomial detrending the
          default value is 2*(K+1). For all other detrending
          techniques, the default value is 4 or 'length(x)/4',
          whichever is smaller.

scale.ratio: the ratio of successive scales. This argument is used as
          an input to the 'logScale' function. Default: '2'.

sum.order: an integer denoting the number of differences or cumulative
          summations to perform on the original data before performing
          a DFA. Differences are specified by negative integers and
          cumulative summations by positive integers. For example, to
          perform a second order difference, set 'sum.order=-2'.
          Default: '0'.

 verbose: a logical value. If 'TRUE', the detrending model and
          processing progress information is displayed. Default:
          'FALSE'.

_D_e_t_a_i_l_s:

     The DFA algorithm is implemented as follows:

     _1 DFA is useful for characterizing long-memory correlations in
          stochastic fractal time series, i.e. sequences whose spectral
          density function S(f) obeys a power law S~|f|^alpha at low
          frequencies where 0 <= f <= 1/2 is the normalized frequency
          variable and alpha <= -1 is the long memory (scaling)
          exponent. If the scaling exponent for an original time series
          is alpha > -1, then (possibly multiple) cumulative summations
          of the original time series must be performed to increase the
          scaling exponent (each cumulative summation decreases the
          exponent by 2). For example, a (single) cumulative summation
          must be performed on a white noise realization since its
          scaling exponent is zero. We also provide the user with the
          ability to perform (consecutive) first order differencing
          operations on the original time series prior to a DFA. Each
          differencing operation raises the scaling exponent by 2.
          Differencing a series is acceptable prior to DFA as long as
          the resulting scaling exponent is less than -1.

     _2 The series resulting from stage one is uniformly partitioned
          into blocks of a specified minimum size '(scale.min)', and
          each block is (optionally) detrended. The variance of the
          detrended sequence in each block is calculated and the
          collection of variances is averaged to form the scalar value
          F^2'(scale.min)' which summarizes the variability of the
          sequence at the current scale.

     _3 Stage two is repeated using successively larger blocks until the
          largest scale '(scale.max)' has been reached.

     _4 For long-memory processes, we expect to find a linear relation
          between log F(scale) and log scale. The slope of the line
          which best fits a plot of log F(scale) versus log scale is
          defined as the _scaling exponent_. .in -5 

_V_a_l_u_e:

     an object of class 'fractalBlock'.

_R_e_f_e_r_e_n_c_e_s:

     Peng C-K, Buldyrev SV, Havlin S, Simons M, Stanley HE, and
     Goldberger AL (1994), Mosaic organization of DNA nucleotides,
     _Physical Review E_, *49*, 1685-1689.

     Peng C-K, Havlin S, Stanley HE, and Goldberger AL (1995),
     Quantification of scaling exponents and crossover phenomena in
     nonstationary heartbeat time series, _Chaos_, *5*, 82-87.

     Goldberger AL, Amaral LAN, Glass L, Hausdorff JM, Ivanov PCh, Mark
     RG, Mietus JE, Moody GB, Peng C-K, Stanley HE (2000, June 13),
     PhysioBank, PhysioToolkit, and Physionet: Components of a New
     Research Resource for Complex Physiologic Signals, _Circulation_,
     *101*(23), e215-e220.

_S_e_e _A_l_s_o:

     'logScale', 'fractalBlock'.

_E_x_a_m_p_l_e_s:

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

     ## print the results 
     print(DFA.walk)

     ## plot a summary of the results 
     eda.plot(DFA.walk)

