View source: R/ct_spatial_coverage.R
| ct_spatial_coverage | R Documentation |
Estimates spatial coverage
a species from camera-trap detection data using a kernel density approach.
The kernel bandwidth \hat{\sigma} is estimated from the
spatial spread of detection sites via Silverman's reference bandwidth rule
(Silverman 1986).
ct_spatial_coverage(
data,
site_column,
longitude,
latitude,
crs = c(4326, NULL),
study_area = NULL,
mask = NULL,
resolution,
isopleth = 0.95,
n_boot = 200
)
data |
A data frame of species detection records. |
site_column |
Column name of the camera-trap site identifier. |
longitude |
Column name of site longitude (or UTM easting). |
latitude |
Column name of site latitude (or UTM northing). |
crs |
A vector of length two specifying the coordinate reference systems:
|
study_area |
Optional |
mask |
Optional |
resolution |
Numeric. Side length of one grid cell in the units of the active CRS (metres if projected). |
isopleth |
Numeric in |
n_boot |
Integer. Bootstrap resamples for the standard error of
|
The term home range is typically associated with dynamic movement data, such as those recorded by radio-tracking or GPS devices, which provide continuous or near-continuous tracking of an individual animal's movements. Since camera traps are static and only capture presence/absence or activity within their specific locations, the concept of home range might not fully apply.
Each camera station where the species was detected contributes equally (binary detection). A Gaussian kernel is centred at each detection site and the average surface is computed:
\hat{f}(\mathbf{x}) =
\frac{1}{n} \sum_{i=1}^{n}
\exp\!\left(-\frac{\|\mathbf{x} - \mathbf{x}_i\|^2}{2\,\hat{\sigma}^2}\right)
The bandwidth \hat{\sigma} is the reference bandwidth (Silverman
1986, eq. 4.14, extended to 2-D):
\hat{\sigma} = \sqrt{\hat{\sigma}_x \, \hat{\sigma}_y} \; n^{-1/6}
where \hat{\sigma}_x and \hat{\sigma}_y are the standard
deviations of the detection-site coordinates and n is the number of
detection sites. This is the asymptotically MISE-optimal bandwidth under a
bivariate normal reference distribution. It shrinks with more sites and widens
when detections are spatially dispersed.
The standard error of \hat{\sigma} is obtained by nonparametric
bootstrap: sites are resampled with replacement n_boot times and
\hat{\sigma} recomputed each time; the SE is the standard deviation
of those bootstrap estimates, and the 95 % CI is their 2.5th - 97.5th
percentiles.
Cells are ranked by kernel density (descending). The isopleth isopleth
retains the smallest set of cells whose cumulative density equals
isopleth of the total - the standard minimum-volume contour estimator
(Worton 1989).
A named list with three elements:
Coverage rasterA SpatRaster (terra) containing the kernel
density surface, clipped to the isopleth isopleth, with masked and
out-of-isopleth cells set to NA.
BandwidthA named numeric vector: sigma (estimated bandwidth in
CRS units), SE (bootstrap SE; NA if n_boot = 0), CI_low and
CI_high (95 % bootstrap CI), n_sites, and isopleth.
Coverage statsA one-row tibble: coverage area in km^2,
\hat{\sigma} +/- SE, detection-site count, and isopleth level.
Silverman, B. W. (1986). Density Estimation for Statistics and Data Analysis. Chapman and Hall, London.
Worton, B. J. (1989). Kernel methods for estimating the utilization distribution in home-range studies. Ecology, 70(1), 164-168. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2307/1938423")}
library(dplyr)
data(penessoulou)
cam_data <- penessoulou %>%
dplyr::filter(project == "First") %>%
dplyr::filter(species == "Erythrocebus patas", number > 0)
spc <- ct_spatial_coverage(
data = cam_data,
site_column = camera,
longitude = longitude,
latitude = latitude,
crs = "EPSG:32631",
resolution = 30 # meter
)
# Plot coverage raster
library(terra)
terra::plot(spc$`Coverage raster`)
## Bandwidth estimate with uncertainty
spc$Bandwidth
## Coverage area summary
spc$`Coverage stats`
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.