matchingdist(spatstat)
matchingdist()所属R语言包:spatstat
Distance for a Point Pattern Matching
距离的点模式匹配
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Computes the distance associated with a matching between two point patterns.
计算两个点图案之间的匹配相关联的距离。
用法----------Usage----------
matchingdist(matching, type = NULL, cutoff = NULL, q = NULL)
参数----------Arguments----------
参数:matching
A point pattern matching (an object of class "pppmatching").
点模式匹配(一个类的对象"pppmatching"“)。
参数:type
A character string giving the type of distance to be computed. One of "spa", "ace" or "mat". See details below.
的字符字符串,给出的类型,要计算的距离。 "spa","ace"或"mat"之一。详见下文。
参数:cutoff
The value > 0 at which interpoint distances are cut off.
值> 0INTERPOINT距离被切断。
参数:q
The order of the average that is applied to the interpoint distances. May be Inf, in which case the maximum of the interpoint distances is taken.
的平均的顺序被施加到INTERPOINT距离。可能是Inf,在这种情况下,采取INTERPOINT距离的最大值的。
Details
详细信息----------Details----------
Computes the distance specified by type, cutoff, and order for a point matching. If any of these arguments are not provided, the function uses the corresponding elements of matching (if available).
计算距离type,cutoff和order的点匹配的。如果没有提供任何参数,该函数使用的matching相应的元素(如果有)。
For the type "spa" (subpattern assignment) it is assumed that the points of the point pattern with the smaller cardinality m are matched to a m-point subpattern of the point pattern with the larger cardinality n in a 1-1 way. The distance is then given as the q-th order average of the m distances between matched points (minimum of Euclidean distance and cutoff) and n-m "penalty distances" of value cutoff.
对于类型"spa"(分配)的子模式,它假定该点的小基数mm点的点模式的子模式匹配与较大的点图案与基数n在1-1。的距离q个订单平均m匹配点之间的距离(最小欧氏距离和cutoff)n-m“刑罚的距离”,然后,值cutoff。
For the type "ace" (assignment only if cardinalities equal) the matching is assumed to be 1-1 if the cardinalities of the point patterns are the same, in which case the q-th order average of the matching distances (minimum of Euclidean distance and cutoff) is taken. If the cardinalities are different, the matching may be arbitrary and the distance returned is always equal to cutoff.
对于类型"ace"(工作分配仅当匹配基数相等)被假定为1-1,如果基数的点图案是相同的,在这种情况下,q-阶的平均匹配距离(最小欧氏距离和cutoff)的意见。如果基数是不同的,匹配的可能是任意的,并且返回的距离总是相等cutoff。
For the type mat (mass transfer) it is assumed that each point of the point pattern with the smaller cardinality m has mass 1, each point of the point pattern with the larger cardinality n has mass m/n, and fractions of these masses are matched in such a way that each point contributes exactly its mass. The distance is then given as the q-th order weighted average of all distances (minimum of Euclidean distance and cutoff) of (partially) matched points with weights equal to the fractional masses divided by m.
对于类型mat(传质),假设的点图形的每个点的小基数m有质量1,各点的点图案与较大的基数 n有质量m/n,和这些群众的分数在这样一种方式,每个点有助于正是它的质量相匹配。的距离,然后给出q个阶加权平均的距离(最小欧氏距离和cutoff)(部分)匹配点与的分数除以群众的重量等于<X >。
If the cardinalities of the two point patterns are equal, matchingdist(m, type, cutoff, q) yields the same result no matter if type is "spa", "ace" or "mat".
如果两个点模式的基数是平等的,matchingdist(m, type, cutoff, q)产生同样的结果,无论type如果是"spa","ace"或"mat"。
值----------Value----------
Numeric value of the distance associated with the matching.
与匹配相关联的距离的数值。
(作者)----------Author(s)----------
Dominic Schuhmacher
<a href="mailto:dominic.schuhmacher@stat.unibe.ch">dominic.schuhmacher@stat.unibe.ch</a>
<a href="http://www.dominic.schuhmacher.name">http://www.dominic.schuhmacher.name</a>
参见----------See Also----------
pppdist pppmatching.object
pppdistpppmatching.object
实例----------Examples----------
# an optimal matching[最佳的匹配]
X <- runifpoint(20)
Y <- runifpoint(20)
m.opt <- pppdist(X, Y)
summary(m.opt)
matchingdist(m.opt)
# is the same as the distance given by summary(m.opt)[摘要由给定的距离是相同(m.opt)]
# sequential nearest neighbour matching[连续的最近邻匹配]
# (go through all points of point pattern X in sequence[(序列中所有点的点模式X]
# and match each point with the closest point of Y that is[和匹配每个点与最接近的点的Y是]
# still unmatched)[还是无与伦比)]
am <- matrix(0, 20, 20)
h <- matrix(c(1:20, rep(0,20)), 20, 2)
h[1,2] = nncross(X[1],Y)[1,2]
for (i in 2:20) {
nn <- nncross(X[i],Y[-h[1 i-1),2]])[1,2]
h[i,2] <- ((1:20)[-h[1 i-1),2]])[nn]
}
am[h] <- 1
m.nn <- pppmatching(X, Y, am)
matchingdist(m.nn, type="spa", cutoff=1, q=1)
# is >= the distance obtained for m.opt[> =距离为m.opt获得]
# in most cases strictly >[在大多数情况下,严格>]
## Not run: [#不运行:]
par(mfrow=c(1,2))
plot(m.opt)
plot(m.nn)
text(X$x, X$y, 1:20, pos=1, offset=0.3, cex=0.8)
## End(Not run)[#(不执行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|