我有一系列带有距离的点。我希望找到一个最能满足以下条件的点:
for (point_i, distance_i) in pointArray:
abs(point - point_i) = distance_i
我认为这可以通过某种回归或最小二乘来解决,但我在问题表述方面遇到了麻烦。
如果有人可以提供帮助,将不胜感激
您需要定义“最佳”才能提出可回答的问题。
What you probably want to do is define some sort of error function for how much being off from a given point matters, and then try to minimize the sum of the errors. The error function to use depends on what your actual problem is. For instance perhaps you want to use (length(point - point_i) - distance)2. That would be least squares. But perhaps you don't care so much about the absolute amount the distances are off, just the ratio between how far they are and how far you expected them to be. So you might use (length(point - point_i)/distance - 1)2. Perhaps you get the points and distances from a bunch of sensors. In that case the appropriate error function to use reflects how much uncertainty there is in your measurement of the distance.
一旦选择了合适的误差函数,您就需要找到一种方法来优化它。最简单的方法是计算误差函数的梯度,并使用它遵循路径查找算法到达最低点。如果你的错误函数表现良好,这应该可以工作,尽管不是那么快。如果您雄心勃勃,可以使用多元牛顿拉夫森方法来找到该点。这对你的误差函数做了更多的假设,并且会做很多工作,但会收敛much faster.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)