# Univariate Cubic L1 Interpolating Splines: Spline Functional, Window Size and Analysis-based Algorithm

^{1}

^{2}

^{*}

## Abstract

**:**

_{1}interpolating splines calculated on 5-point windows, on 7-point windows and on global data sets using four different spline functionals, namely, ones based on the second derivative, the first derivative, the function value and the antiderivative. Computational results indicate that second-derivative-based 5-point-window L

_{1}splines preserve shape as well as or better than the other types of L

_{1}splines. To calculate second-derivative-based 5-point-window L

_{1}splines, we introduce an analysis-based, parallelizable algorithm. This algorithm is orders of magnitude faster than the previously widely used primal affine algorithm.

_{1}spline; first derivative; 5-point window; function value; global; interpolation; locally calculated; second derivative; univariate

## 1. Introduction

_{1}splines have been shown to provide superior shape preservation for interpolation and approximation of multiscale data, that is, data with sudden large changes in magnitude and/or spacing used for modeling of natural and urban terrain, geophysical features, biological objects, robotic paths and many other irregular surfaces, processes and functions ([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]). The minimization principles for L

_{1}splines have typically (but not uniformly) been based on the L

_{1}norm of the second derivative (rather than on the L

_{1}norm of expressions involving other levels of derivatives). The resulting non-differentiable convex generalized geometric programs have been solved by active set [3], primal affine [5,6,7,10,11] and primal-dual [12,14] algorithms.

_{1}splines for large data sets [9,12]. There is also unpublished computational experience of the authors and others who have noticed issues of incomplete convergence or not completely correct convergence of the active set, primal affine and primal-dual algorithms for both univariate and bivariate L

_{1}splines. It is in this context that we seek in this paper a new algorithmic approach for calculating L

_{1}splines. Auquiert, Gibaru and Nyiri [16] have developed a subdifferential-based procedure for calculating second-derivative-based L

_{1}splines on 5-point windows. We propose here an algorithm for second-derivative-based 5-point-window L

_{1}splines based on the analysis in Section 2 of [17], which links, via analytical properties of the spline functional, local geometric properties of 5-point windows of the data set with geometric properties of the L

_{1}spline interpolant.

_{1}splines, three types of information are needed for full “situational awareness,” namely, 1) information about whether use of 5-point windows is superior to use of windows of other sizes and to use of global data sets, 2) information about whether use of the second derivative in the spline functional is superior to use of the first derivative, function value or antiderivative and 3) information about whether the new, analysis-based algorithm mentioned above can achieve computational results superior to those of the primal affine algorithm, which was the previously most widely used algorithm for calculating L

_{1}splines. The third item here has not yet been considered in the literature and the information in the literature on the first and second items is sketchy at best. The computational and analytical results in [2,16,17] do suggest that 5-point windows have advantages vs. global calculations. However, it is not yet known whether windows of other sizes might also have advantages. Results presented in [10,11] indicate that first-derivative-based and function-value-based L

_{1}splines may have advantages over standard second-derivative-based L

_{1}splines. However, these two publications considered only the behavior of L

_{1}splines on the global scale and did not consider behavior on the fine, interval-to-interval scale.

_{1}splines. In Section 3, we compare L

_{1}splines calculated by minimizing, on 5-point windows, on 7-point windows and on global data sets, four different spline functionals, namely, ones based on the second derivative, the first derivative, the function value and the antiderivative. These L

_{1}splines are calculated by the primal affine algorithm. The results of this section provide motivation for the development of a new, analysis-based algorithm for calculating 5-point-window, second-derivative-based L

_{1}splines. In Section 4, we present this new algorithm, which is based on the analysis in Section 2 of [17]. In Section 5, we show that, while the results of both the new algorithm and the primal affine algorithm look good on the macro level, there are differences on the micro level. Specifically, the results of the new algorithm are accurate on the micro level while those of the primal affine algorithm are occasionally only approximate. Finally, in Section 6, we summarize the results presented in the previous sections and point out the potential for future algorithms for locally calculated univariate L

_{1}approximating splines and locally calculated bivariate L

_{1}interpolating and approximating splines.

_{1}splines discussed in this paper are cubic polynomials in each interval $({x}_{i},{x}_{i+1})$, $i=0,1,\dots ,I-1$, and are C

^{1}continuous at the nodes. The first derivative of the spline at node ${x}_{i}$, $i=0,1,\dots ,I$, is denoted by ${b}_{i}$ (to be determined by minimization of the L

_{1}spline functional). We use ${\delta}_{i}$ to denote the slope of the chord between neighboring points:

_{1}spline by the standard Hermite interpolation formula. For reference, we present here the spline functionals that define traditional, globally calculated L

_{1}splines (“global L

_{1}splines”). Second-derivative-based, first-derivative-based, function-value-based and antiderivative-based cubic L

_{1}splines are calculated by minimizing

^{1}piecewise cubic polynomials z that interpolate the data. The L

_{1}splines that minimize these functionals can be nonunique, a situation that will be handled by adding “regularization terms” to the functionals when they are minimized by the primal affine algorithm or, in the new algorithm proposed in this paper, by applying a “choice procedure” as described below in Section 4. Second-derivative-based L

_{1}splines are the L

_{1}splines commonly encountered in the literature. First-derivative-based L

_{1}splines have been investigated in [10,11]. Function-value-based L

_{1}splines have been treated in [11]. Antiderivative-based L

_{1}splines are newly introduced in this present paper to provide additional insight into how the order of the derivative in the spline functional affects the geometric shape preservation properties of the L

_{1}spline.

^{2}. The data $({x}_{i},{z}_{i})$, $i=36,37,38,39,40,41,42,43$, in the region from x = 37 to x = 45 lie on the cubic function −16(x − 41) + (x − 41)

^{3}. Note the large gaps in the intervals $[{x}_{30},{x}_{31}]=[27.3,34.7]$ and $[{x}_{39},{x}_{40}]=[37.3,44.7]$. In the figures, the data will be represented by dots “·”. The linear spline for these data is given in Figure 1.

## 2. Primal Affine and Other Previously Available Algorithms for L_{1} Splines

_{1}spline functionals (4), (5), (6) and (7) is a nonlinear programming problem. Direct minimization of (4) has been accomplished by an active set method [3]. Active set algorithms for minimizing (5), (6) and (7) have not been developed, but these functionals and functional (4) have been minimized by primal affine algorithms and primal-dual algorithms [12,14]. Primal affine and primal-dual algorithms are linear (not nonlinear) programming procedures. To create a linear program suitable for application of these algorithms, the integrals in the L

_{1}spline functionals need to be discretized. For the primal affine algorithm used in the present paper and in [5,6,8,10,11], the spline functionals were discretized by the midpoint rule with K equal subintervals in each interval $({x}_{i},{x}_{i+1})$. In this paper, K = 100. For a detailed description of the primal affine algorithm, see [7].

_{1}splines by the primal affine method using the global functionals (4), (5), (6) and (7), we add to these functionals the regularization terms

_{1}spline that minimizes the functional with the regularization term is unique. For the computational experiments of the present paper, ε = 10

^{−4}.

_{1}splines by minimizing the global functionals (4), (5), (6) and (7) by the primal affine method, we will calculate L

_{1}splines using these functionals on 5-point and 7-point windows. To calculate the derivative ${b}_{i}$ of a “windowed” L

_{1}spline at node ${x}_{i}$, we minimize functionals that are the same as (4), (5), (6) and (7) except that the integral is over a local set of intervals (“window”) rather than over the global domain. For 5-point-window L

_{1}splines, the window $[{x}_{\widehat{\u0131}-2},{x}_{\widehat{\u0131}+2}]$ is used for nodes ${x}_{\widehat{\u0131}}$, $\widehat{\u0131}=2,3,\dots ,I-2$, the window $[{x}_{0},{x}_{4}]$ is used for nodes ${x}_{\widehat{\u0131}}$, $\widehat{\u0131}=0,1$ and the window $[{x}_{I-4},{x}_{I}]$ is used for nodes ${x}_{\widehat{\u0131}}$, $\widehat{\u0131}=I-1,I$. For 7-point-window ${L}_{1}$ splines, the window $[{x}_{\widehat{\u0131}-3},{x}_{\widehat{\u0131}+3}]$ is used for nodes ${x}_{\widehat{\u0131}}$, $\widehat{\u0131}=3,4,\dots ,I-3$, the window $[{x}_{0},{x}_{6}]$ is used for nodes ${x}_{\widehat{\u0131}}$, $\widehat{\u0131}=0,1,2$ and the window $[{x}_{I-6},{x}_{I}]$ is used for nodes ${x}_{\widehat{\u0131}}$, $\widehat{\u0131}=I-2,I-1,I$. When minimizing a “windowed” L

_{1}spline functional for node ${x}_{\widehat{\u0131}}$ by the primal affine algorithm, we add to the spline functional the regularization term

^{−4}.

## 3. Computational Results for Windowed and Global L_{1} Splines

_{1}splines as well as for global L

_{1}splines.

_{1}splines based on spline functionals involving first derivatives and function values, that is, derivatives of degree lower than the standard second degree. Results in [10,11] suggest that, for global L

_{1}splines, spline functionals based on the first derivative or function value (that is, on functional (5) or (6)) result in improved shape preservation. Those results emphasized overall global preservation of shape on the macro scale but did not treat local preservation of shape on the fine, interval-to-interval scale. Following up on these prior investigations, we revisit here the comparison of L

_{1}splines based on derivatives of degree 2, 1 and 0, add to the comparison L

_{1}splines based on derivatives of degree −1 (antiderivatives) and add the new dimension of considering the window size (5 points, 7 points or global). For this comparison, we use the primal affine algorithm described in Section 2.

**Remark**The data points immediately to the right and left of the large intervals [27.3, 34.7] and [37.3, 44.7] lie on a quadratic and a cubic function, respectively. The second- and first-derivative-based splines of Figure 2, Figure 3, Figure 4, Figure 5, Figure 6 and Figure 7 approximate both the quadratic and the cubic function. In contrast, the function-value-based and antiderivative-based splines of Figure 8, Figure 9, Figure 10,Figure 11, Figure 12 and Figure 13 avoid approximating the quadratic function in [27.3, 34.7], even though they do approximate the cubic function in [37.3, 44.7]. In classical approximation theory, the ability to approximate or even reproduce quadratic, cubic and higher-degree functions is a goal. In geometric modeling of irregular data, however, reproducing any function of degree higher than 1 is generally considered disadvantageous because it leads to extraneous oscillation, overshoot or undershoot. It is not yet known how to construct L

_{1}splines that generically avoid approximating functions of degree higher than 1. In the present article, we acknowledge this issue but we do not take it into account when assessing the shape-preservation capabilities of the various types of L

_{1}splines.

_{1}splines. However, these results do provide insight into the shape-preservation capabilities of these types of L

_{1}splines as well as a piece of evidence supporting the use of second-derivative-based 5-point-window L

_{1}splines. In these computational results, the performance of second-derivative-based L

_{1}splines, the hitherto most widely used variant of L

_{1}splines is improved by using 5-point windows. The other two “top performers” of Figure 2, Figure 3, Figure 4, Figure 5, Figure 6, Figure 7, Figure 8, Figure 9, Figure 10, Figure 11, Figure 12 and Figure 13, namely, the first-derivative-based and function-value-based global L

_{1}splines of Figure 7 and Figure 10 are computationally much more expensive than second-derivative-based 5-point-window L

_{1}splines. No theory has been published for function-value-based L

_{1}splines. Elementary theory has been published for first-derivative-based L

_{1}splines but only for the global case [15]. Based on these considerations, we choose the second-derivative-based 5-point-window L

_{1}spline as the L

_{1}spline to be used in the remainder of this paper.

## 4. Algorithm for Minimization of Second-derivative-based 5-point-window Spline Functional

_{1}splines based on the analytical results of Section 2 of [17]. Recall that, in the interpolation situation of interest in this paper, the task of calculating an L

_{1}spline is the task of calculating the first derivatives ${b}_{i}$ by minimization of a spline functional with given nodes ${x}_{i}$ and given function values ${z}_{i}$ at the nodes. In the ith 5-point window, 2 ≤ i ≤ I − 2, an objective function $E({b}_{i-2},{b}_{i-1},{b}_{i},{b}_{i+1},{b}_{i+2})$ is minimized:

_{1}(b

_{i}) and G

_{2}(b

_{i}) have similar structure, which leads to the representation

**Table 1.**27 cases used in the 5-point window algorithm (see [17])

Case | Sign of | Same as Case | ${b}_{i}^{*}$ | ||

$\u25b5{z}_{i-1}-\u25b5{z}_{i-2}$ | $\u25b5{z}_{i}-\u25b5{z}_{i-1}$ | $\u25b5{z}_{i+1}-\u25b5{z}_{i}$ | |||

1 | 0 | 0 | 0 | $\u25b5{z}_{i-1}$ | |

2 | 0 | 0 | + | $\u25b5{z}_{i-1}$ | |

3 | 0 | 0 | − | 2 | $\u25b5{z}_{i-1}$ |

4 | 0 | + | 0 | ${\delta}_{i}$ | |

5 | 0 | + | + | $\u25b5{z}_{i-1}$ | |

6 | 0 | + | − | $\u25b5{z}_{i-1}$ | |

7 | 0 | − | 0 | 4 | ${\delta}_{i}$ |

8 | 0 | − | + | 6 | $\u25b5{z}_{i-1}$ |

9 | 0 | − | − | 5 | $\u25b5{z}_{i-1}$ |

10 | + | 0 | 0 | 2 | $\u25b5{z}_{i}$ |

11 | + | 0 | + | $\u25b5{z}_{i-1}$ | |

12 | + | 0 | − | $\u25b5{z}_{i-1}$ | |

13 | + | + | 0 | 5 | $\u25b5{z}_{i}$ |

14 | + | + | + | [see text] | |

15 | + | + | − | [see text] | |

16 | + | − | 0 | 6 | $\u25b5{z}_{i}$ |

17 | + | − | + | [see text] | |

18 | + | − | − | 15 | [see text] |

19 | − | 0 | 0 | 2 | $\u25b5{z}_{i}$ |

20 | − | 0 | + | 12 | $\u25b5{z}_{i-1}$ |

21 | − | 0 | − | 11 | $\u25b5{z}_{i-1}$ |

22 | − | + | 0 | 6 | $\u25b5{z}_{i}$ |

23 | − | + | + | 15 | [see text] |

24 | − | + | − | 17 | [see text] |

25 | − | − | 0 | 5 | $\u25b5{z}_{i}$ |

26 | − | − | + | 15 | [see text] |

27 | − | − | − | 14 | [see text] |

_{1}splines consists of a subroutine (Algorithm 1) for the local window calculation embedded in an “outer loop” (Algorithm 2) as described in the remainder of this section. Recall that the quantities ${\delta}_{i}$ are defined in (2).

**Algorithm 1**

- STEP 1
- Calculate $\u25b5{z}_{i-2}-\u25b5{z}_{i-1}$, $\u25b5{z}_{i-1}-\u25b5{z}_{i}$ and $\u25b5{z}_{i}-\u25b5{z}_{i+1}$ and determine the case to which these quantities correspond.
- STEP 2
- Calculate ${b}_{i}^{*}$ using information from [17] contained in Table 1 or described below in this step. Here, ${c}_{1}=\u25b5{z}_{i-2}-\u25b5{z}_{i-1}$ and ${c}_{2}=\u25b5{z}_{i+1}-\u25b5{z}_{i}$.
- -
- In Cases 1, 2, 3, 5, 6, 8, 9, 11, 12, 20 and 21, return ${b}_{i}^{*}=\u25b5{z}_{i-1}$.
- -
- In Cases 10, 13, 16, 19, 22 and 25, return ${b}_{i}^{*}=\u25b5{z}_{i}$.
- -
- In Cases 4 and 7, return ${b}_{i}^{*}={\delta}_{i}$.
- -
- Case 14:
- ∙
- Subcase 14-1: If $\u25b5{z}_{i}-\u25b5{z}_{i-1}\le \frac{\sqrt{10}-2}{\sqrt{10}}\left(\right|{c}_{1}|+|{c}_{2}\left|\right)$, then$${b}_{i}^{*}=\text{median}\{max\{\u25b5{z}_{i-1},\u25b5{z}_{i}+\frac{2-\sqrt{10}}{\sqrt{10}}{c}_{2}\},min\{\u25b5{z}_{i-1}+\frac{2-\sqrt{10}}{\sqrt{10}}{c}_{1},\u25b5{z}_{i}\},{\delta}_{i}\}.$$
- ∙
- Subcase 14-2: If $\frac{\sqrt{10}-2}{\sqrt{10}}\left(\right|{c}_{1}|+|{c}_{2}\left|\right)<\u25b5{z}_{i}-\u25b5{z}_{i-1}<\frac{1}{2}\left(\right|{c}_{1}|+|{c}_{2}\left|\right)$, then ${b}_{i}^{*}$ lies in the interval$$\left[max\{\u25b5{z}_{i-1}+\frac{2-\sqrt{10}}{\sqrt{10}}{c}_{1},\u25b5{z}_{i}-\frac{1}{2}{c}_{2}\},min\{\u25b5{z}_{i-1}-\frac{1}{2}{c}_{1},\u25b5{z}_{i}+\frac{2-\sqrt{10}}{\sqrt{10}}{c}_{2}\}\right].$$
- ∙
- Subcase 14-3: If $\frac{1}{2}\left(\right|{c}_{1}|+|{c}_{2}\left|\right)\le \u25b5{z}_{i}-\u25b5{z}_{i-1}\le 2\left(\right|{c}_{1}|+|{c}_{2}\left|\right)$, then$${b}_{i}^{*}=\text{median}\{max\{\u25b5{z}_{i-1}-\frac{1}{2}{c}_{1},\u25b5{z}_{i}-2{c}_{2}\},min\{\u25b5{z}_{i-1}-2{c}_{1},\u25b5{z}_{i}-\frac{1}{2}{c}_{2}\},{\delta}_{i}\}.$$
- ∙
- Subcase 14-4: If $2\left(\right|{c}_{1}|+|{c}_{2}\left|\right)<\u25b5{z}_{i}-\u25b5{z}_{i-1}$, then ${b}_{i}^{*}$ lies in the interval$$[\u25b5{z}_{i-1}-2{c}_{1},\u25b5{z}_{i}-2{c}_{2}].$$

Return ${b}_{i}^{*}$. - -
- Case 15:
- ∙
- Subcase 15-1: If $\u25b5{z}_{i}-\u25b5{z}_{i-1}\le \frac{2-\sqrt{10}}{\sqrt{10}}{c}_{1}$, then ${b}_{i}^{*}=\u25b5{z}_{i}$.
- ∙
- Subcase 15-2: If $\frac{2-\sqrt{10}}{\sqrt{10}}{c}_{1}<\u25b5{z}_{i}-\u25b5{z}_{i-1}\le -\frac{7+\sqrt{10}}{3}{c}_{1}$, then ${b}_{i}^{*}=\u25b5{z}_{i}$.
- ∙
- Subcase 15-3: If $-\frac{7+\sqrt{10}}{3}{c}_{1}<\u25b5{z}_{i}-\u25b5{z}_{i-1}$, then ${b}_{i}^{*}$ lies in the interval$$[\u25b5{z}_{i-1}-\frac{7+\sqrt{10}}{3}{c}_{1},\u25b5{z}_{i}].$$

Return ${b}_{i}^{*}$. - -
- Case 17:
- ∙
- Subcase 17-1: If $\u25b5{z}_{i-1}-\u25b5{z}_{i}>\frac{\sqrt{10}+1}{3}\left(\right|{c}_{1}|+|{c}_{2}\left|\right)$, then ${b}_{i}^{*}$ lies in the interval$$[\u25b5{z}_{i}+\frac{\sqrt{10}+1}{3}{c}_{2},\u25b5{z}_{i-1}+\frac{\sqrt{10}+1}{3}{c}_{1}].$$
- ∙
- Subcase 17-2: If $\u25b5{z}_{i-1}-\u25b5{z}_{i}\le \frac{\sqrt{10}+1}{3}\left(\right|{c}_{1}|+|{c}_{2}\left|\right)$, then$${b}_{i}^{*}=\text{median}\{max\{\u25b5{z}_{i},\u25b5{z}_{i-1}+\frac{\sqrt{10}+1}{3}{c}_{1}\},min\{\u25b5{z}_{i-1},\u25b5{z}_{i}+\frac{\sqrt{10}+1}{3}{c}_{2}\},{\delta}_{i}\}.$$

Return ${b}_{i}^{*}$. - -
- In Case 18, let$$(\u25b5{z}_{i-2}^{\prime},\u25b5{z}_{i-1}^{\prime},\u25b5{z}_{i}^{\prime},\u25b5{z}_{i+1}^{\prime},{\delta}_{i}^{\prime})=(\u25b5{z}_{i+1},\u25b5{z}_{i},\u25b5{z}_{i-1},\u25b5{z}_{i-2},{\delta}_{i}).$$
- -
- In Case 23, let$$(\u25b5{z}_{i-2}^{\prime},\u25b5{z}_{i-1}^{\prime},\u25b5{z}_{i}^{\prime},\u25b5{z}_{i+1}^{\prime},{\delta}_{i}^{\prime})=-(\u25b5{z}_{i+1},\u25b5{z}_{i},\u25b5{z}_{i-1},\u25b5{z}_{i-2},{\delta}_{i}).$$
- -
- In Case 24, let$$(\u25b5{z}_{i-2}^{\prime},\u25b5{z}_{i-1}^{\prime},\u25b5{z}_{i}^{\prime},\u25b5{z}_{i+1}^{\prime},{\delta}_{i}^{\prime})=-(\u25b5{z}_{i-2},\u25b5{z}_{i-1},\u25b5{z}_{i},\u25b5{z}_{i+1},{\delta}_{i}).$$
- -
- In Case 26, let$$(\u25b5{z}_{i-2}^{\prime},\u25b5{z}_{i-1}^{\prime},\u25b5{z}_{i}^{\prime},\u25b5{z}_{i+1}^{\prime},{\delta}_{i}^{\prime})=-(\u25b5{z}_{i-2},\u25b5{z}_{i-1},\u25b5{z}_{i},\u25b5{z}_{i+1},{\delta}_{i}).$$
- -
- In Case 27, let$$(\u25b5{z}_{i-2}^{\prime},\u25b5{z}_{i-1}^{\prime},\u25b5{z}_{i}^{\prime},\u25b5{z}_{i+1}^{\prime},{\delta}_{i}^{\prime})=-(\u25b5{z}_{i-2},\u25b5{z}_{i-1},\u25b5{z}_{i},\u25b5{z}_{i+1},{\delta}_{i}).$$

- STEP 3
- Stop.

**Algorithm 2**

- STEP 1
- Given a set of points $({x}_{i},{z}_{i})$, $i=0,1,\dots ,I$, calculate $\u25b5{z}_{i}$, $i=0,\dots ,I-1$, and ${\delta}_{i}$, $i=2,3,\dots ,I-2$, by formulas (1) and (2).
- STEP 2
- For $i=2,3,\dots ,I-2$, calculate ${b}_{i}^{*}$ using Subroutine($\u25b5{z}_{i-2},\u25b5{z}_{i-1},\u25b5{z}_{i},\u25b5{z}_{i+1}$;${\delta}_{i}$) (Algorithm 1).
- STEP 3
- Set$$\begin{array}{c}{b}_{1}^{*}=\u25b5{z}_{1}+min\{{\displaystyle \frac{\sqrt{10}-5}{7-2\sqrt{10}}}({b}_{2}^{*}-\u25b5{z}_{1}),{\displaystyle \frac{3\sqrt{10}-9}{7-2\sqrt{10}}}({b}_{2}^{*}-\u25b5{z}_{1}),\u25b5{z}_{0}-\u25b5{z}_{1}\}\phantom{\rule{0.166667em}{0ex}},\hfill \\ {b}_{0}^{*}=\u25b5{z}_{0}+{\displaystyle \frac{2-\sqrt{10}}{\sqrt{10}}}({b}_{1}^{*}-\u25b5{z}_{1})\phantom{\rule{0.166667em}{0ex}},\hfill \\ {b}_{I-1}^{*}=\u25b5{z}_{I-2}+min\{{\displaystyle \frac{\sqrt{10}-5}{7-2\sqrt{10}}}({b}_{I-2}^{*}-\u25b5{z}_{I-2}),{\displaystyle \frac{3\sqrt{10}-9}{7-2\sqrt{10}}}({b}_{I-2}^{*}-\u25b5{z}_{I-2}),\u25b5{z}_{I-1}-\u25b5{z}_{I-2}\}\phantom{\rule{0.166667em}{0ex}},\hfill \\ {b}_{I}^{*}=\u25b5{z}_{I-1}+{\displaystyle \frac{2-\sqrt{10}}{\sqrt{10}}}({b}_{I-1}^{*}-\u25b5{z}_{I-1}).\hfill \end{array}$$
- STEP 4
- Stop.

## 5. Analysis-based Algorithm vs. Primal Affine Algorithm for 5-pointWindows

^{−4}) at a number of nodes as shown in Table 2. It was confirmed by hand calculation that the results for the analysis-based algorithm are accurate for the original nondiscretized L

_{1}spline functional (a confirmation of both the analysis-based algorithm and the code). The differences in the results produced by the primal affine algorithm and the analysis-based algorithm are due mainly to the discretization (midpoint rule with 100 subintervals, as described in Section 2).

**Remark**On 5-point windows, the primal affine algorithm converges well. However, for global L

_{1}splines on large data sets, the primal affine algorithm can converge slowly or not at all, especially in bivariate situations, as indicated in Section 6 of [9], a conclusion supported by additional unpublished computational experience of the authors. In such situations, the L

_{1}spline functional may result in a nearly degenerate nonlinear program and this near degeneracy is retained in the discretized version.

i | ${x}_{i}$ | ${b}_{i}^{*}$ from primal affine algorithm | ${b}_{i}^{*}$ from analysis-based algorithm |

7 | 6.01 | 3.4096 | 3.3874 |

29 | 27.2 | 20.9698 | 20.9729 |

30 | 27.3 | 19.5166 | 19.5250 |

31 | 34.7 | -19.5166 | -19.5250 |

32 | 34.8 | -20.9698 | -20.9729 |

38 | 37.2 | 27.5971 | 27.6099 |

39 | 37.3 | 18.4160 | 18.4667 |

40 | 44.7 | 18.4160 | 18.4667 |

41 | 44.8 | 27.5971 | 27.6099 |

_{1}spline functional and does not require regularization terms to be added to this functional. The algorithm is simple, accurate and inherently parallelizable. Moreover, it is computationally much cheaper than the primal affine algorithm. Both of the algorithms were implemented in C++ 6.0. Computational results for the data set of Section 1 were generated on an IBM laptop running under the Windows XP operating system at 1.66 GHz CPU with 1.50 GB RAM and were presented in Section 3. The computing times of the primal affine algorithm were

- 177.7 milliseconds for a 5-point window (sequential calculations),
- 335.2 milliseconds for a 7-point window (sequential calculations),
- 94.9 milliseconds for global

_{1}splines of Figure 2, Figure 3 and Figure 4, respectively. The computing time of the analysis-based algorithm was

- 0.0531 milliseconds for a 5-point window (sequential calculations)

_{1}spline that corresponds to Figure 2. In these computational experiments, the sequential analysis-based algorithm is thus 177.7/0.0531 = 3347 times faster than the sequential primal affine algorithm. The speed-up for the parallel versions of these algorithms would be roughly the same, since each parallel version would be faster than the corresponding sequential version by a factor roughly equal to the number of points in the data set (56 in this case). The sequential analysis-based algorithm is faster than the global primal affine algorithm by a factor of 94.9/0.0531 = 1787. The speed-up of the parallel analysis-based algorithm vs. the global primal affine algorithm would, therefore, be roughly a factor of 1787.2 × 56 ≈ 10

^{5}, an impressive amount. For larger data sets, the speed-up is correspondingly larger.

**Remark**The computing time for the primal affine algorithm could be reduced by decreasing the number of subintervals K for discretization (via the midpoint rule) of the spline functional from 100, as was used for the results generated for this paper, to, say, 10, or less. However, since the degree to which a discretized spline functional approximates the continuum spline functional decreases as the number of subintervals is decreased, using only a few subintervals is generally not an advantageous choice when accuracy is an issue, as it is here.

## 6. Conclusion

_{1}interpolating splines on 5-point windows is a highly computationally efficient algorithm for generating a type of L

_{1}spline that has good shape-preservation properties on the micro scale as well as (generally) the macro scale. The analysis-based algorithm produces computational results that are accurate, in contrast to the widely used primal affine algorithm, which produces computational results that are only approximate. The low computing time and the inherently parallelizable nature of the calculations in the analysis-based algorithm are strong advantages.

_{1}approximating splines and for locally calculated bivariate L

_{1}interpolating and approximating splines is a topic for future research. For approximation, either smoothing splines [4,6,8,9,12] or spline fits [8] could be used. In the bivariate case, analytical results for windows consisting of contiguous triangles or rectangles will have to be developed and, on the basis of those analytical results, algorithms analogous to the univariate algorithm introduced in the present paper will need to be created. The success of the algorithm for univariate interpolation of the present paper indicates that further extension in the directions stated here may be fruitful.

## Acknowledgements

## References

- Auquiert, P.; Gibaru, O.; Nyiri, E. C
^{1}and C^{2}-continuous polynomial parametric L_{p}splines (p ≥ 1). Comput. Aided Geom. Design**2007**, 24, 373–394. [Google Scholar] [CrossRef] - Auquiert, P.; Gibaru, O.; Nyiri, E. On the cubic L
_{1}spline interpolant to the Heaviside function. Numer. Algorithms**2007**, 46, 321–332. [Google Scholar] [CrossRef] - Cheng, H.; Fang, S.-C.; Lavery, J.E. An efficient algorithm for generating univariate cubic L
_{1}splines. Comput. Optim. Appl.**2004**, 29, 219–253. [Google Scholar] [CrossRef] - Cheng, H.; Fang, S.-C.; Lavery, J.E. A geometric programming framework for univariate cubic L
_{1}smoothing splines. Ann. Oper. Res.**2005**, 133, 229–248. [Google Scholar] [CrossRef] - Lavery, J.E. Univariate cubic L
_{p}splines and shape-preserving, multiscale interpolation by univariate cubic L_{1}splines. Comput. Aided Geom. Design**2000**, 17, 319–336. [Google Scholar] [CrossRef] - Lavery, J.E. Shape-preserving, multiscale fitting of univariate data by cubic L
_{1}smoothing splines. Comput. Aided Geom. Design**2000**, 17, 715–727. [Google Scholar] [CrossRef] - Lavery, J.E. Shape-preserving, multiscale interpolation by bi- and multivariate cubic L
_{1}splines. Comput. Aided Geom. Design**2001**, 18, 321–343. [Google Scholar] [CrossRef] - Lavery, J.E. Shape-preserving approximation of multiscale univariate data by cubic L
_{1}spline fits. Comput. Aided Geom. Design**2004**, 21, 43–64. [Google Scholar] [CrossRef] - Lavery, J.E. The state of the art in shape preserving, multiscale modeling by L
_{1}splines. In Proceedings of SIAM Conference on Geometric Design and Computing, Seattle, WA, USA, November 2003; Lucian, M.L., Neamtu, M., Eds.; Nashboro Press: Brentwood, TN, USA, 2004; pp. 365–376. [Google Scholar] - Lavery, J.E. Shape-preserving, first-derivative-based parametric and nonparametric cubic L
_{1}spline curves. Comput. Aided Geom. Design**2006**, 23, 276–296. [Google Scholar] [CrossRef] - Lavery, J.E. Shape-preserving univariate cubic and higher-degree L
_{1}splines with function-value-based and multistep minimization principles. Comput. Aided Geom. Design**2009**, 26, 1–16. [Google Scholar] [CrossRef] - Lin, Y.-M.; Zhang, W.; Wang, Y.; Fang, S.-C.; Lavery, J.E. Computationally efficient models of urban and natural terrain by non-iterative domain decomposition with L
_{1}smoothing splines. In Proceedings of the 25th Army Science Conference, Department of the Army, Washington, DC, USA, November 2006. - Wang, Y.; Fang, S.-C.; Lavery, J.E. A geometric programming approach for bivariate cubic L
_{1}splines. Comput. Math. Appl.**2005**, 49, 481–514. [Google Scholar] [CrossRef] - Wang, Y.; Fang, S.-C.; Lavery, J.E. A compressed primal-dual method for bivariate cubic L
_{1}splines. Comput. Math. Appl.**2007**, 201, 69–87. [Google Scholar] [CrossRef] - Zhao, Y.; Fang, S.-C.; Lavery, J.E. Geometric dual formulation for first-derivative-based univariate cubic L
_{1}splines. J. Global Optim.**2008**, 40, 589–621. [Google Scholar] [CrossRef] - Auquiert, P.; Gibaru, O.; Nyiri, E. Fast L
_{1}–C^{k}polynomial spline interpolation algorithm with shape-preserving properties. Comput. Aided Geom. Design**2010**, in press. [Google Scholar] - Jin, Q.; Lavery, J.E.; Fang, S.-C. Univariate cubic L
_{1}interpolating splines: Analytical results for linearity, convexity and oscillation on 5-point windows. Algorithms**2010**, 3, 276–293. [Google Scholar] [CrossRef] - Bertsekas, D.P.; Nedić, A.; Ozdaglar, A.E. Convex Analysis and Optimization; Athena Scientific: Belmont, MA, USA, 2003. [Google Scholar]

© 2010 by the authors; licensee MDPI, Basel, Switzerland. This article is an Open Access article distributed under the terms and conditions of the Creative Commons Attribution license http://creativecommons.org/licenses/by/3.0/.

## Share and Cite

**MDPI and ACS Style**

Yu, L.; Jin, Q.; Lavery, J.E.; Fang, S.-C.
Univariate Cubic L1 Interpolating Splines: Spline Functional, Window Size and Analysis-based Algorithm. *Algorithms* **2010**, *3*, 311-328.
https://doi.org/10.3390/a3030311

**AMA Style**

Yu L, Jin Q, Lavery JE, Fang S-C.
Univariate Cubic L1 Interpolating Splines: Spline Functional, Window Size and Analysis-based Algorithm. *Algorithms*. 2010; 3(3):311-328.
https://doi.org/10.3390/a3030311

**Chicago/Turabian Style**

Yu, Lu, Qingwei Jin, John E. Lavery, and Shu-Cherng Fang.
2010. "Univariate Cubic L1 Interpolating Splines: Spline Functional, Window Size and Analysis-based Algorithm" *Algorithms* 3, no. 3: 311-328.
https://doi.org/10.3390/a3030311