Skip to contents

Generalizes detrended fluctuation analysis (fractal.dfa) to a spectrum of moment orders q (Kantelhardt et al. 2002). A flat generalized Hurst exponent h(q) indicates a monofractal signal; a decreasing h(q) and a wide multifractal spectrum indicate multifractality. h(2) equals the standard DFA scaling exponent.

Usage

mfdfa(
  x,
  scale_min = 8L,
  scale_max = NULL,
  q_values = seq(-5, 5, by = 0.5),
  both_ends = TRUE,
  detrend_order = 1L
)

Arguments

x

Numeric series (e.g. activity counts); the longest gap-free run is analysed.

scale_min

Smallest window size in samples (default 8).

scale_max

Largest window size (default floor(N/4)).

q_values

Moment orders to evaluate (default seq(-5, 5, 0.5)).

both_ends

If TRUE (default) windows are taken from both ends so the tail of the profile is not discarded; FALSE reproduces the start-only convention of fractal.dfa.

detrend_order

Integer order of the within-window polynomial detrend (default 1, linear MF-DFA1; 2 gives MF-DFA2, matching DFA-2).

Value

An object of class actiRhythm_mfdfa: a list with q_values, h_q (generalized Hurst exponent), tau_q (mass exponent), alpha/f_alpha (the multifractal spectrum), alpha_dfa (= h(2)) and the spectrum width. Returns an NA structure on insufficient data; never errors.

References

Kantelhardt JW, Zschiegner SA, Koscielny-Bunde E, Havlin S, Bunde A, Stanley HE (2002). “Multifractal detrended fluctuation analysis of nonstationary time series.” Physica A: Statistical Mechanics and its Applications, 316(1-4), 87–114. doi:10.1016/S0378-4371(02)01383-3 .

See also

Examples

set.seed(1)
mfdfa(stats::rnorm(4096))$alpha_dfa   # near 0.5 for white noise
#> [1] 0.4772896