The smoothing spline is a method of smoothing (fitting a smooth curve to a set of noisy observations) using a spline function.
Contents |
Let be a sequence of observations, modeled by the relation . The smoothing spline estimate of the function is defined to be the minimizer (over the class of twice differentiable functions) of[1]
Remarks:
It is useful to think of fitting a smoothing spline in two steps:
Now, treat the second step first.
Given the vector of fitted values, the sum-of-squares part of the spline criterion is fixed. It remains only to minimize , and the minimizer is a natural cubic spline that interpolates the points . This interpolating spline is a linear operator, and can be written in the form
where are a set of spline basis functions. As a result, the roughness penalty has the form
where the elements of A are . The basis functions, and hence the matrix A, depend on the configuration of the predictor variables , but not on the responses or .
Now back the first step. The penalized sum-of-squares can be written as
where . Minimizing over gives
De Boor's approach exploits the same idea, of finding a balance between having a smooth curve and being close to the given data.[2]
where is a parameter called smooth factor and belongs to the interval , and are the quantities controlling the extent of smoothing (they represent the weight of each point ). In practice, since cubic splines are mostly used, is usually . The solution for was proposed by Reinsch in 1967.[3] For , when approaches , converges to the "natural" spline interpolant to the given data.[2] As approaches , converges to a straight line (the smoothest curve). Since finding a suitable value of is a task of trial and error, a redundant constant was introduced for convenience.[3] is used to numerically determine the value of so that the function meets the following condition:
The algorithm described by de Boor starts with and increases until the condition is met.[2]. If is an estimation of the standard deviation for , the constant is recommended to be chosen in the interval . Having means the solution is the "natural" spline interpolant.[3] Increasing means we obtain a smoother curve by getting farther from the given data.
Given the constraint from the definition formula we can conclude that the algorithm doesn't work for any sets of data. If we plan to use this algorithm for random points in a multidimensional space we need to find a solution to give as input to the algorithm sets of data where these constraints are met. A solution for this is to introduce a parameter so that the input data would be represented as single-valued functions depending on that parameter; after this the smoothing will be performed for each function. In a bidimensional space a solution would be to parametrize and so that they would become and where . A convenient solution for is the cumulating distance where .[4][5]
A more detailed analysis on parametrization is done by E.T.Y Lee.[6]
Smoothing splines are related to, but distinct from:
Source code for spline smoothing can be found in the examples from Carl de Boor's book A Practical Guide to Splines. The examples are in Fortran programming language. The updated sources are available also on Carl de Boor's official site[1].