Skip to main content

Advertisement

Table 1 Representation of three common forms of regression splines and calculation of first derivatives

From: Modelling subject-specific childhood growth using linear mixed-effect models with cubic regression splines

  Regression equation First derivative
Truncated polynomial splines (order p) \(f_{TPS} ( x ) = \beta_{0} + \beta_{1} x + \cdots + \beta_{p} x^{p} + \sum_{k = 0}^{K - 1} \gamma_{k} ( {x - \xi_{k} })_{ + }^{p}\) where \(( {x - \xi } )_{ + } = \left\{ \begin{array}{*{20}ll} 0 &\quad if \,\, x \le \xi \\ x - \xi &\quad if \,\,x > \xi \\ \end{array} \right.\) \(f_{TPS}^{'} \left( x \right) = \beta_{1} + 2\beta_{2} x^{2} + \cdots + p\beta_{p} x^{p - 1} + \mathop \sum \nolimits_{k = 0}^{K - 1} p\gamma_{k} \left( {x - \xi_{k} } \right)_{ + }^{p - 1}\)
B-splines (order p) \(f_{B} ( x ) = \sum_{k = 0}^{K - p - 2} \alpha_{k} B_{k,p} ( x )\) where \(B_{k,0} ( t ) = \left\{ \begin{array}{*{20}ll} 1 &\quad if \,x_{k} \le x < x_{k + 1} \\ 0 & \quad if \,otherwise \end{array} \right.\) and higher order splines bases are obtained by the recursion \(B_{k,p} \left( x \right) = \frac{{x - x_{k} }}{{x_{k + p} - x_{k} }}B_{k,p - 1} \left( x \right) + \frac{{x_{k + p + 1} - x}}{{x_{k + p + 1} - x_{k + 1} }}B_{k + 1,p + 1} \left( x \right)\) \(b_{k,0}^{'} ( x ) = 0\) \(b_{k,p}^{'} ( x ) = \frac{1}{{x_{k + p} - x_{k} }}B_{k,p - 1} ( x ) + \frac{{x - x_{k} }}{{x_{k + p} - x_{k} }}B_{k,p - 1}^{'} \left( x \right) - \frac{1}{{x_{k + p + 1} - x_{k + 1} }}B_{k + 1,p - 1} \left( x \right) + \frac{{x_{k + p + 1} - x}}{{x_{k + p + 1} - x_{k + 1} }}B_{k + 1,p - 1}^{'} \left( x \right)\)
Natural cubic splines (order 3) \(\begin{array}{*{20}ll} f_{{ns}} \left( x \right) &=\, \beta _{0} + \beta _{1} x + \sum_{{k = 0}}^{{K - 1}} {\gamma _{k} } \left( {x - \xi _{k} } \right)_{ + }^{3} \\& \quad \sum_{{k = 0}}^{{K - 1}} {\gamma _{k} } \xi _{k} = \sum_{{k = 0}}^{{K - 1}} {\gamma _{k} } = 0 \end{array}\) \(\begin{array}{*{20}ll} f_{ns}^{'} \left( x \right) & =\, \beta_{1} + \mathop \sum _{k = 0}^{K - 1} 2\gamma_{k} \left( {x - \xi_{k} } \right)_{+}^{2} \\ & \quad \sum _{k = 0}^{K - 1} \gamma_{k} \xi_{k} = \mathop \sum _{k = 0}^{K - 1} \gamma_{k} = 0 \\ \end{array}\)