## 2 Materials and Methods
### Regression Analysis and Roughness Penalty  
After defining the basis functions and the coefficients required to express the function as a linear combination of the basis functions, the coefficients can be computed using two methods of smoothing functional data: least squares estimation and roughness penalty. Least squares estimation using B-spline basis expansion, which is also known as regression spline smoothing, might work for a simpler linear problem but not for a complex problem. Normally, data fitting is done by minimizing the least squares estimation or sum of squared error, which is denoted as  
\[\text{SSE}(x)=\sum\limits_{j=1}^{n}\Big{[}y_{j}-x(t_{j})\Big{]}^{2}. \tag{3}\]  
A function \(x\) that is described as a basis function expansion (Equation (2)) is known as  
\[\text{SSE}(x)=\sum\limits_{j=1}^{n}\left[y_{j}-\sum\limits_{k=1}^{K}c_{k}\phi _{k}(t)\right]^{2}, \tag{4}\]  
where \(\phi_{k}(t),\ c_{k}\) and \(K\) are defined as in Equation (2). The standard deviation of the residuals, which is the root mean squared error (RMSE), is denoted as  
\[\text{RMSE}(x)=\sqrt{\frac{\sum\limits_{j=1}^{n}\Big{[}y_{j}-x(t_{j})\Big{]}^{ 2}}{n}}, \tag{5}\]  
which is a measure of the differences between the values predicted by an estimator, \(y_{j}\) and the values observed, \(x(t_{j})\).  
The regularization approach, also known as the roughness penalty, is viewed as a more comprehensive smoothing method [34]. Therefore, it was chosen over regression analysis or least squares estimation for this research. The roughness penalty method uses a large number of basis functions \(K\), while the regression spline uses a smaller \(K\). Thus, a large number of basis functions, \(K=100\), was chosen, which is equal to the number of data points, n. The raw functional data can be smoothed by adjusting the number of basis functions \(K\). Setting a smaller \(K\) induces smoother data but causes the elimination of important functional features. In contrast, setting \(K=n\) (\(n\) is the number of data points) induces the data to be an exact interpolation, which leads to undersmoothed and overfitted data. However, data overfitting caused by setting \(K=n\) is fixed by the roughness penalty term, which penalizes the curvature of the estimated function. This term is controlled by a smoothing parameter \(\lambda\). In the roughness penalty method, the roughness of a fitted curve is measured by finding \(x\) that minimizes the penalized residual sum of squares error, as follows:  
\[\begin{array}{ll}\text{PENSSE}&=\sum\limits_{j=1}^{n}\Big{[}y_{j}-x(t_{j}) \Big{]}^{2}+\lambda\times\text{PEN}_{m}\\ &=\sum\limits_{j=1}^{n}\Big{[}y_{j}-x(t_{j})\Big{]}^{2}+\lambda\times\int[D^{m} x(t)]^{2}dt,\end{array} \tag{6}\]  
where PENSSE refers to the penalized residual sum of squares error, \(\sum\limits_{j=1}^{n}\Big{[}y_{j}-x(t_{j})\Big{]}^{2}\) is the least squares estimation, \(\text{PEN}_{m}(x)=\int[D^{m}x(t)]^{2}dt\) denotes the integrated squared \(m\)-order derivative of \(x(t)\), and \(\lambda\) is the smoothing parameter. In order to measure acceleration, the penalized fourth-order derivative was used, since two order derivatives higher than the desired parameter are needed to be penalized [39].