Skip to content

Spline Estimation

The Spline Estimation option is useful for difficult to fit data and when only a simple interpolation or estimation is needed.

The interpolation algorithms pass exactly through each data point:

  • Cubic
  • Cubic constrnd
  • B-Spline

The smoothing algorithms are:

  • Cubic smooth
  • LS B-Spline fix
  • LS B-Spline opt
  • LS B-Spline usr
  • NURBS

TableCurve 2D offers a selection of some of the finer spline procedures currently in use. For more information on spline algorithms, you may wish to refer to Carl de Boor, "A Practical Guide to Splines", 1978, Springer-Verlag, New York, ISBN 0-387-90356-9. A large portion of the spline algorithms in modern use can be traced to the Fortran routines in this excellent reference.

Algorithm

The Cubic option fits a cubic spline interpolant where the breakpoints or knots of the spline are the X values of the data. As such, the knots and order are fixed. Endpoint conditions are automatically determined, these corresponding to the not-a-knot condition described by de Boor, which requires that the third derivative of the spline be continuous at the second and next-to-last breakpoint. The spline passes exactly through each data point. for more details, see de Boor's CUBSPL (pages 55-59), or the routine CSINT in the IMSL library.

The Cubic constrnd option is similar, except that a method by Akima (H. Akima, "A New Method of Interpolation and Smooth Curve Fitting Based on Local Procedures, J. ACM 17, 1970, 589-602 or de Boor, p.53 or CSAKM in the IMSL library) is used to minimize the 'wiggles' common to cubic splines. The wild swings observed when noisy data are fit to cubic splines do not occur with this algorithm. Again, the spline passes exactly through each data point.

The Cubic smooth option fits a smooth cubic spline to the data. The smoothing is automatically determined using a procedure known as cross-validation. Since the interpolant will not pass exactly through the data, TableCurve 2D reports a standard error (SE) and r² for this type of spline. For more information on smoothing splines, refer to deBoor's SMOOTH (p235-243), for cross validation to P. Craven and G. Wahba (1979), and to CSSCV in the IMSL library.

The B-Spline option fits the B-spline of a specified order using a knot sequence based upon the X-values of the data. The knots are thus fixed. Permissible orders range from 2 (quadratic) through order 8. The B-spline passes exactly through each data point. For more information, see de Boor's SPLINT (p204-208) or BSINT in the IMSL library.

The LS B-Spline fix option offers a B-spline where the knots are not located at the X-values, but fixed in position, and lower in count than the number of data points. For this option, you must set both the order and the number of knots desired. The smaller the number of knots, the greater will be the smoothing of noisy data. TableCurve 2D reports a standard error (SE) and r² for this type of spline. This algorithm produces a least-squares minimization. For more information, refer to de Boor's L2APPR (p255-258) or to BSLSQ in the IMSL library.

The LS B-Spline opt option is identical to the previous spline, except that the knots are now variable, and are shifted to further minimize the overall least squares fit. Again, you must set both the order and the number of knots desired and a standard error (SE) and r² will be reported. Due to its iterative nature, this algorithm is appreciably slower than all of the other spline options. For more information, refer to de Boor's NEWNOT (p184-186,258-261) or to BSVLS in the IMSL library.

The LS B-Spline usr option offers a B-spline where the knots are now located at user-specified X-values. For this option to be available, a knot sequence must first be imported. You must also specify the spline order.

The NURBS option fits a non-uniform rational B-spline to the data. The knots are fixed at the X values of the data points. The order can vary from 2 to 8. Unlike the wild oscillations sometimes observed with the higher order B-splines, NURBS become smoother with increasing order. A NURBS by its nature is a smoothing spline, and does not pass exactly through the data points. A standard error (SE) and r² is thus reported. Because NURBS have become the model of choice for high-end 3D modeling applications, much information is available in the OpenGL materials. Another reference is W. T. Hewitt and D. Yi, "The NURBS Procedure Library", AGOCG, May 1992.

Order

The order can be set for the B-Spline options and the NURBS option. The cubic splines are obviously fixed at order 3.

Knots

The knots can only be set for the three least-squares B-spline options which allow variable knots. It is recommended that you start with a small number of knots, and increase the knot count until a satisfactory fit is obtained. the goodness of fit will improve with knot count, but this means rather little. A B-Spline with a count of fixed knots equal to the X values produces the standard B-spline, a perfect fit that passes exactly through each point.

Generate/8944.gif The Import Knot Sequence button is used to import a user-defined knot sequence. Once a valid knot sequence has been imported, the LS B-Spline usr algorithm will be enabled. The knot sequence can be contained in any of TableCurve 2D's supported import formats. Specify only the interior knots in the sequence. The knots at the data bounds are automatically added.

Output

The principal output will interpolate the spline model or Function. Mainly for the procedures that perform smoothing, it is also possible to directly evaluate the first or second derivative (1st Deriv, 2nd Deriv).

For derivatives, be very cautious with noisy data. A significant level of smoothing is generally needed to produce accurate derivatives. With noisy data, a spline that performs significant smoothing is essential for valid derivatives. The Savitzky-Golay Spline Estimation option is recommended for serious derivative evaluations.

A quadratic spline has a continuous first derivative. A cubic spline is smooth in the first derivative and continuous in the second derivative. A quartic spline is smooth in both first and second derivatives and continuous in the third derivative. If you need a smooth derivative, be sure you use a spline order two greater than the derivative desired.

For the output, the number of elements n are generated between x start and x end. Up to 65536 values can be generated. The starting and ending X values should be at or within the range of the input data. The default values will perform a 2x upsampling within the x range of the data.

Sectioning Data

You may enable or disable regions of data or individual points just as within TableCurve 2D’s main Section Data option. When the state of one or more points is changed, the spline is recomputed and the graph is updated.

Goodness of Fit Statistics

A standard error (SE) and r² are reported. These statistics are of limited use, although they do allow a comparison between a favored spline estimation and your choice of a parametric fit.

List

Generate/8943.gif The List Data option lists the index, time, and output in a three column table. The listing uses the TableCurve 2D text viewer facility.

Copy

Generate/8941.gif The Copy Data to Clipboard option copies the time and output values to the clipboard. Formats include full precision binary (for spreadsheets such as Excel) and ASCII (for pasting into text editors).

Save

Generate/8942.gif The Save Data to Disk option writes the time and output values to a supported file format. These formats include ASCII, Excel 97/2000, Excel 95, Lotus WK3, Lotus WK1, SPSS, or Systat.

Production Facility

Generate/8946.gif The TableCurve 2D Automation facility allows unattended processing of large numbers of data sets. The data sets can be consolidated in an Excel file or acquired using a DLL. The graphs can be exported to an MS Word/RTF file, while the processed data can be exported to an Excel 95 or Excel 97/2000 file.

Generate/8912.gif The Reset button restores the data to its state when first entering the procedure. If an Automation Session is in progress, the Reset button can be used to terminate the automated processing.

Residuals

Generate/8957.gif The Residuals button opens a TableCurve 2D Graph containing the residuals from the spline fit. The residuals are the difference between the data and spline model. This option is not available for the spline procedures that exactly interpolate the data.

Evaluation

Generate/89581.gif The Evaluation option offers the means to more extensively evaluate the spline model. The evaluation can be be direct, or the computation can consist of first or second derivatives, roots, or integrated areas. This option can be used to generate a table or file of any size using a generated X grid or by importing X data from supported file formats.

MS Word/RTF Export

Generate/8971.gif The MS Word/RTF File Export option is used to save the current graph to either an MS Word file or a portable RTF (Rich Text Format) file. The graph is inserted into the file as a Windows metafile.

Automatic Update

The List, Residuals, and Evaluation windows are automatically updated when any change is made to the algorithm's settings.

Updating the Data Table

Generate/8910.gif When exiting this procedure with the OK button, an option will be presented to update TableCurve 2D's main data table with the estimated data.

If Background Thread Fitting is active, the fitting will be initiated as soon as the estimation is accepted and the data is rescanned.

.