I have a set of points $(x_0,y_0)$ ... $(x_N,y_N)$ with the $x_i$ increasing and the $y_i$ such that $\frac{y_{i+1} - y_{i}}{x_{i+1} - x_{i}} > \frac{y_{i} - y_{i-1}}{x_{i} - x_{i-1}}$

Is there a well-known interpolation scheme that would give me a smooth function $f$ that is continuous, differentiable, and convex?

I don't want to constrain the derivative at the $x_i$, I just want the function to be as smooth as possible without introducing inflexion points. Ideally the derivative should be as smooth as possible as well.

Edit: For instance, in the following charts, I am trying to fit a set of points that are clearly convex. However the kernel interpolation I am performing is not:

enter image description here

  • $\begingroup$ A natural cubic spline will probably be convex "by chance". $\endgroup$
    – user65203
    Oct 17, 2018 at 9:38
  • $\begingroup$ This is what splines are for. Check out Bezier curves (quadratic and cubic are most widely used in computer graphics). It works by gluing parabolas/cubic lines according to some condition in the middle, and depending on the choice of constraints (minimal total curvature, continuity of derivatives, etc), you can get what you want. en.wikipedia.org/wiki/Spline_interpolation $\endgroup$
    – orion
    Oct 17, 2018 at 9:39
  • $\begingroup$ @Yves Are splines smooth? I thought they were only $C^2$. $\endgroup$
    – Jam
    Oct 17, 2018 at 9:44
  • $\begingroup$ @Jam: the OP is asking continuity and differentiability. $\endgroup$
    – user65203
    Oct 17, 2018 at 9:45
  • $\begingroup$ @Yves They ask for a smooth $f$ $\endgroup$
    – Jam
    Oct 17, 2018 at 9:46

1 Answer 1


It looks like Gregory's Shape Preserving Spline Interpolation https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19850020252.pdf provides a spline that fits the requirements. Strangely it doesn't seem to be implemented in any interpolation packages I found... Maybe it's got a different name...


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .