在平铺空间中找到平均点?
我有一个瓷砖2D空间中的积分集合(我相信它称为环形几何/空间),我想找到他们的平均值:
基本方法就是将他们的平均值'在哪里'您只会将空间视为 nonting 。看这个示例,我想那将在中间的某个地方。但是,从扩展的示例中看,我会说中间可能是数据中最糟糕的表示。
我想说的目的是找到一个位置,其中平均值的总变化最小为
一种潜在的方法是尝试在9个邻居中的每个邻居中的所有点组合,然后查看哪一个的方差最低,但是这很快变得极为低: 大o = o(8^n) 我相信,通过独立处理X和Y之类的事情可以使其更有效,但这只会将其减少到 o(5^n),因此仍然无法管理。
也许爬山可能会起作用吗?如果我有一个随机点,然后计算每个点的最低差异,然后进行一些随机调整并再次测试如果差异降低,然后重复此操作,直到达到看似最佳的值。
有更好的方法吗?还是某种启发式的“足够好”方法?
I have a collection of points in tiling 2D space (I believe its called toroidal geometry/space), and I want to find their mean:
The basic approach would be to just take their mean 'locally' where you would just treat the space as non-tiling. Looking at the example, I'd guess that that would be somewhere in about the middle. However, looking at the extended example, I'd say that the middle is probably one of the worst representations of the data.
I'd say the objective is to find a location where the total variation from the mean is at a minimum
One potential method would be to try all combinations of points in each of the 9 neighbours, and then see which one has the lowest variance, but that becomes extremely inefficient very quickly:
Big O = O(8^n)
I believe it could probably be made more efficient by doing something like treating the x and y independently, but that would only reduce it to O(5^n), so still not manageable.
Perhaps hill-climbing might work? Where I have a random point, and then calculate the lowest possible variance for each point, then make some random adjustments and test again reverting if the variance decreases, I then repeat this until I reach a seemingly optimal value.
Is there a better method? Or maybe some sort of heuristic 'good enough' method?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我了解,您正在尝试找到质量中心。
要这样做(对于每个瓷砖),您必须找到每个位置的总和乘以其重量(假设是1,因为它们只是相同的点的位置不同)然后将其除以权重的总和(这是在此示例中,重量为重量= 1)。公式
in our example:
这是一个python实现:
至于多个图块,您可以计算每个瓷砖的中心,然后是中心的中心,或将来自多个瓷砖的所有点视为一个大图块的点,并计算所有瓷砖的中心。
as of my understanding, you are trying to find the center of mass.
to do so (for each tile) you have to find the sum of each positions multiplied by its weight (assume it is 1 because they are just identical points positioned differently) then divide this by the sum of the weights (which is the number of points in this example as weight = 1). The formula
in our example:
here is a python implementation :
as for multiple tiles you can calculate the center for each tile then the center for the centers, or treat all points from multiple tiles as points from one big tile and calculate the center of all of them.