With the convention that the residual term is a sum rather than an average, the penalised least squares criterion is
Minimize over functions whose first derivative is absolutely continuous and whose second derivative is square-integrable, that is, the usual Sobolev space . The cubic smoothing spline is its minimizer, with natural boundary conditions and linear continuation outside the data range. It is a natural cubic spline with possible knots at the observed , but usually does not interpolate the noisy .
To see why the minimizer is a natural spline, for any take the natural cubic spline interpolant through its values and write . Then . Integrating by parts on every knot interval twice gives zero: the terms involving vanish at knots, the terms involving cancel because is continuous there, and the outer terms vanish by the natural boundary conditions. Hence
while their residual sums of squares agree. Replacing by never increases the criterion. This proves the minimum roughness property of the natural cubic spline interpolant needed here.
For fitted values , write , where is positive semidefinite and has the sampled affine functions as its two-dimensional nullspace. The finite-dimensional minimization becomes . Its strictly positive definite Hessian is , so it has the unique solution
This is the roughness-matrix formula for a natural cubic smoothing spline. Larger penalizes curvature more strongly. As the fit approaches interpolation; as it approaches the ordinary least-squares affine line.