fd.estimate {fractaldim} | R Documentation |
Estimating Fractal Dimensions of Time Series and Two-dimensional Data
Description
The functions compute a set of fractal dimensions D
for time series and two-dimensional data
via various methods using a sliding window
technique. There is one D
computed for each method and for
each sliding window of a given size that is moved along the data.
Usage
## S3 method for class 'numeric'
fd.estimate(data, methods = "madogram", window.size = length(data),
step.size = window.size, trim = TRUE, keep.data = FALSE,
keep.loglog = FALSE, parallel = FALSE, nr.nodes = NULL,
debuglevel = 0, ...)
## S3 method for class 'matrix'
fd.estimate(data, methods = "transect.var", window.size = ncol(data),
step.size = window.size, trim = TRUE, keep.data = FALSE,
keep.loglog = FALSE, parallel = FALSE, nr.nodes = NULL,
debuglevel = 0, ...)
Arguments
data |
Vector, matrix or data frame. |
methods |
Vector of character strings specifying methods for which
|
window.size |
Size (in number of data points) of the
sliding window. It should be between 2 and length of
|
step.size |
Number of data points by which the sliding window is moved. |
trim |
Logical. If |
keep.data |
Logical. If |
keep.loglog |
Logical. If |
parallel |
Logical determining if the process should run in parallel. If |
nr.nodes |
Number of nodes on which the computation should be
processed if |
debuglevel |
Controls the amount of debugging messages. The functions produce messages on levels 1 - 4. |
... |
Arguments passed to lower level functions (defined in
|
Details
In case of one-dimensional time series, the function initiates a sliding window
of the given size at the beginning of the time series. The
window is moved along the data by the
given step size. If parallel
is TRUE
, computation on each window happens in parallel.
In the two-dimensional case, the window is initiated in the top left corner of the data matrix and moved horizontally by the given step size, as well as vertically by the same step size. If the process is running in parallel, processing each row is done in parallel.
In both cases, in each iteration estimates of fractal dimension for
data within the sliding window are
computed using the given estimation methods.
Note that the estimation results are NA
for any sliding window that
contains NA
values.
Arguments that are to be passed to specific methods can be given either directly, if they applies to all given methods. Or, they can be given as a list via the methods
argument: There is one list per method that must contain the entry “name” being the method name. Remaining entries in the list corespond to one argument each (see Example below).
Value
An object of class
FractalDim
which consists of the following components:
dim |
Dimension of the resulting arrays |
fd |
A |
scale |
A |
methods |
Vector of methods given in the |
methods.coding |
Vector of internal coding of |
data |
Value of the argument |
data.dim |
Dimension of |
window.size |
Size of the actual sliding window used in the computation. |
step.size |
Step size by which the sliding window was moved in the computation. |
loglog |
If |
See Also
fd.estim.method
, fd.get.available.methods
, FDloglog
, fd.get
Examples
## Not run:
library(RandomFields)
n <- 10000
# generate a time series
rf <- GaussRF(x = c(0, 1, 1/n), model = "stable",
grid = TRUE, gridtriple = TRUE,
param = c(mean=0, variance=1, nugget=0, scale=100, kappa=1))
# Plots for two sliding windows of each of the four methods below.
# Argument nlags is common to all methods;
# the 'variation' method has in addition argument p.index
par(mfrow=c(2,4)) # one row per window
fd <- fd.estimate(rf,
methods = list(list(name="variation", p.index=0.5),
"variogram", "hallwood", "boxcount"),
window.size = 5000, step.size = 5000, plot.loglog = TRUE, nlags = 10)
# 2d random fields
n <- 200
rf2d <- GaussRF(x = c(0,1, 1/n), y = c(0,1, 1/n), model = "stable",
grid = TRUE, gridtriple = TRUE,
param = c(mean=0, variance=1, nugget=0, scale=1, kappa=1))
par(mfrow=c(2,2))
# plots for 4 sliding windows (2 horizontal, 2 vertical)
fd2d <- fd.estimate(rf2d, methods="filter1",
window.size = 100, step.size=100, plot.loglog = TRUE)
## End(Not run)