Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On P. Janert's book Data Analysis with Open Source Tools there is a discussion on splines, that they are "constructed from piecewise polynomial functions (typically cubic) that are joined together in a smooth fashion" and in addition "must also satisfy a global smoothness condition by optimizing the functional".

$$ J[s] = \alpha \int \bigg(\frac{d^2s}{dt^2}\bigg)^2 dt + (1-\alpha) \sum_i w_i (y_i - s(x_i))^2 $$

The first term controls how “wiggly” the spline is overall, because the second derivative measures the curvature of s(t) and becomes large if the curve has many wiggles. The second term captures how accurately the spline represents the data points by measuring the squared deviation of the spline from each data point.

Does anyone know an explanation of the theory and implementation for splines that continues in this vein? Apparently "these smoothness conditions lead to a set of linear equations for the coefficients in the polynomials, which can be solved". Janert's book gives no derivation for this, I was wondering if anyone has references to material or knowledge about the details for this technique hopefully with working Matlab or Python code.

I found a readable explanation here


share|cite|improve this question
up vote 1 down vote accepted

Look at this page, especially the references:

As the comments say, deBoor's book has Fortran code. Also, deBoor wrote the spline package in Matlab, so that may have the same capabilities (I didn't check).

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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