density.psp {spatstat}R Documentation

Kernel Smoothing of Line Segment Pattern or Linear Network

Description

Compute a kernel smoothed intensity function from a line segment pattern or a linear network.

Usage

  ## S3 method for class 'psp'
density(x, sigma, ..., edge=TRUE,
                   method=c("FFT", "C", "interpreted"),
                   at=NULL)

  ## S3 method for class 'linnet'
density(x, ...)

Arguments

x

Line segment pattern (object of class "psp") or linear network (object of class "linnet") to be smoothed.

sigma

Standard deviation of isotropic Gaussian smoothing kernel.

...

Extra arguments, including arguments passed to as.mask to determine the resolution of the resulting image.

edge

Logical flag indicating whether to apply edge correction.

method

Character string (partially matched) specifying the method of computation. Option "FFT" is the fastest, while "C" is the most accurate.

at

Optional. An object specifying the locations where density values should be computed. Either a window (object of class "owin") or a point pattern (object of class "ppp" or "lpp").

Details

These are methods for the generic function density for the classes "psp" (line segment patterns) and "linnet" (linear networks). If x is a linear network, it is first converted to a line segment pattern.

A kernel estimate of the intensity of the line segment pattern is computed. The result is the convolution of the isotropic Gaussian kernel, of standard deviation sigma, with the line segments. The result is computed as follows:

If edge=TRUE this result is adjusted for edge effects by dividing it by the convolution of the same Gaussian kernel with the observation window.

If the argument at is given, then it specifies the locations where density values should be computed.

Value

A pixel image (object of class "im") or a numeric vector.

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner r.turner@auckland.ac.nz and Ege Rubak rubak@math.aau.dk.

See Also

psp.object, im.object, density

Examples

  L <- psp(runif(20),runif(20),runif(20),runif(20), window=owin())
  D <- density(L, sigma=0.03)
  plot(D, main="density(L)")
  plot(L, add=TRUE)

[Package spatstat version 1.64-1 Index]