Learn R Programming

spatstat.explore (version 3.6-0)

densityfun.ppp: Kernel Estimate of Intensity as a Spatial Function

Description

Compute a kernel estimate of intensity for a point pattern, and return the result as a function of spatial location.

Usage

densityfun(X, ...)

# S3 method for ppp densityfun(X, sigma = NULL, ..., weights = NULL, edge = TRUE, diggle = FALSE)

Arguments

Value

A function with arguments x,y,drop. The function also belongs to the class "densityfun" which has methods for print and as.im. It also belongs to the class "funxy" which has methods for plot, contour and persp.

Details

The commands densityfun and density both perform kernel estimation of the intensity of a point pattern. The difference is that density returns a pixel image, containing the estimated intensity values at a grid of locations, while densityfun returns a function(x,y) which can be used to compute the intensity estimate at any spatial locations with coordinates x,y. For purposes such as model-fitting it is more accurate to use densityfun.

See Also

density.

To interpolate values observed at the points, use Smoothfun.

Examples

Run this code
  f <- densityfun(swedishpines)
  f
  f(42, 60)
  X <- runifpoint(2, Window(swedishpines))
  f(X)
  plot(f)

Run the code above in your browser using DataLab