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)
billy <- buffalo[[1]]
M0 <- ctmm.fit(billy) # no autocorrelation timescales
M2 <- ctmm.fit(billy,ctmm(tau=c(1,6*24)*60^2)) # ~ 1 hour and 6 day autocorrelation timescales
M0
is the innapropriate, uncorrelated model, and M2
is the vastly superior, continuous-velocity model. With this we can calculate an akde
object for each model.
kd0 <- akde(billy,M0)
kd2 <- akde(billy,M2)
Given that we do not precisely know the autocorrelation parameters of the data, each akde
object actually contains three kernel density estimates: kde.ML
, kde.lower
, and kde.upper
corresponding to the maxmimum likelihood optimal smoothing and confidence intervals on the optimal smoothing. The significance level for these confidence levels can be set with the alpha
option, which defaults to the conventional 0.05
(see help(akde)
).
Now let us plot the results.
plot.telemetry(billy,akde=kd0)
plot.telemetry(billy,akde=kd2,fraction=0.80)
A more useful function for plotting in R-studio is telemetry.zoom
, 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 alpha.HR
option (see help(plot.telemetry)
). The inner and outer contours correspond to confidence intervals on the optimal smoothing. I.e., the maximum likelihood point estimate may be undersmoothed or oversmoothed because of error in our autocorrelation estimation. This pair of contours does not represent all of the uncertainty in the home-range estimate, but it gives a good sense of the magnitude of area.
Even if our autocorrelation estimate were perfect, that still does not make the kernel density estimate itself perfect. A key detail for interpreting a kernel density estimate is the optimal bandwidth, as its spatial scales effectively determine the “resolution” of the kernel density estimate. Therefore, 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 conventional, uncorrelated estimate tightly fits to the data and reports many significant details in the buffalo’s home range. The autocorrelated estimate predicts future space use more accurately and yields a more honest account of its uncertainties.