Smoothly Interpolating a Set of Data

This Demonstration lets you compare piecewise quadratic interpolation with a little-known variation of it that always gives a smooth interpolation function. This means that derivatives of all orders exist for this function. Smoothness is achieved by joining neighboring quadratic interpolation polynomials by means of a smooth sigmoid function that depends on a positive parameter . This sigmoid is given by a surprisingly simple formula:
The checkbox allows you to toggle between smooth interpolation and piecewise quadratic interpolation. Locator points can be shifted, deleted, or added. This allows you to test a variety of interpolation situations. The sigmoid function is always shown below the graphical representation of the interpolated function. Pale colors in this representation indicate that the function presently runs idle since the smooth interpolation mechanism is not selected using the checkbox. The parameter always has the value that is selected by the slider. Varying can be seen to change the curve σ considerably, but it rarely has much affect on the interpolation.


  • [Snapshot]
  • [Snapshot]
  • [Snapshot]
  • [Snapshot]


Snapshot 1: Piecewise quadratic interpolation, as implemented here by the Mathematica function Interpolation, may result in kinks.
Snapshot 2: No kinks result with the smooth version.
Snapshots 3 and 4 show the lowest considered value and the largest considered value of the sigmoid's steepness parameter in action. The preferred value 0.81 (more precisely 0.810747) of this parameter minimizes the integral of the square of the second derivative (i.e. total kinetic energy in a quantum analogy) of the sigmoid.
The proposed interpolation method is basically twice as expensive as piecewise quadratic interpolation. It is thus a computationally very cheap method and gives perfectly smooth curves and, unlike spline methods, needs no preparatory run. The method of switching softly from one local dataset to the next by means of a smooth sigmoid can also be used for higher-order local interpolation or even for rational interpolation instead of polynomial interpolation. A historical note: These generalizations are worked out in detail in the Kodak (European Research) Technical Report, Ulrich Mutze, "Smooth Interpolation through Many Points via Partition of Unity," Accession No. 278844A, September, 9, 1992, which is not publicly available. A short presentation of the second-order polynomial method can be found on page 4 of Ulrich Mutze, "A Simple Variational Integrator for General Holonomic Mechanical Systems," 2003 at http://www.ma.utexas.edu/mp_arc/c/03/03-491.pdf. It differs in the treatment of the boundaries of the data, in that it switches smoothly to linear interpolation there that, as a rule, is more useful for extrapolation. In the present work such finesse would complicate the comparison with the nonsmooth method.
The proposed sigmoid function is remarkable since it is smooth and nevertheless grows from 0 to 1 in a compact interval (which here is [0,1]). Therefore, it can conveniently replace the nonsmooth sigmoids in fuzzy logic and in wavelets.
    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.

Mathematica »
The #1 tool for creating Demonstrations
and anything technical.
Wolfram|Alpha »
Explore anything with the first
computational knowledge engine.
MathWorld »
The web's most extensive
mathematics resource.
Course Assistant Apps »
An app for every course—
right in the palm of your hand.
Wolfram Blog »
Read our views on math,
science, and technology.
Computable Document Format »
The format that makes Demonstrations
(and any information) easy to share and interact with.
STEM Initiative »
Programs & resources for
educators, schools & students.
Computerbasedmath.org »
Join the initiative for modernizing
math education.
Powered by Wolfram Mathematica © 2014 Wolfram Demonstrations Project & Contributors  |  Terms of Use  |  Privacy Policy  |  RSS Give us your feedback
Note: To run this Demonstration you need Mathematica 7+ or the free Mathematica Player 7EX
Download or upgrade to Mathematica Player 7EX
I already have Mathematica Player or Mathematica 7+