简体   繁体   中英

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. 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.

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.

Solving the problem depends on the objective. You could restrict yourself to changing the Y coordinates of the points, while keeping X fixed. 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. (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

There are standard libraries to find the optimal solution in such cases.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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