fd_sda
Usage
fd_sda(
y,
fs = NULL,
removeTrend = c("no", "poly", "adaptive", "bridge")[2],
polyOrder = 1,
standardise = c("none", "mean.sd", "median.mad")[2],
adjustSumOrder = FALSE,
scaleMin = 4,
scaleMax = stats::nextn(floor(NROW(y)/2), factors = 2),
scaleResolution = log2(scaleMax) - log2(scaleMin),
dataMin = NA,
scaleS = NA,
overlap = 0,
doPlot = FALSE,
returnPlot = FALSE,
returnPLAW = FALSE,
returnInfo = FALSE,
silent = FALSE,
noTitle = FALSE,
tsName = "y"
)Arguments
- y
A numeric vector or time series object.
- fs
Sample rate
- removeTrend
Method to use for global detrending (default =
"poly")- polyOrder
Order of global polynomial trend to remove if
removeTrend = "poly". IfremoveTrend = "adaptive"polynomials1topolyOrderwill be evaluated and the best fitting curve (R squared) will be removed (default =1)- standardise
Standardise the series using
ts_standardise()withadjustN = FALSE(default = "mean.sd")- adjustSumOrder
Adjust the time series (summation or difference), based on the global scaling exponent, see e.g. Ihlen (2012) (default =
FALSE)- scaleMin
Minimum scale (in data points) to use for log-log regression (default =
4)- scaleMax
Maximum scale (in data points) to use for log-log regression. This value will be ignored if
dataMinis notNA, in which case bins of size< dataMinwill be removed (default =stats::nextn(floor(NROW(y)/4), factors = 2))- scaleResolution
The scales at which detrended fluctuation will be evaluated are calculated as:
seq(scaleMin, scaleMax, length.out = scaleResolution)(default =round(log2(scaleMax-scaleMin))). #' @param dataMin Minimum number of data points in a bin required for inclusion in calculation of the scaling relation. For example iflength(y) = 1024anddataMin = 4, the maximum scale used to calculate the slope will be1024 / 4 = 256. This value will take precedence over thescaleMax(default =NA)- scaleS
If not
NA, it should be a numeric vector listing the scales on which to evaluate the detrended fluctuations. ArgumentsscaleMax, scaleMin, scaleResolutionanddataMinwill be ignored (default =NA)- overlap
A number in
[0 ... 1]representing the amount of 'bin overlap' when calculating the fluctuation. This reduces impact of arbitrary time series begin and end points. Iflength(y) = 1024and overlap is.5, a scale of4will be considered a sliding window of size4with step-sizefloor(.5 * 4) = 2, so for scale128step-size will be64(default =NA)- doPlot
Output the log-log scale versus fluctuation plot with linear fit by calling function
plotFD_loglog()(default =TRUE)- returnPlot
Return ggplot2 object (default =
FALSE)- returnPLAW
Return the power law data (default =
FALSE)- returnInfo
Return all the data used in SDA (default =
FALSE)- silent
Silent-ish mode (default =
FALSE)- noTitle
Do not generate a title (only the subtitle) (default =
FALSE)- tsName
Name of y added as a subtitle to the plot (default =
"y")
Value
A list object containing:
A data matrix
PLAWwith columnsfreq.norm,sizeandbulk.Estimate of scaling exponent
sapbased on a fit over the standard range (fullRange), or on a user defined rangefitRange.Estimate of the the Fractal Dimension (
FD) using conversion formula's reported in Hasselman(2013).Information output by various functions.
