Autocorrelated Kernel Density Estimation

Chris H. Fleming and Justin M. Calabrese

2016-09-05

In this vignette we walk through autocorrelated kernel density estimation. We will assume that you have already estimated a good ctmm movement model for your data. For demonstration purposes we will be working from the results of the “Variograms and Model Selection” vignette (see vignette("variogram")).

library(ctmm)
data(buffalo)
cilla <- buffalo[[1]]
M0 <- ctmm.fit(cilla) # no autocorrelation timescales
m2 <- ctmm(tau=c(6*24,1)*60^2) # ~ 6 day and 1 hour autocorrelation timescales
M2 <- ctmm.fit(cilla,m2) 

M0 is the innapropriate, IID model, which will result in a conventional kernel-density estimate, while M2 is the vastly superior, continuous-velocity OUF model. Now we can calculate an akde object for each model.

UD0b <- akde(cilla,M0,debias=FALSE)
UD0 <- akde(cilla,M0)
UD2b <- akde(cilla,M2,debias=FALSE)
UD2 <- akde(cilla,M2)

We calculated UDs with and with out accounting for autocorrelation (M2 versus M0), with and without bias correction in the area esitmates (debias). The best estimate is UD2, while the others are included for comparison. Now let us plot the results.

plot(cilla,UD=UD0b,ylim=c(-14,12)*1000)
title("IID KDE")
plot(cilla,UD=UD2b,ylim=c(-14,12)*1000)
title("OUF AKDE")
plot(cilla,UD=UD0,ylim=c(-14,12)*1000)
title(expression("IID KDE"["C"]))
plot(cilla,UD=UD2,ylim=c(-14,12)*1000)
title(expression("OUF AKDE"["C"]))

A more useful function for plotting in R-studio is zoom(cilla,UD=UD2), which adds a zoom slider.

By default both the density function and its 95% contours are plotted along with the location data. The middle contour represent the maximum likelihood area where the animal spends 95% of its time. This percentage can be changed with the level.UD option (see help(plot.telemetry)). The inner and outer contours correspond to confidence intervals on the magnitude of the area, which can be adjusted with the level option.

The optimal bandwidth determines the “resolution” of the kernel density estimate. By default we plot grid lines with dimensions matching the standard deviations of the individual kernels. This gives a rough guideline as to what spatial details are and are not important in the density estimate. One can see that the IID KDE & KDEC estimates fit tightly to the data and report many significant details in the buffalo’s home range, including a hole near the coordinate (45,5) km. The autocorrelated estimates predict future space use more accurately, based on the diffusion model, and yield a more honest account of their uncertainties. In particular, the AKDE & AKDEC home-range areas appears larger and the presence of a hole near (45,5) cannot be resolved because the resolution is (appropriately) insufficient.

The area correction in the KDEC and AKDEC methods correct for the small sample-size biases inherent in the KDE and AKDE methods. In the case of the IID KDE, there is almost no correction made by KDEC because the effective sample size is perceived to be very large (see below) and so the bias is expected to be very small. In the case of the OUF AKDE, there is a modest correction made by AKDEC because the effective sample size is more accurately judged to be rather small (see below).

Finally, we can compare the area estimates and effective sample sizes.

summary(UD0)
## $DOF
##      area bandwidth 
##  3527.000  3528.014 
## 
## $CI
##                               low       ML     high
## area (square kilometers) 258.2631 267.0029 275.8861
summary(UD2)
## $DOF
##      area bandwidth 
##   22.9881   39.7542 
## 
## $CI
##                               low       ML     high
## area (square kilometers) 244.5244 385.7882 558.7413