Learn R Programming

ctmm (version 0.2.9)

akde.bandwidth: Calculate the optimal bandwidth matrix of movement data

Description

This function calculates the optimal bandwidth matrix (kernel covariance) for a two-dimensional animal tracking dataset, given an autocorrelated movement model (Fleming et al, 2015). This optimal bandwidth can fully take into account all autocorrelation in the data, assuming it is captured by the movement model.

Usage

akde.bandwidth(data,CTMM,fast=NULL,dt=NULL)

Arguments

data
2D timeseries telemetry data represented as a telemetry object.
CTMM
A ctmm movement model from the output of ctmm.fit.
fast
Use the direct algorithm if FALSE or the FFT algorithm if TRUE. The default behavior switches from slow to fast at length(data$t)==100.
dt
Optional lag bin width for the FFT algorithm.

Value

  • Returns a bandwidth matrix object, which is to be the optimal covariance matrix of the individual kernels of the kernel density estimate.

Details

One of two algorithms is used to count the time lags. The direct method is always exact but comes at an $O(n^2)$ computational cost. The fast $O(n \log n)$ algorithm is based upon the FFT method of Marcotte (1996). This FFT method is exact for evenly scheduled data, and can account for missing observations. If no dt is specified, the median sampling interval is used if fast=TRUE. This is typically a good assumption for most data, even when there are gaps. By decreasing dt, the FFT method can be made arbitrarily precise with no ill effects.

References

C. H. Fleming and W. F. Fagan and T. Mueller and K. A. Olson and P. Leimgruber and J. M. Calabrese (2015). Rigorous home-range estimation with movement data: A new autocorrelated kernel-density estimator. http://www.esajournals.org/doi/abs/10.1890/14-2010.1{Ecology, 96(5), 1182-1188}. D. Marcotte. (1996). Fast variogram computation with FFT. Computers and Geosciences 22(10), 1175-1186.

See Also

akde, ctmm.fit

Examples

Run this code
# Load package and data
library(ctmm)
data(buffalo)
cilla <- buffalo[[1]]

# Fit a continuous-velocity model with tau ~ c(10 days, 1 hour)
# see help(variogram.fit)
m2 <- ctmm(tau=c(10*24*60^2,60^2))
M2 <- ctmm.fit(cilla,m2)

# Optimize bandwidth matrix
H2 <- akde.bandwidth(cilla,M2)

Run the code above in your browser using DataLab