density.lpp {spatstat}R Documentation

Kernel Estimate of Intensity on a Linear Network

Description

Estimates the intensity of a point process on a linear network by applying kernel smoothing to the point pattern data.

Usage

## S3 method for class 'lpp'
density(x, sigma=NULL, ...,
        weights=NULL,
        distance=c("path", "euclidean"),
        kernel="gaussian",
        continuous=TRUE,
        epsilon = 1e-06, verbose = TRUE,
        debug = FALSE, savehistory = TRUE,
        old=FALSE)

## S3 method for class 'splitppx'
density(x, sigma=NULL, ...)

Arguments

x

Point pattern on a linear network (object of class "lpp") to be smoothed.

sigma

Smoothing bandwidth (standard deviation of the kernel) in the same units as the spatial coordinates of x.

...

Arguments passed to as.mask determining the resolution of the result.

weights

Optional. Numeric vector of weights associated with the points of x. Weights may be positive, negative or zero.

distance

Character string (partially matched) specifying whether to use a kernel based on paths in the network (distance="path", the default) or a two-dimensional kernel (distance="euclidean").

kernel

Character string specifying the smoothing kernel. See dkernel for possible options.

continuous

Logical value indicating whether to compute the “equal-split continuous” smoother (continuous=TRUE, the default) or the “equal-split discontinuous” smoother (continuous=FALSE). Applies only when distance="path".

epsilon

Tolerance value. A tail of the kernel with total mass less than epsilon may be deleted.

verbose

Logical value indicating whether to print progress reports.

debug

Logical value indicating whether to print debugging information.

savehistory

Logical value indicating whether to save the entire history of the algorithm, for the purposes of evaluating performance.

old

Logical value indicating whether to use the old, very slow algorithm for the equal-split continuous estimator.

Details

Kernel smoothing is applied to the points of x using either a kernel based on path distances in the network, or a two-dimensional kernel. The result is a pixel image on the linear network (class "linim") which can be plotted.

There is also a method for split point patterns on a linear network (class "splitppx") which will return a list of pixel images.

Value

A pixel image on the linear network (object of class "linim").

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au and Greg McSwiggan.

References

McSwiggan, G., Baddeley, A. and Nair, G. (2016) Kernel density estimation on a linear network. Scandinavian Journal of Statistics 44, 324–345.

Okabe, A. and Sugihara, K. (2012) Spatial analysis along networks. Wiley.

See Also

lpp, linim, densityQuick.lpp

Examples

  X <- runiflpp(3, simplenet)
  D <- density(X, 0.2, verbose=FALSE)
  plot(D, style="w", main="", adjust=2)
  Dw <- density(X, 0.2, weights=c(1,2,-1), verbose=FALSE)
  De <- density(X, 0.2, kernel="epanechnikov", verbose=FALSE)
  Ded <- density(X, 0.2, kernel="epanechnikov", continuous=FALSE, verbose=FALSE)

[Package spatstat version 1.63-2 Index]