pppdist(X, Y, q = 1, precision = 7, show.rprimal = FALSE, belowone = TRUE, timelag = 0)
"ppp"
).Inf
for the Prohorov distance).10^(-precision)
.pppmatching
that represents the
matching. There are methods for plot
, print
and summary
for this class.X
and Y
which minimises the sum of the distances between matched points
(if q=1
), the maximum distance between matched points
(if q=Inf
), and in general the 1/q
th power of the sum of
the q
th powers of the distances between matched points.
If $q < 1$ this is known as the Wasserstein distance,
and if $q=Inf$ it is the Prohorov distance. For finite exponents q
, there is a fast C algorithm,
which will handle patterns of 100 points without difficulty,
but should not be used with thousands of points.
If show.rprimal=TRUE
, slower interpreted code is used
to demonstrate the algorithm.
For q=Inf
, even slower interpreted R code is used,
and this works only for very small point patterns.
X <- runifpoint(42)
Y <- runifpoint(42)
pppdist(X, Y)
pppdist(X[1:10], Y[1:10], q=Inf)
Run the code above in your browser using DataLab