# smooth.ppp

##### Spatial smoothing of observations at irregular points

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

##### Usage

`smooth.ppp(X, ..., weights = rep(1, X$n))`

##### Arguments

- X
- A marked point pattern (object of class
`"ppp"`

). - ...
- Arguments passed to
`density.ppp`

to control the kernel smoothing. - weights
- Optional weights attached to the observations.

##### Details

This function performs spatial smoothing of numeric values observed at a set of irregular locations.

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`

)
in which the points are the observation locations,
and the marks are the numeric values observed at each point.
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 (the weights appear in both the sums
in the equation above).

##### Value

- A pixel image (object of class
`"im"`

). Pixel values are values of the interpolated function.

##### See Also

`density.ppp`

,
`ppp.object`

,
`im.object`

.
To perform interpolation, see the `akima`

package.

##### 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))
```

*Documentation reproduced from package spatstat, version 1.12-5, License: GPL (>= 2)*