**5. Dynamic Constrained Smoothing B-Splines**

Constrained Smoothing B-Splines is a methodology first proposed by He and Shi (1998) and then formalized by He and Ng (1999) as a proper algorithm. Constrained Smoothing B-Splines extends smoothing splines to a conditional quantile function estimation and then formulates the model as a linear programming problem that can incorporate constraints such as monotonicity, convexity, and boundary conditions. Laurini and Moura (2010) applied this methodology as a static model to fit daily yield curves along with no-arbitrage constraints. The estimation of the daily term structure of interest rates is set to be a conditional median estimation that is robust to outliers. This model produces yield curves as *L*1 projection into the space of B-splines. The flexible nature of B-splines and the arbitrage-free constraints makes the model a powerful tool that creates balance between financial meaning and adherence to data avoiding overfitting.

Our main contribution is the proposal of the Dynamic Constrained Smoothing B-splines (DCOBS) model that describes the static model evolving over time.

DCOBS is estimated by the Penalized Least Absolute Deviation

$$\min\_{\mathcal{B}\in\mathbb{R}^{C}}\sum\_{i=1}^{n}\left|y\_{i}-\sum\_{j=1}^{\mathbb{C}}a\_{j}B\_{j}(\tau\_{i})\right|+\Lambda\max\_{\mathbb{T}}\sum\_{j=1}^{\mathbb{C}}a\_{j}\left(B\_{j}(\tau)\right)^{\prime\prime},\tag{8}$$

where *n* is the number of contracts available in the reference day, *yi* are market yields of the contracts, *C* = *N* + *m* is the number of coefficients, *N* is the number of internal knots, *θ* = (*<sup>a</sup>*1, ... , *aC*) is the coefficient vector to be estimated, *Bj* are the B-splines basis, and *τi* are distinct maturities of the contracts. As in Laurini and Moura (2010), the model is configured with *m* = 3 as the order for quadratic B-Splines basis. The selection of the smoothing parameter Λ is automated with generalized cross validation (Leave-One-Out GCV) method of Fisher et al. (1995).

The formulation in (8) can be rewritten as

$$\min\_{\theta \in \mathbb{R}^C} \sum\_{i=1}^n \left| y\_i - \sum\_{j=1}^C a\_j B\_j(\pi\_i) \right| + \Lambda \omega\_A$$

such that

$$-\omega\_{\perp} \le \sum\_{j=1}^{\mathbb{C}} a\_j (B\_j(t\_k))'' \quad \le \quad \omega\_{\perp}$$

where *k* = 1, ..., *N* and *tk* is an internal knot position.

The static model defined by (8) can be implemented as an equivalent linear programming problem that minimizes the objective function *z* such that

$$\min z = \sum\_{i=1}^{n} \left| e\_i \right| + \left| \omega \right|.$$

Each yield observed in the market will produce five linear constraint equations: two constraints for fitting the curve, one constraint for smoothing, and two constraints for no-arbitrage conditions.

> The fitting constraints are

$$\sum\_{j=1}^{\mathbb{C}} a\_j B\_j(\tau\_i) + |e\_i| \ge y\_{i'} $$

$$\sum\_{j=1}^{\mathbb{C}} a\_j B\_j(\tau\_i) - |e\_i| \le y\_{i'} $$

where all *Bj*(*<sup>τ</sup>i*) are quadratic B-splines basis.

> The smoothing constraint is

$$\Lambda \sum\_{j=1}^{\mathbb{C}} a\_j (B\_j(\pi\_i))'' - |\omega| \le 0.$$

Finally, the no-arbitrage constraints are

$$\begin{aligned} \sum\_{j=1}^{\mathbb{C}} a\_j B\_j(\pi\_i) &> 0, \\ \sum\_{j=1}^{\mathbb{C}} a\_j \left( B\_j(\pi\_i) \right)' &< 0. \end{aligned}$$

The resulting fitted yield curve

$$\hat{s}(\tau) = \sum\_{j=1}^{C} \hat{a}\_j B\_j(\tau)$$

is a conditional median function represented by quadratic smoothing B-splines.

Now, we propose the Dynamic Constrained Smoothing B-Splines model by

$$s\_t(\tau) = \sum\_{j=1}^{C} a\_{j,t} B\_j(\tau) + \epsilon\_{t\prime} \tag{9}$$

$$t = 1, \dots, T,$$

where the coefficients *aj*,*<sup>t</sup>* are autoregressive processes described by

$$a\_{j,t} = c\_j + \phi\_j a\_{j,t-1} + \eta\_{j,t} \qquad j = 1 \dots \mathbb{C}\_{\prime}$$

where the parameters *ci* and *φi* and the coefficients *β<sup>i</sup>*,*<sup>t</sup>* are estimated and predicted as described in Sections 3 and 4.

If *ai*,*<sup>t</sup>* is a linear function of *aj*,*<sup>t</sup>* where *i* = *j*, or there is a cointegration, the component *ai*,*<sup>t</sup>* can be predicted as linear function of *aj*,*<sup>t</sup>* and the model can be simplified.

The DCOBS model extends the static model and extrapolates the temporal axis creating a surface of fitted curves.

Figure 1 displays a visual idea of the differences between each yield curve model and the superiority of fitting of DCOBS over AFNS.

**Figure 1.** Dynamic Constrained B-Splines compared to Arbitrage-Free Nelson–Siegel.
