Learn R Programming

trajr (version 1.5.1)

TrajFractalDimensionValues: Fractal dimension calculation

Description

Calculates path length (\(L(\delta)\)) for a range of step sizes (\(\delta\)). For a fractal (i.e. scale independent) curve, \(log(L(\delta))\) grows linearly as \(log(\delta)\) grows smaller. In other words, if the points returned by this function lie on a straight line in a log-log plot, trj is a fractal curve.

Usage

TrajFractalDimensionValues(trj, stepSizes, adjustD = TRUE)

Value

Data frame with columns stepsize (\(\delta\)) and

pathlength ((\(L(\delta)\)).

Arguments

trj

Trajectory to calculate fractal dimension for.

stepSizes

Vector of step sizes used to calculate path lengths.

adjustD

If TRUE, path length is adjusted to reduce truncation error (Nams, 2006).

References

Nams, V. O. (2006). Improving Accuracy and Precision in Estimating Fractal Dimension of Animal movement paths. Acta Biotheoretica, 54(1), 1-11. doi:10.1007/s10441-006-5954-8

See Also

TrajFractalDimension for fractal dimension calculation.

Examples

Run this code
set.seed(42)
trj <- TrajGenerate()
muL <- mean(TrajStepLengths(trj))
# Use 20 step sizes from 1/2 mean step length to 5 * mean step length.
# For real use, biologically meaningful step sizes should be used.
stepSizes <- TrajLogSequence(0.5 * muL, 5 * muL, 20)
plot(TrajFractalDimensionValues(trj, stepSizes), log = "xy", pch = 16, cex = .5)

Run the code above in your browser using DataLab