MFDFA {RespirAnalyzer} | R Documentation |
MultiFractal Detrended Fluctuation Analysis
Description
Applies the MultiFractal Detrended Fluctuation Analysis (MFDFA) to time series.
Usage
MFDFA(tsx, scale, m, q)
Arguments
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. |
Value
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.
References
Zhang T, Dong X, Chen C, Wang D, Zhang XD. RespirAnalyzer: an R package for continuous monitoring of respiratory signals.
Examples
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
[Package RespirAnalyzer version 1.0.2 Index]