7.2 Multi-fractal DFA
casnet has a function for multi-fractal DFA based on the Matlab code by E.A.F. Ihlen: Introduction to multifractal detrended fluctuation analysis in Matlab
set.seed(33)
# White noise
fd_mfdfa(rnorm(4096), doPlot = TRUE)
>
>
> (mf)dfa: Sample rate was set to 1.
>
> ~~~o~~o~~casnet~~o~~o~~~
>
> Multifractal Detrended FLuctuation Analysis
>
> Spec_AUC Spec_Width Spec_CVplus Spec_CVmin Spec_CVtot Spec_CVasymm
> 1 0.0977 0.104 0.0495 0.0513 0.0503 -0.0179
>
>
> ~~~o~~o~~casnet~~o~~o~~~
# Pink noise
fd_mfdfa(noise_powerlaw(N=4096), doPlot = TRUE)
>
>
> (mf)dfa: Sample rate was set to 1.
>
> ~~~o~~o~~casnet~~o~~o~~~
>
> Multifractal Detrended FLuctuation Analysis
>
> Spec_AUC Spec_Width Spec_CVplus Spec_CVmin Spec_CVtot Spec_CVasymm
> 1 0.284 0.328 0.085 0.198 0.155 -0.399
>
>
> ~~~o~~o~~casnet~~o~~o~~~
# 'multi' fractal
<- 2048
N <- rowSums(data.frame(elascer(noise_powerlaw(N=N, alpha = -2)), elascer(noise_powerlaw(N=N, alpha = -.5))*c(rep(.2,512),rep(.5,512),rep(.7,512),rep(1,512))))
y fd_mfdfa(y=y, doPlot = TRUE)
>
>
> (mf)dfa: Sample rate was set to 1.
>
> ~~~o~~o~~casnet~~o~~o~~~
>
> Multifractal Detrended FLuctuation Analysis
>
> Spec_AUC Spec_Width Spec_CVplus Spec_CVmin Spec_CVtot Spec_CVasymm
> 1 0.14 0.169 0.031 0.179 0.145 -0.705
>
>
> ~~~o~~o~~casnet~~o~~o~~~