Spline interpolation that is non-decreasing when given non-decreasing sequence

1k Views Asked by At

How can I achieve a spline interpolation such that when given non-decreasing sequence of points the resulting spline will also be a non-decreasing function (and vice-versa, when given non-increasing sequence the interpolation would also be non-increasing)?

For example, here is a natural cubic spline interpolation: a natural cubic spline interpolation https://i.stack.imgur.com/W5yPA.png

over the following dataset:

270 71
333 102
355 109
406 111
427 168
As you can see, the polynom between points [355, 109] and [406, 111] is decreasing at some interval.

What kind of spline is best suited for such "monotone" interpolation?

EDIT: so here is the result of monotone cubic Hermite interpolation using Fritsch–Carlson method suggested by bubba: a monotone cubic Hermite interpolation using Fritsch–Carlson method

1

There are 1 best solutions below

0
On BEST ANSWER

One popular method is the Fritsch-Carlson algorithm. It's described on this Wikipedia page.

The basic idea is to use some simple formulae to obtain a derivative at each data point. Then, between each two data points, you can construct a Hermite cubic segment from two points and two derivatives.

The resulting curve is only $C_1$ continuous, as opposed to the $C_2$ continuity that you would get from a conventional interpolating cubic spline. But, I expect that monotonicity is more important to you than $C_2$ continuity, so this is probably not a problem.