Curve fitting
What Is Curve Fitting?
Curve fitting is a class of numerical and statistical methods used to construct a mathematical function that approximates a set of observed data points. The function is selected or parameterized so that it minimizes a measure of discrepancy between the model and the data, most commonly the sum of squared residuals. Curve fitting appears throughout engineering, physics, and the computational sciences wherever measurements must be summarized by an equation: calibrating sensor outputs, modeling physical decay processes, extracting material parameters from experimental data, and constructing interpolating functions for use in simulation. The field draws on linear algebra, optimization theory, and approximation theory, and it is closely related to the broader discipline of statistical regression.
Curve fitting differs from exact interpolation in an important way: an interpolating function passes through every data point, while a fitted curve need only pass near the data, trading exact agreement for smoothness or adherence to a parametric form.
Least Squares Methods
The method of least squares, formalized by Gauss and Legendre in the early nineteenth century, is the most widely used framework for curve fitting. It defines the best-fit function as the one that minimizes the sum of squared differences between the observed data and the model's predictions. For linear models, including polynomial fits, the solution reduces to solving a system of normal equations, which can be computed efficiently using QR decomposition or singular value decomposition. Nonlinear least squares extends the framework to arbitrary functional forms through iterative algorithms such as Gauss-Newton and Levenberg-Marquardt. The NIST Statistical Reference Datasets for nonlinear regression provide benchmark problems with certified solutions, supporting validation of software implementations of least squares algorithms.
Interpolation and Splines
When data are dense and accurate, interpolation methods provide fitted functions that pass exactly through each point. Polynomial interpolation constructs a single polynomial of degree n-1 through n data points, but high-degree polynomials are prone to oscillation between points, a phenomenon known as Runge's phenomenon. Spline interpolation addresses this by using piecewise polynomials, typically cubic, joined at knots with continuity conditions on the function and its first and second derivatives. Cubic splines produce visually smooth curves and are numerically stable even for large datasets. B-splines and nonuniform rational B-splines (NURBS) extend spline theory to provide local control over the curve shape, meaning a change to one segment does not propagate to distant parts of the curve. Research on least-squares approximation by cubic splines shows how spline methods can be combined with least squares to fit smooth curves to noisy measurement data.
Surface Fitting
Surface fitting extends curve fitting from one-dimensional data to two-dimensional or higher-dimensional domains, finding a function of two or more variables that approximates a scattered dataset. Bivariate splines, radial basis functions, and tensor-product polynomial surfaces are common surface-fitting approaches. The choice among them depends on the regularity of the data sampling grid, the smoothness required of the fitted surface, and the computational resources available. Surface fitting is a standard component of geometric processing pipelines in computer graphics and computer-aided design, where measured point clouds from laser scanners or coordinate-measuring machines must be converted into smooth surface representations for rendering or manufacturing.
Applications
Curve fitting has applications in a wide range of disciplines, including:
- Sensor calibration and instrument characterization
- Computer graphics and 3D surface reconstruction
- Biomedical signal analysis and physiological parameter estimation
- Materials science: extracting constitutive law parameters from stress-strain data
- Geodesy and mapping: fitting terrain models to elevation measurements