National Physical Laboratory

Using Splines in Metrology

Empirical models are important to metrology in cases where the knowledge of the underlying physics for a measurement system is insufficient to characterise it completely. For empirical models depending on one variable, polynomial and particularly polynomial spline curves, when used with care, are generally very satisfactory for representing data.

A polynomial spline curve is composed of a sequence of polynomial curves joined together at points called knots, and in such a way as to ensure smoothness of the complete curve. An example of a spline curve composed of four cubic polynomial pieces joined so that the curve and its first and second derivatives are all continuous is shown in Figure 1.

Spline curves provide a flexible class of functions that are effective for representing a wide variety of shapes. The knots, however, generally have no physical meaning for the metrologist, and yet the effectiveness of a spline representation can depend critically on their number and positions. Consequently, metrology users require assistance with knot placement via appropriate algorithms and software. NPL and the University of Huddersfield are undertaking work as part of the Software Support for Metrology (SSfM) programme to provide this assistance.

Automatic knot placement is a very difficult problem. A number of knot placement strategies[1] are available, however, to help the user select a sensible, if not necessarily optimal, set of knots. Some of these strategies work by sequentially inserting knots in order to maximise the improvement in the spline fit (measured, for example, in terms of the root-mean-square residual value); others work by deleting knots in order to minimise the change in the quality of the fit. Figure 2 shows the effect on the root-mean-square residual of a spline fit to experimental data resulting from the application of a knot insertion algorithm followed by the application of a knot deletion algorithm.

Cubic Spline Curve
Figure 1: A cubic spline curve s(x), 0 < x < 10, with interior knots at x = 1, 2 and 5. (Click image to see full size).

Knot Insertion and Knot Deletion
Figure 2: Effect on the root-mean-square residual of a spline fit to experimental data of knot insertion and knot deletion. (Click the image to see full size).

A software package, containing a number of knot placement algorithms, is to be made available through MetroS. This package will act as a pre-processor to NPLFit; software developed by NPL for modelling experimental data using polynomial and spline curves, and also available through MetroS.

Reference

  1. Cox, M G, Harris, P M, Kenward, P D, "Fixed- and free-knot univariate least-squares data approximation by polynomial splines" NPL Report CMSC 13/02, May 2002

Find out more

NPLFit in MetroS

Last Updated: 25 Mar 2010
Created: 5 Jun 2007