Optimal Match Between Two Point Patterns
Given two point patterns, find the optimal match between them.
pppdist(X, Y, q = 1, precision = 7, show.rprimal = FALSE, belowone = TRUE, timelag = 0)
- Two point patterns (objects of class
- Exponent of the Wasserstein distance
Inffor the Prohorov distance).
- Index controlling accuracy of algorithm.
Interpoint distances will be rounded to the nearest multiple of
- Logical. Whether to display a plot showing the iterative solution of the restricted primal problem.
- Logical. Experimental use only. Indicates whether to rescale the distances by a fudge factor.
- Time lag, in seconds, between successive displays of the iterative solution of the restricted primal problem.
Finds the matching between the point patterns
which minimises the sum of the distances between matched points
q=1), the maximum distance between matched points
q=Inf), and in general the
1/qth power of the sum of
qth 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.
show.rprimal=TRUE, slower interpreted code is used
to demonstrate the algorithm.
q=Inf, even slower interpreted R code is used,
and this works only for very small point patterns.
- An object of class
pppmatchingthat represents the matching. There are methods for
summaryfor this class.
X <- runifpoint(42) Y <- runifpoint(42) pppdist(X, Y) pppdist(X[1:10], Y[1:10], q=Inf)