DFA {fractal} | R Documentation |
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.
DFA(x, detrend="poly1", sum.order=0, overlap=0, scale.max=trunc(length(x)/2), scale.min=NULL, scale.ratio=2, verbose=FALSE)
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:
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 . |
The DFA algorithm is implemented as follows:
(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.(scale.max)
has been reached.
an object of class fractalBlock
.
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.
## 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)