Computes individual contributions to the pair correlation function from each data point.
localpcf(X, ..., delta=NULL, rmax=NULL, nr=512, stoyan=0.15)
localpcfinhom(X, ..., delta=NULL, rmax=NULL, nr=512, stoyan=0.15,
lambda=NULL, sigma=NULL, varcov=NULL,
update=TRUE, leaveoneout=TRUE)
A point pattern (object of class "ppp"
).
Smoothing bandwidth for pair correlation. The halfwidth of the Epanechnikov kernel.
Optional. Maximum value of distance
Optional. Number of values of distance
Optional. The value of the constant delta
.
Optional.
Values of the estimated intensity function, for the
inhomogeneous pair correlation.
Either a vector giving the intensity values
at the points of the pattern X
,
a pixel image (object of class "im"
) giving the
intensity values at all locations, a fitted point process model
(object of class "ppm"
, "kppm"
or "dppm"
)
or a function(x,y)
which
can be evaluated to give the intensity value at any location.
These arguments are ignored by localpcf
but are passed by localpcfinhom
(when lambda=NULL
)
to the function density.ppp
to control the kernel smoothing estimation of lambda
.
Logical value (passed to density.ppp
or
fitted.ppm
) specifying whether to use a
leave-one-out rule when calculating the intensity.
Logical value indicating what to do when lambda
is a fitted model
(class "ppm"
, "kppm"
or "dppm"
).
If update=TRUE
(the default),
the model will first be refitted to the data X
(using update.ppm
or update.kppm
)
before the fitted intensity is computed.
If update=FALSE
, the fitted intensity of the
model will be computed without re-fitting it to X
.
An object of class "fv"
, see fv.object
,
which can be plotted directly using plot.fv
.
Essentially a data frame containing columns
the vector of values of the argument
the theoretical value
localpcf
computes the contribution, from each individual
data point in a point pattern X
, to the
empirical pair correlation function of X
.
These contributions are sometimes known as LISA (local indicator
of spatial association) functions based on pair correlation.
localpcfinhom
computes the corresponding contribution
to the inhomogeneous empirical pair correlation function of X
.
Given a spatial point pattern X
, the local pcf
X
is computed by
X
, and i
and j
. Here k
is the
Epanechnikov kernel,
NA
if
The smoothing bandwidth stoyan
.
For localpcfinhom
, the optional argument lambda
specifies the values of the estimated intensity function.
If lambda
is given, it should be either a
numeric vector giving the intensity values
at the points of the pattern X
,
a pixel image (object of class "im"
) giving the
intensity values at all locations, a fitted point process model
(object of class "ppm"
, "kppm"
or "dppm"
)
or a function(x,y)
which
can be evaluated to give the intensity value at any location.
If lambda
is not given, then it will be estimated
using a leave-one-out kernel density smoother as described
in pcfinhom
.
# NOT RUN {
data(ponderosa)
X <- ponderosa
g <- localpcf(X, stoyan=0.5)
colo <- c(rep("grey", npoints(X)), "blue")
a <- plot(g, main=c("local pair correlation functions", "Ponderosa pines"),
legend=FALSE, col=colo, lty=1)
# plot only the local pair correlation function for point number 7
plot(g, est007 ~ r)
gi <- localpcfinhom(X, stoyan=0.5)
a <- plot(gi, main=c("inhomogeneous local pair correlation functions",
"Ponderosa pines"),
legend=FALSE, col=colo, lty=1)
# }
Run the code above in your browser using DataLab