fd_dfa | R Documentation |
fd_dfa
fd_dfa(
y,
fs = NULL,
removeTrend = c("no", "poly", "adaptive", "bridge")[2],
polyOrder = 1,
standardise = c("none", "mean.sd", "median.mad")[2],
adjustSumOrder = FALSE,
removeTrendSegment = c("no", "poly", "adaptive", "bridge")[2],
polyOrderSegment = 1,
scaleMin = 4,
scaleMax = stats::nextn(floor(NROW(y)/2), factors = 2),
scaleResolution = log2(scaleMax) - log2(scaleMin),
dataMin = NA,
scaleS = NA,
overlap = NA,
doPlot = FALSE,
returnPlot = FALSE,
returnPLAW = FALSE,
returnInfo = FALSE,
silent = FALSE,
noTitle = FALSE,
tsName = "y"
)
y |
A numeric vector or time series object. |
fs |
Sample rate |
removeTrend |
Method to use for global detrending (default = |
polyOrder |
Order of global polynomial trend to remove if |
standardise |
Standardise the series using |
adjustSumOrder |
Adjust the time series (summation or difference), based on the global scaling exponent, see e.g. Ihlen (2012) (default = |
removeTrendSegment |
Method to use for detrending in the bins (default = |
polyOrderSegment |
The DFA order, the order of polynomial trend to remove from the bin if |
scaleMin |
Minimum scale (in data points) to use for log-log regression (default = |
scaleMax |
Maximum scale (in data points) to use for log-log regression. This value will be ignored if |
scaleResolution |
The scales at which detrended fluctuation will be evaluated are calculated as: |
scaleS |
If not |
overlap |
A number in |
doPlot |
Output the log-log scale versus fluctuation plot with linear fit by calling function |
returnPlot |
Return ggplot2 object (default = |
returnPLAW |
Return the power law data (default = |
returnInfo |
Return all the data used in SDA (default = |
silent |
Silent-ish mode (default = |
noTitle |
Do not generate a title (only the subtitle) (default = |
tsName |
Name of y added as a subtitle to the plot (default = |
Estimate of Hurst exponent (slope of log(bin)
vs. log(RMSE))
and an FD estimate based on Hasselman (2013)
A list object containing:
A data matrix PLAW
with columns freq.norm
, size
and bulk
.
Estimate of scaling exponent sap
based on a fit over the standard range (fullRange
), or on a user defined range fitRange
.
Estimate of the the Fractal Dimension (FD
) using conversion formula's reported in Hasselman(2013).
Information output by various functions.
Fred Hasselman
Hasselman, F. (2013). When the blind curve is finite: dimension estimation and model inference based on empirical waveforms. Frontiers in Physiology, 4, 75. https://doi.org/10.3389/fphys.2013.00075
Other Fluctuation Analyses:
fd_RR()
,
fd_allan()
,
fd_mfdfa()
,
fd_psd()
,
fd_sda()
,
fd_sev()
set.seed(1234)
# Brownian noise
fd_dfa(cumsum(rnorm(512)))
# Brownian noise with overlapping bins
fd_dfa(cumsum(rnorm(512)), overlap = 0.5)
# Brownian noise to white noise - windowed analysis
y <- rnorm(1024)
y[1:512] <- cumsum(y[1:512])
id <- ts_windower(y, win = 256, step = 1)
DFAseries <- plyr::ldply(id, function(w){
fd <- fd_dfa(y[w], silent = TRUE)
return(fd$fitRange$FD)
})
op <- par(mfrow=c(2,1))
plot(ts(y))
plot(ts(DFAseries[,2]))
lines(c(0,770),c(1.5,1.5), col = "red3")
lines(c(0,770),c(1.1,1.1), col = "steelblue")
par(op)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.