Creates an object of class "pppmatching"
representing
a matching of two planar point patterns (objects of class "ppp"
).
pppmatching(X, Y, am, type = NULL, cutoff = NULL, q = NULL,
mdist = NULL)
Two point patterns (objects of class "ppp"
).
An npoints(X)
by npoints(Y)
matrix with entries as.matrix
.
A character string giving the type of the matching.
One of "spa"
, "ace"
or "mat"
, or NULL
for a generic or unknown matching.
Numerical values specifying the cutoff value NULL
if not applicable or unknown.
Numerical value for the distance to be associated with the matching.
The argument am
is interpreted as a "generalized adjacency matrix":
if the [i,j]
-th entry is positive, then the i
-th point
of X
and the j
-th point of Y
are matched and the
value of the entry gives the corresponding weight of the match. For
an unweighted matching all the weights should be set to
The remaining arguments are optional and allow to save
additional information about the matching. See the help files for
pppdist
and matchingdist
for details on
the meaning of these parameters.
# NOT RUN {
# a random unweighted complete matching
X <- runifpoint(10)
Y <- runifpoint(10)
am <- r2dtable(1, rep(1,10), rep(1,10))[[1]]
# generates a random permutation matrix
m <- pppmatching(X, Y, am)
summary(m)
m$matrix
# }
# NOT RUN {
plot(m)
# }
# NOT RUN {
# a random weighted complete matching
X <- runifpoint(7)
Y <- runifpoint(7)
am <- r2dtable(1, rep(10,7), rep(10,7))[[1]]/10
# generates a random doubly stochastic matrix
m2 <- pppmatching(X, Y, am)
summary(m2)
m2$matrix
# }
# NOT RUN {
# Note: plotting does currently not distinguish
# between different weights
plot(m2)
# }
Run the code above in your browser using DataLab