# Functional Data Analysis in Sport Science: Example of Swimmers' Progression Curves Clustering
## 2 Materials and Methods
### Testing Several Algorithms on Simulated Data Sets  
To begin, a comparative study of several classical functional clustering algorithms has been performed on simulated data. Little information is provided on the algorithms, but we invite readers to refer to the corresponding papers for details. For this work, the \(R\) package _funcy_, which compiles  
Figure 1: Summary of the different approaches to perform clustering on functional data, from raw data (**top**) to final clusters (**bottom**). seven state-of-the-art algorithms, was used. It gives a common syntax and format for the input and output data. The list below enumerates the algorithms, regrouped according to their family, that can be used with _funcy_. (i) distance-based:  
* distclust: An approximation of the \(L^{2}\) distance between curves is defined, and a k-means heuristic is used on individuals using this distance. This method is well designed in the context of sparsely observed functions with irregular measurements [36]. (ii) model-based:  
* fitfclust: One of the first algorithms to use a Gaussian mixture model for univariate functions that we briefly describe. This heuristic holds for all following algorithms described as Gaussian mixture methods. Functions are represented using basis functions, and the associated coefficients are supposed to come from Gaussian distributions. Given a number \(K\) of different means and covariances parameters corresponding to the \(K\) clusters, an EM algorithm is used to estimate the probability of each observational curves to belong to a cluster. When the iterations stop (various stopping criteria exist), an individual is affected to its most likely cluster. A preliminary step of FPCA can be added to work on lower dimensional vectors and thus speed up the calculations. This method is well designed in the context of sparsely observed functions [37]. * iterSubspace: A non-parametric model based algorithm. This method uses the Karhunen-Loeve expansion of the curves, and perform a k-means algorithm on the scores of FPCA and the mean process. This method can be useful when the Gaussian assumption does not hold but k-means approach can lead to unstable results [38]. * funclust: A Gaussian mixture model based algorithm. This method uses the Karhunen-Loeve expansion of the curves and allows each cluster's Gaussian parameters to be of different sizes, according to the quantity of variance expressed by the corresponding FPCA. The algorithm also allows different covariance structures between clusters and thus generalizes some methods such as iterSubspace [33]. * funHDDC: A Gaussian mixture model based algorithm. This method presents lots of common characteristics with funclust, but additionally allows clustering of multivariate functions. The algorithm proposes six ways to model covariates structures, especially for the extra-dimension of the FPCA [35]. * fscm: A non-parametric model based algorithm. Each cluster is modeled by a Markov random field, and functions are clustered by shape regardless to the scale. Observation curves are considered as locally-dependent, and a K-nearest neighbors algorithm is used to define the neighborhood structure. Then, an EM algorithm estimates parameters of the model. This method is well designed when the assumption of independence between curves does not hold [38]. * wavaclust: A linear Gaussian mixed effect model algorithm. This approach uses a dimension reduction step using wavelet decomposition (rather than classic FPCA). An EM algorithm is used to compute parameters of the model and probabilities to belong to a cluster. This method is well designed for high-dimension curves, when variations such as peaks appears in data, and thus wavelets perform better than splines [29]. Unfortunately, the current version (1.0.0) of the _funcy_ package has some trouble with the funHDDC algorithm, which is not directly usable at the moment. All of the remaining algorithms were applied on three simulated data sets, with \(K=4\) groups.