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)
"ppp"
).delta
.X
,
a pixel image (object of class "im"
) gilocalpcf
but are passed by localpcfinhom
(when lambda=NULL
)
to the function density.ppp
to control the kernel smoothing "fv"
, see fv.object
,
which can be plotted directly using plot.fv
.
Essentially a data frame containing columnsi
corresponds to the i
th point.
The last two columns contain the r
and theo
values.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
$g_i(r)$ associated with the $i$th point
in X
is computed by
X
, and $d_{ij}$ is the distance
between points i
and j
. Here k
is the
Epanechnikov kernel,
NA
if
$r > b_i$, where $b_i$
is the distance from point $i$ to the boundary of the
observation window. The smoothing bandwidth $\delta$ may be specified.
If not, it is chosen by Stoyan's rule of thumb
$\delta = c/\hat\lambda$
where $\hat\lambda = n/a$ is the estimated intensity
and $c$ is a constant, usually taken to be 0.15.
The value of $c$ is controlled by the argument 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"
) 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
.
localK
,
localKinhom
,
pcf
,
pcfinhom
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