Data approximation#

In order to build \(r\), one can either use a pre-defined sequence of control points \(\{ c[k] \}_{k=0,...,M-1}\) or of knots \(\{ n[k] \}_{k=0,...,M-1}\). Alternatively, one can also attempt to retreive the control points that best approximate a set of data points, as in the classical spline approximation setting.

The problem is framed as follows. We consider a set \(\{ p[i] \}_{i=0,...,N-1}\) of \(N\) points to be approximated with the spline model (1) of \(M\) control points. Hereafter, we will assume a periodic spline model, but a similar derivation can easily be done for the non-periodic case.

We obtain an approximation by ensuring that the samples of the spline \(r\) match the data points \(p\), which translates to

(1)#\[p[i] = \sum_{k=0}^{M-1}c[k]\phi\left(\frac{Mi}{N}-k\right).\]

Since \(\phi\) is of finite support, we can re-write (1) as

(2)#\[\mathbf{\Phi}\mathbf{C} = \mathbf{P},\]

with the basis matrix \(\mathbf{\Phi}\) (size \(N \times M\)), the control point matrix \(\mathbf{C}\) (size \(M \times 1\)), and the data points matrix \(\mathbf{P}\) (size \(N \times 1\)) given by

(3)#\[\begin{split}\mathbf{\Phi} = \begin{bmatrix} \phi(0) & \phi(-1) & \dots & \ \phi(-(M-1)) \\ \phi\left(\frac{M}{N}\right) & \phi\left(\frac{M}{N}-1\right) & \dots & \ \phi\left(\frac{M}{N}-(M-1)\right) \\ \vdots & \vdots & \ddots & \vdots \\ \phi\left(\frac{(N-1)M}{N}\right) & \phi\left(\frac{(N-1)M}{N}-1\right) & \dots & \ \phi\left(\frac{(N-1)M}{N}-(M-1)\right) \end{bmatrix}\end{split}\]
(4)#\[\begin{split}\mathbf{C} = \begin{bmatrix} c[0] \\ \vdots \\ c[M-1] \end{bmatrix}\end{split}\]
(5)#\[\begin{split}\mathbf{P} = \begin{bmatrix} p[0] \\ \vdots \\ p[N-1] \end{bmatrix}.\end{split}\]

The control points \(\mathbf{C}\) can then be retreived by finding the least-square best solution that minimizes

(6)#\[\| \mathbf{P} - \mathbf{\Phi} \mathbf{C} \|^2_2.\]