smooth.ppp

0th

Percentile

Spatial smoothing of observations at irregular points

Performs spatial smoothing of numeric values observed at a set of irregular locations. Uses Gaussian kernel smoothing.

Keywords
methods, smooth, spatial
Usage
smooth.ppp(X, ..., weights = rep(1, npoints(X)), at="pixels")
markmean(X, ...)
markvar(X, ...)
Arguments
X
A marked point pattern (object of class "ppp").
...
Arguments passed to density.ppp to control the kernel smoothing and the pixel resolution of the result.
weights
Optional weights attached to the observations.
at
String specifying whether to compute the intensity values at a grid of pixel locations (at="pixels") or only at the points of X (at="points").
Details

The function smooth.ppp performs spatial smoothing of numeric values observed at a set of irregular locations. The functions markmean and markvar are wrappers for smooth.ppp which compute the spatially-varying mean and variance of the marks of a point pattern.

Smoothing is performed by Gaussian kernel weighting. If the observed values are $v_1,\ldots,v_n$ at locations $x_1,\ldots,x_n$ respectively, then the smoothed value at a location $u$ is (ignoring edge corrections) $$g(u) = \frac{\sum_i k(u-x_i) v_i}{\sum_i k(u-x_i)}$$ where $k$ is a Gaussian kernel. The argument X must be a marked point pattern (object of class "ppp", see ppp.object). The points of the pattern are taken to be the observation locations $x_i$, and the marks of the pattern are taken to be the numeric values $v_i$ observed at these locations.

The marks are allowed to be a data frame (in smooth.ppp and markmean). Then the smoothing procedure is applied to each column of marks. The numerator and denominator are computed by density.ppp. The arguments ... control the smoothing kernel parameters and determine whether edge correction is applied. See density.ppp.

The optional argument weights allows numerical weights to be applied to the data. If a weight $w_i$ is associated with location $x_i$, then the smoothed function is (ignoring edge corrections) $$g(u) = \frac{\sum_i k(u-x_i) v_i w_i}{\sum_i k(u-x_i) w_i}$$

An alternative to kernel smoothing is inverse-distance weighting, which is performed by idw.

Value

  • If X has a single column of marks:
    • Ifat="pixels"(the default), the result is a pixel image (object of class"im"). Pixel values are values of the interpolated function.
    • Ifat="points", the result is a numeric vector of length equal to the number of points inX. Entries are values of the interpolated function at the points ofX.
    If X has a data frame of marks:
    • Ifat="pixels"(the default), the result is a named list of pixel images (object of class"im"). There is one image for each column of marks. This list also belongs to the classlistof, for which there is a plot method.
    • Ifat="points", the result is a data frame with one row for each point ofX, and one column for each column of marks. Entries are values of the interpolated function at the points ofX.
    The return value has attributes "sigma" and "varcov" which report the smoothing bandwidth that was used.

See Also

density.ppp, ppp.object, im.object.

See idw for inverse-distance weighted smoothing. To perform interpolation, see also the akima package.

Aliases
  • smooth.ppp
  • markmean
  • markvar
Examples
# Longleaf data - tree locations, marked by tree diameter
   data(longleaf)
   # Local smoothing of tree diameter
   Z <- smooth.ppp(longleaf)
   # Kernel bandwidth sigma=5
   plot(smooth.ppp(longleaf, 5))
   # mark variance
   plot(markvar(longleaf))
   # data frame of marks: trees marked by diameter and height
   data(finpines)
   plot(smooth.ppp(finpines))
Documentation reproduced from package spatstat, version 1.23-2, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.