简体   繁体   English

如何将凸曲线拟合到数据点集

[英]How to fit a convex curve to set of data points

I have a set of data points (x1,y1) (x2,y2) (x3,y3) etc. The data is such that slope of successive points are increasing most of the time. 我有一组数据点(x1,y1)(x2,y2)(x3,y3)等。数据是连续点的斜率在大多数时间增加。 But there are a few exceptions. 但也有一些例外。 The software I load the data into expects that the slope should always increase or in other words that the curve should be convex. 我加载数据的软件期望斜率应该总是增加,换句话说,曲线应该是凸的。 So, I need a result set of data points (x1,y1), (x2,y2) etc such that the it removes the "exception" data points and replace them with appropriate data points which causes the slope to always increase. 因此,我需要一组数据点(x1,y1),(x2,y2)等,以便它删除“异常”数据点并用适当的数据点替换它们,这导致斜率总是增加。

I was going to write a program (in C#) to do this but I thought I would post here to check if this is a standard problem and solutions may already exist. 我打算写一个程序(在C#中)来做这个,但我想我会在这里发帖来检查这是否是标准问题并且解决方案可能已经存在。

Solving the problem depends on the objective. 解决问题取决于目标。 You could restrict yourself to changing the Y coordinates of the points, while keeping X fixed. 您可以限制自己更改点的Y坐标,同时保持X固定。 Then, a reasonable objective might be to minimize the sum of the absolute differences ABS(Y'-Y) between your new Y-value Y' and old value Y, for each point. 然后,合理的目标可能是为每个点最小化新Y值Y'和旧值Y之间的绝对差值ABS(Y'-Y)之和。 (I have no idea whether this is reasonable for your problem, but it does not sound very unreasonable to me.) (我不知道这对你的问题是否合理,但对我来说这听起来并不合理。)

Then the problem could be modelled as a linear program, see : 然后问题可以建模为线性程序,请参阅:

http://en.wikipedia.org/wiki/Linear_programming http://en.wikipedia.org/wiki/Linear_programming

There are standard libraries to find the optimal solution in such cases. 在这种情况下,有标准库可以找到最佳解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM