MFDFA | R Documentation |
Applies the MultiFractal Detrended Fluctuation Analysis (MFDFA) to time series.
MFDFA(tsx, scale, m, q)
tsx |
Univariate time series (must be a vector). |
scale |
Vector of scales. |
m |
An integer of the polynomial order for the detrending. |
q |
q-order of the moment. |
A list of the following elements:
Hq
q-order Hurst exponent.
tau_q
Mass exponent.
hq
Holder exponent.
Dq
singularity dimension.
Fqi
q-order fluctuation function.
line
linear fitting line of fluctuation function.
Zhang T, Dong X, Chen C, Wang D, Zhang XD. RespirAnalyzer: an R package for continuous monitoring of respiratory signals.
data("TestData") # load Data from TestData dataset
Fs <- 50
Peaks <- find.peaks(Data[,2],Fs,lowpass=TRUE,freq=1,MovingAv=FALSE,
W=FALSE,filter=TRUE,threshold=0.05)
head(Peaks)
PP_interval <- diff(Peaks$PeakIndex)/Fs
## Computing Multifractal
exponents=seq(3, 9, by=1/4)
scale=2^exponents
q=-10:10
m=2
Result <- MFDFA(PP_interval, scale, m, q)
Coeff <- fit.model(Result$Hq,q)
print(Coeff)
Para<- -log(Coeff)/log(2)
Para[3]=Para[1]-Para[2]
names(Para)<-c("Hmax","Hmin","DeltaH")
Para
PP_Hq <- Result$Hq
PP_hq <- Result$hq
PP_Dq <- Result$Dq
PP_Para <-Para
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.