Spline fitting differs from function fitting in that it does not return coefficients or a defined mathematical function.
Instead, it produces a smooth curve that closely follows the shape of the data.
The method is related to polynomial fitting, but the curve is built piecewise from multiple small polynomial sections.
How spline fitting works
A spline curve is constructed from individual polynomial segments joined at anchor points called knots.
Each segment is a simple curve — typically linear, quadratic, or cubic — with cubic splines being the most common.
The result is a smooth interpolating curve that passes close to (or exactly through) the data points while maintaining a continuous slope between segments.
Adjustable parameters
In CFTool, spline fitting provides two main controls:
- Curve type – choose between linear, quadratic, cubic, quartic or quintic interpolation.
- Knot spacing – adjust the distance between knots (and therefore the number of knots) using the slider in the Spline Fit pop-up tool.
As you move the slider:
- Larger spacing → fewer knots → smoother, more generalised curve.
- Smaller spacing → more knots → tighter fit that follows finer detail.
You can adjust the slider interactively until the curve gives a satisfactory representation of the data.
Performance considerations
With very large datasets (e.g. 1,000 points or more) containing significant scatter, using too many knots can require substantial computation time, especially on older systems.
To avoid slow processing:
- Start with the slider to the far right (widest spacing, fewest knots).
- Gradually move it left to increase knot density only as needed.
Tip: A spline that is “too flexible” may start following noise rather than the underlying trend — aim for a curve that captures the main shape without reproducing random scatter.
Typical applications
Spline fitting is especially useful when:
- The functional form of the relationship is unknown.
- You want a smooth calibration curve through empirical or experimental data.
- You need a non-parametric fit for visualisation or interpolation.
Unlike parametric fits, splines are purely descriptive — they provide an accurate graphical fit without producing explicit equations or coefficients.