Hest(X, r=NULL, breaks=NULL, ..., W, correction=c("km", "rs", "han"), conditional=TRUE)
"ppp"
, "psp"
or "owin"
.
Alternatively a pixel image (class "im"
) with logical values.
as.mask
to control the discretisation.
"owin"
)
to be taken as the window of observation.
The contact distribution function will be estimated
from values of the contact distance inside W
.
"none"
, "rs"
, "km"
, "han"
and "best"
.
Alternatively correction="all"
selects all options.
X
lies closer than $r$ units away
from the fixed point $x$, given that X
does not cover $x$. Let $D = d(x,X)$ be the shortest distance from an arbitrary
point $x$ to the set X
. Then the spherical contact
distribution function is
$$H(r) = P(D \le r \mid D > 0)$$
For a point process, the spherical contact distribution function
is the same as the empty space function $F$ discussed
in Fest
.
The argument X
may be a point pattern
(object of class "ppp"
), a line segment pattern
(object of class "psp"
) or a window (object of class
"owin"
). It is assumed to be a realisation of a stationary
random set.
The algorithm first calls distmap
to compute the
distance transform of X
, then computes the Kaplan-Meier
and reduced-sample estimates of the cumulative distribution
following Hansen et al (1999).
If conditional=TRUE
(the default) the algorithm
returns an estimate of the spherical contact function
$H(r)$ as defined above.
If conditional=FALSE
, it instead returns an estimate of the
cumulative distribution function
$H*(r) = P(D <= r)$="" which="" includes="" a="" jump="" at="" $r="0$" if="" X has nonzero area.=>
Accuracy depends on the pixel resolution, which is controlled by the
arguments eps
, dimyx
and xy
passed to
as.mask
. For example, use eps=0.1
to specify
square pixels of side 0.1 units, and dimyx=256
to specify a
256 by 256 grid of pixels.
Hansen, M.B., Baddeley, A.J. and Gill, R.D. First contact distributions for spatial patterns: regularity and estimation. Advances in Applied Probability 31 (1999) 15-33.
Ripley, B.D. Statistical inference for spatial processes. Cambridge University Press, 1988.
Stoyan, D, Kendall, W.S. and Mecke, J. Stochastic geometry and its applications. 2nd edition. Springer Verlag, 1995.
Fest
X <- runifpoint(42)
H <- Hest(X)
Y <- rpoisline(10)
H <- Hest(Y)
H <- Hest(Y, dimyx=256)
X <- heather$coarse
plot(Hest(X))
H <- Hest(X, conditional=FALSE)
P <- owin(poly=list(x=c(5.3, 8.5, 8.3, 3.7, 1.3, 3.7),
y=c(9.7, 10.0, 13.6, 14.4, 10.7, 7.2)))
plot(X)
plot(P, add=TRUE, col="red")
H <- Hest(X, W=P)
Z <- as.im(FALSE, Frame(X))
Z[X] <- TRUE
Z <- Z[P, drop=FALSE]
plot(Z)
H <- Hest(Z)
Run the code above in your browser using DataLab