linearkd {secrlinear} | R Documentation |
Kernel Density on Linear Network
Description
This function applies the kernel density methods of McSwiggan et al. (2016) as implemented in spatstat (Baddeley et al. 2015). The default method solves the heat equation McSwiggan et al. (2016).
Usage
linearkd(X, linmask, sigma, which = NULL, ...)
Arguments
X |
2-column matrix of coordinates |
linmask |
linear habitat mask |
sigma |
numeric spatial scale of kernel |
which |
index vector to select subset of edges (optional) |
... |
other arguments passed to |
Details
The density along the network of the points in X is saved as covariate ‘density’ of the linear mask.
Setting to FALSE the argument ‘finespacing’ of densityHeat.lpp
speeds up estimation.
Value
A linear habitat mask identical to the input except for the additional covariate.
Warning
This function is still in development: there are details to resolve concerning terminal vertices etc.
References
Baddeley, A., Rubak, E., and Turner, R. 2015. Spatial Point Patterns: Methodology and Applications with R. Chapman and Hall/CRC Press, London. ISBN 9781482210200, https://www.routledge.com/Spatial-Point-Patterns-Methodology-and-Applications-with-R/Baddeley-Rubak-Turner/p/book/9781482210200/.
McSwiggan, G., Baddeley, A. and Nair, G. 2016. Kernel density estimation on a linear network. Scandinavian Journal of Statistics 44, 324–345.
See Also
Examples
# simulate some points
set.seed(123)
pop <- sim.linearpopn(glymemask, N = 40)
# restrict edges to overcome a glitch in this particular linearmask
tmp <- linearkd(X = pop, linmask = glymemask, sigma = 30,
which = 1:325, finespacing = FALSE)
plot(tmp, cov = 'density', cex = 1.7)
plot (pop, add = TRUE, cex = 1.4)
# view covariates
head(covariates(tmp))