Compute the geometrically-corrected inhomogeneous \(K\) function for a point pattern on a linear network.
Knetinhom(X, lambda, r = NULL, freq, ..., verbose=FALSE)
Function value table (object of class "fv"
).
Point pattern on a linear network (object of class "lpp"
).
Fitted intensity of the point process. Either a numeric vector
giving values of the fitted intensity at each data point of
X
, or an object of class
"linim"
, "linfun"
or "lppm"
from which the
fitted intensity at each data point can be extracted.
Optional. Numeric vector of values of the function argument \(r\). There is a sensible default.
Vector of frequencies corresponding to the point events on the network. The length of this vector should be equal to the number of points on the network. The default frequency is one for every point on the network.
Ignored.
Logical value indicating whether to print progress reports during the computation.
Suman Rakshit (modified by Adrian Baddeley)
This command computes the inhomogeneous version of the geometrically-corrected \(K\) function, proposed by Ang et al (2012), from point pattern data on a linear network.
The algorithm used in this computation is described in Rakshit et al (2019).
The spatstat function
linearKinhom
is usable (and slightly faster) for this purpose
for small datasets, but requires substantial amounts of memory.
For larger datasets,
the function Knetinhom
is much more efficient.
Ang, Q.W., Baddeley, A. and Nair, G. (2012) Geometrically corrected second-order analysis of events on a linear network, with applications to ecology and criminology. Scandinavian Journal of Statistics 39, 591--617.
Rakshit, S., Baddeley, A. and Nair, G. (2019)
Efficient code for second order analysis of events on a linear network.
Journal of Statistical Software 90 (1) 1--37.
DOI: 10.18637/jss.v090.i01
UC <- unmark(chicago)
fit <- lppm(UC ~ x+y)
r <- seq(0, 1000, length = 41)
K <- Knetinhom(UC, lambda=fit, r = r)
Run the code above in your browser using DataLab