https://github.com/cran/spatstat
Tip revision: 48e143ac96b0ae956ecfbe40ff9b649e88cec4ac authored by Adrian Baddeley on 23 June 2008, 14:12:23 UTC
version 1.13-3
version 1.13-3
Tip revision: 48e143a
density.ppp.Rd
\name{density.ppp}
\alias{density.ppp}
\title{Kernel Smoothed Intensity of Point Pattern}
\description{
Compute a kernel smoothed intensity function from a point pattern.
}
\usage{
\method{density}{ppp}(x, sigma, \dots, weights, edge=TRUE, varcov=NULL)
}
\arguments{
\item{x}{
Point pattern (object of class \code{"ppp"}) to be smoothed.
}
\item{sigma}{
Standard deviation of isotropic Gaussian smoothing kernel.
}
\item{weights}{
Optional vector of weights to be attached to the points.
May include negative values.
}
\item{\dots}{
Arguments passed to \code{\link{as.mask}} to determine
the pixel resolution.
}
\item{edge}{
Logical flag: if \code{TRUE}, apply edge correction.
}
\item{varcov}{
Variance-covariance matrix of anisotropic Gaussian kernel.
Incompatible with \code{sigma}.
}
}
\value{
A pixel image (object of class \code{"im"}).
}
\details{
This is a method for the generic function \code{density}.
A kernel estimate of the intensity function of the point pattern
is computed (Diggle, 1985). The result is
the convolution of the isotropic Gaussian kernel of
standard deviation \code{sigma} with point masses at each of the data
points. The default is to assign
a unit weight to each point.
If \code{weights} is present, the point masses have these
weights (which may be signed real numbers).
If \code{edge=TRUE}, the intensity estimate is corrected for
edge effect bias by dividing it by the convolution of the
Gaussian kernel with the window of observation.
Instead of the isotropic Gaussian kernel with standard deviation
\code{sigma}, the smoothing kernel may be chosen to be any Gaussian
kernel, by giving the variance-covariance matrix \code{varcov}.
The arguments \code{sigma} and \code{varcov} are incompatible.
Also \code{sigma} may be a vector of length 2 giving the
standard deviations of two independent Gaussian coordinates,
thus equivalent to \code{varcov = diag(sigma^2)}.
Computation is performed using the Fast Fourier Transform.
Accuracy depends on the pixel resolution, controlled by the arguments
\code{\dots} passed to \code{\link{as.mask}}.
To perform spatial interpolation of values that were observed
at the points of a point pattern, use \code{\link{smooth.ppp}}.
}
\seealso{
\code{\link{smooth.ppp}},
\code{\link{ppp.object}},
\code{\link{im.object}}
}
\section{Warning}{
The result of \code{density.ppp} is not a probability density!
It is an estimate of the \emph{intensity function} of the
underlying point process. The integral of this function over the
window is not equal to 1; it equals the expected number of points
falling in the window.
}
\examples{
data(cells)
Z <- density.ppp(cells, 0.05)
plot(Z)
}
\references{
Diggle, P.J. (1985)
A kernel method for smoothing point process data.
\emph{Applied Statistics} (Journal of the Royal Statistical Society,
Series C) \bold{34} (1985) 138--147.
Diggle, P.J. (2003)
\emph{Statistical analysis of spatial point patterns},
Second edition. Arnold.
}
\author{Adrian Baddeley
\email{adrian@maths.uwa.edu.au}
\url{http://www.maths.uwa.edu.au/~adrian/}
and Rolf Turner
\email{r.turner@auckland.ac.nz}
}
\keyword{spatial}
\keyword{methods}
\keyword{smooth}