| smooth.ppp {spatstat} | R Documentation |
Performs spatial smoothing of numeric values observed at a set of irregular locations.
smooth.ppp(X, ..., weights = rep(1, X$n), at="pixels") markmean(X, ...) markvar(X, ...)
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").
|
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],...,v[n] at locations x[1],...,x[n] respectively, then the smoothed value at a location u is (ignoring edge corrections)
g(u) = (sum of k(u-x[i]) v[i])/(sum of 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 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) = (sum of k(u-x[i]) v[i] w[i])/(sum of k(u-x[i]) w[i])
By default, the result is
a pixel image (object of class "im").
Pixel values are values of the interpolated function.
If at="points", the result is a numeric vector
of length equal to the number of points in x.
Entries are values of the interpolated function at the points of x.
Adrian Baddeley adrian@maths.uwa.edu.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner r.turner@auckland.ac.nz
density.ppp,
ppp.object,
im.object.
To perform interpolation, see the akima package.
# 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))