Performs spatial smoothing of numeric values observed at a set of irregular locations, using adaptive (variable-bandwidth) kernel smoothing.
SmoothAdaptiveKernel(X, bw, ...)# S3 method for ppp
SmoothAdaptiveKernel(X, bw, ...,
weights=NULL,
at=c("pixels", "points"))
If at="pixels" (the default), the result is a pixel image.
If at="points", the result is a numeric vector with one entry
for each data point in X.
Point pattern (object of class "ppp").
Numeric vector of smoothing bandwidths for each point in X,
or a pixel image giving the smoothing bandwidth at each spatial
location, or a spatial function of class "funxy" giving the
smoothing bandwidth at each location.
The default is to compute bandwidths using bw.abram.ppp.
Arguments passed to
bw.abram.ppp to compute the smoothing bandwidths
if bw is missing,
or passed to as.mask
to control the spatial resolution of the result,
or passed to densityAdaptiveKernel.ppp to control
calculations such as edge corrections.
Optional vector of numeric weights for the points of X.
String specifying whether to compute the smoothed values
at a grid of pixel locations (at="pixels") or
only at the points of X (at="points").
Adrian Baddeley Adrian.Baddeley@curtin.edu.au.
This function performs spatial smoothing of the
mark values of X using spatially-adaptive kernel smoothing.
The function SmoothAdaptiveKernel is generic.
This file documents the method for point patterns,
SmoothAdaptiveKernel.ppp.
The argument X should be a marked point pattern (an object
of class "ppp" with mark values given by marks(X)).
The mark values will be interpreted as numerical observations
recorded at the spatial locations of the points of X.
This function applies spatial smoothing to the mark values.
The argument bw specifies the smoothing bandwidths to be
applied to each of the points in X. It may be a numeric vector
of bandwidth values, or a pixel image or function yielding the
bandwidth values. See densityAdaptiveKernel.ppp for more
information.
The smoother is an adaptive (variable-bandwidth) version of the
Nadaraya-Watson smoother.
If the points of X are \(x_1,\ldots,x_n\),
the mark values are \(v_1,\ldots,v_n\)
and the corresponding bandwidths are
\(\sigma_1,\ldots,\sigma_n\)
then the adaptive kernel smoother at a location \(u\) is
$$
S(u) = \frac{
\sum_{i=1}^n v_i k(u, x_i, \sigma_i)
}{
\sum_{i=1}^n k(u, x_i, \sigma_i)
}
$$
where \(k(u, v, \sigma)\) is the value at \(u\)
of the (possibly edge-corrected) smoothing kernel with bandwidth \(\sigma\)
induced by a data point at \(v\).
The algorithm uses densityAdaptiveKernel.ppp
to compute the numerator and denominator of this expression.
bw.abram.ppp,
Smooth.ppp,
densityAdaptiveKernel.ppp.
X <- redwood3
marks(X) <- X$x
Z <- SmoothAdaptiveKernel(X, h0=0.1)
plot(Z, main="Adaptive smoother")
Run the code above in your browser using DataLab