# A Method of Accuracy Increment Using Segmented Regression
## 3 Segmented Regression Models  
This section presents the basic mathematical equations for different segmented regression models. Authors mostly employ piecewise linear, linear-quadratic, and quadratic models. 1. Segmented linear regression (SLR)  
This regression type is a sequential connection of \(q+1\) straight-line segments without discontinuities. The mathematical model of SLR is given as  
\[\phi_{1}(X,\ \overset{\rightarrow}{c}_{m,\ 1},\ x_{\text{br }q,\ 1})=c_{0,\ 1}+c_{1,\ 1}X+\sum_{i=1}^{q}c_{i+1,\ 1}(X-x_{\text{br }\ i})h(X-x_{\text{br }\ i}) \tag{1}\]  
where \(h(X-x_{\text{br }i})\) is the Heaviside function. This function helps to obtain the single mathematical equation for the segmented model. An example of a mathematical model of three-segmented linear regression has the form  
\[\phi_{1}(X,\ \overset{\rightarrow}{c}_{m,\ 1},\ x_{\text{br }q,\ 1})=c_{0,\ 1}+c_{1,\ 1}X+c_{2,\ 1}(X-x_{\text{br }\ 1})h(X-x_{\text{br }\ 1})+c_{3,\ 1}(X-x_{\text{br }\ 2})h(X-x_{\text{br }\ 2}).\]  
This model has two breakpoints, \(x_{\text{br }1}\) and \(x_{\text{br }2}\), and it requires the computation of four unknown coefficients: \(c_{0,\ 1}\), \(c_{1,\ 1}\), \(c_{2,\ 1}\), and \(c_{3,\ 1}\). These coefficients are estimated based on the OLS. The computation result can be presented in the form of matrix equations  
\[C=\Omega^{-1}\Psi,\ C= \begin{pmatrix}c_{0,\ 1}\\ c_{1,\ 1}\\ c_{2,\ 1}\\ c_{3,\ 1}\end{pmatrix} ,\ \Psi= \begin{pmatrix}\sum\limits_{i=1}^{n}y_{i}\\ \sum\limits_{i=1}^{n}y_{i}x_{i}\\ \sum\limits_{\forall x_{i}>x_{\text{br }\ 1}}^{n}y_{i}(x_{i}-x_{\text{br }\ 1})\\ \sum\limits_{\forall x_{i}>x_{\text{br }\ 2}}^{n}\left(x_{i}-x_{\text{br }\ 2}\right)\end{pmatrix} ,\]\[\Omega= \begin{pmatrix}n&\sum\limits_{i=1}^{n}x_{i}&\sum\limits_{\forall x_{i}>x_{ \text{br}}\ \ 1}\ (x_{i}-x_{\text{br}\ \ 1})&\sum\limits_{\forall x_{i}>x_{\text{br}}\ \ 2}\ (x_{i}-x_{\text{br}\ \ 2})\\ \sum\limits_{i=1}^{n}x_{i}&\sum\limits_{i=1}^{n}x_{i}{}^{2}&\sum\limits_{ \forall x_{i}>x_{\text{br}}\ \ 1}\ (x_{i}-x_{\text{br}\ \ 1})&\sum\limits_{\forall x_{i}>x_{ \text{br}}\ \ 2}\ (x_{i}-x_{\text{br}\ \ 2})\\ \sum\limits_{\forall x_{i}>x_{\text{br}}\ \ 2}\ (x_{i}-x_{\text{br}\ \ 1})&\sum \limits_{\forall x_{i}>x_{\text{br}}\ \ 1}\ (x_{i}-x_{\text{br}\ \ 1})^{2}&\sum \limits_{\forall x_{i}>x_{\text{br}}\ \ 1}\ (x_{i}-x_{\text{br}\ \ 1})(x_{i}-x_{\text{br}\ \ 2})\\ \sum\limits_{\forall x_{i}>x_{\text{br}}\ \ 2}\ (x_{i}-x_{\text{br}\ \ 2})&\sum \limits_{\forall x_{i}>x_{\text{br}}\ \ 2}\ (x_{i}-x_{\text{br}\ \ 1})(x_{i}-x_{\text{br}\ \ 2})&\sum \limits_{\forall x_{i}>x_{\text{br}}\ \ 2}\ (x_{i}-x_{\text{br}\ \ 2})^{2}\end{pmatrix} ,\]  
where \(\forall x_{i}>x_{\text{br}\ \ 1}\ (2)\) corresponds to all \(x_{i}\) greater than \(x_{\text{br}\ \ 1}\ (2)\). 2. Segmented quadratic regression (SQR)  
This regression type is a sequential connection of \(q+1\) quadratic parabola segments without discontinuities. The mathematical model of SQR is given as  
\[\phi_{2}(X,\ \overset{\rightarrow}{c}_{m,\ 2},\ x_{\text{br}\ q,\ 2})=c_{0,\ 2}+c_{1,\ 2}X+c_{2,\ 2}X^{2}+\sum\limits_{i=1}^{q}c_{i+2,\ \ 2}(X-x_{\text{br}\ \ i})^{2}h(X-x_{\text{br}\ \ i}) \tag{2}\]  
An example of a mathematical model of two-segmented quadratic regression has the form  
\[\phi_{2}(X,\ \overset{\rightarrow}{c}_{m,\ 2},\ x_{\text{br}\ q,\ 2})=c_{0,\ 2}+c_{1,\ 2}X+c_{2,\ 2}X^{2}+c_{3,\ 2}(X-x_{\text{br}\ \ 1})^{2}h(X-x_{\text{br}\ \ 1})\]  
This model has one breakpoint,\(x_{\text{br}\ \ 1}\), and it requires the computation of four unknown coefficients: \(c_{0,\ 2}\), \(c_{1,\ 2}\), \(c_{2,\ 2}\), and \(c_{3,\ 2}\). These coefficients are estimated based on the OLS. The computation result can be presented in the form of matrix equations  
\[C=\Omega^{-1}\Psi C= \begin{pmatrix}c_{0,\ 1}\\ c_{1,\ 1}\\ c_{2,\ 1}\\ c_{3,\ 1}\end{pmatrix} ,\ \Psi= \begin{pmatrix}\sum\limits_{i=1}^{n}y_{i}\\ \sum\limits_{i=1}^{n}y_{i}x_{i}\\ \sum\limits_{i=1}^{n}y_{i}x_{i}^{2}\\ \sum\limits_{\forall x_{i}>x_{\text{br}}\ \ 1}y_{i}(x_{i}-x_{\text{br}\ \ 1})^{2} \end{pmatrix} ,\]  
\[\Omega=