Distribution Function of Interpoint Distance
Computes the cumulative distribution function of the distance between two independent random points in a given window or windows.
distcdf(W, V=W, ..., dW=1, dV=dW, nr=1024)
- A window (object of class
"owin") containing the first random point.
- Optional. Another window containing the second random point.
- Arguments passed to
as.maskto determine the pixel resolution for the calculation.
- dV, dW
- Optional. Probability densities (not necessarily normalised)
for the first and second random points respectively.
Data in any format acceptable
as.im, for example, a
- Integer. The number of values of interpoint distance $r$ for which the CDF will be computed. Should be a large value!
This command computes the Cumulative Distribution Function $CDF(r) = Prob(T \le r)$ of the Euclidean distance $T = \|X_1 - X_2\|$ between two independent random points $X_1$ and $X_2$.
In the simplest case, the command
distcdf(W), the random points are
assumed to be uniformly distributed in the same
Alternatively the two random points may be
uniformly distributed in two different windows
In the most general case the first point $X_1$ is random
in the window
W with a probability density proportional to
dW, and the second point $X_2$ is random in
a different window
V with probability density proportional
The calculation is performed by numerical integration of the set covariance
setcov for uniformly distributed points, and
by computing the covariance function
imcov in the
general case. The accuracy of the result depends on
the pixel resolution used to represent the windows: this is controlled
by the arguments
... which are passed to
For example use
eps=0.1 to specify pixels of size 0.1 units.
V may also be point patterns
(objects of class
The result is the cumulative distribution function
of the distance from a randomly selected point in the point pattern,
to a randomly selected point in the other point pattern or window.
# The unit disc B <- disc() plot(distcdf(B))