2
$\begingroup$

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 http://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

$\endgroup$
  • $\begingroup$ Search terms that might be useful are "splines under tension" and "monotone splines". $\endgroup$ – marty cohen Aug 13 '13 at 13:57
2
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.