scieee AI-readable full text Open interactive document viewer

Multi-class classification of biomechanical data: A functional LDA approach based on multi-class penalized functional PLS

Aguilera Morillo, María del Carmen,Aguilera Del Pino, Ana María

Abstract

MTM2017-88708-P, Spanish Ministry of Economy and Competitiveness (also supported by the FEDER program) and IJCI-2017-34038, Agencia Estatal de Investigación, Ministerio de Ciencia, Innovación y Universidades.

Full text

Multi-class classification of biomechanical data: A functional LDA approach based on multi-class penalized functional PLS  M. Carmen Aguilera-Morillo, Ana Mar´ıa Aguilera del Pino  Multi-class classification of biomechanical data: A functional LDA approach based on multi-class penalized functional PLS  Statistical Modelling, 2020; 20(6): 592-616  DOI: 10.1177/1471082X17871157 1 Statistical Modelling 2020; 20(6): 592–616 Multi-class classification of biomechanical data: A functional LDA approach based on multi-class penalized functional PLS M. Carmen Aguilera-Morillo1and Ana M. Aguilera2 1Department of Statistics, Escuela Polit´ ecnica Superior and UC3M-BS Santander Big Data Institute, Universidad Carlos III de Madrid, Madrid, Spain. 2Department of Statistics and O. R. and IEMath-GR, Facultad de Ciencias, Universidad de Granada, Granada, Spain. Abstract: A functional linear discriminant analysis approach to classify a set of kinematic data (human movement curves of individuals performing different physical activities) is performed. Kinematic data, usually collected in linear acceleration or angular rotation format, can be identified with functions in a continuous domain (time, percentage of gait cycle, etc.). Since kinematic curves are measured in the same sample of individuals performing different activities, they are a clear example of functional data with repeated measures. On the other hand, the sample curves are observed with noise. Then, a roughness penalty might be necessary in order to provide a smooth estimation of the discriminant functions, which would make them more interpretable. Moreover, because of the infinite dimension of functional data, a reduction dimension technique should be considered. To solve these problems, we propose a multi-class approach for penalized functional partial least squares (FPLS) regression. Then linear discriminant analysis (LDA) will be performed on the estimated FPLS components. This methodology is motivated by two case studies. The first study considers the linear acceleration recorded every two seconds in 30 subjects, related to three different activities (walking, climbing stairs and down stairs). The second study works with the triaxial angular rotation, for each joint, in 51 children when they completed a cycle walking under three conditions (walking, carrying a backpack and pulling a trolley). A simulation study is also developed for comparing the performance of the proposed functional LDA with respect to the corresponding multivariate and non-penalized approaches. Key words: functional data, linear discriminant analysis, multi-class classification, PLS regression, P-spline penalty Received December 2018; revised April 2019; accepted July 2019 1 Introduction Biomechanical gait data are commonly used to differentiate between several gait pathologies or different physical activities. Different statistical methodologies for Address for correspondence: M. Carmen Aguilera-Morillo, Department of Statistics, Escuela Polit´ ecnica Superior, Universidad Carlos III de Madrid, Avda. de la Universidad 30, 28911, Madrid, Spain. E-mail: [email protected] © 2020 The Author(s) 10.1177/1471082X17871157 Multi-class classification of biomechanical data 593 classification of gait data have been developed in the literature with this aim. Gait data are usually collected at different points in a continuous scale, such as time, so that they are generated from an underlying time-varying function. In the applications that motivate this research, acceleration curves are measured at real time every two seconds, and rotation curves are measured in terms of the percentage of gait cycle. In spite of the continuous nature of kinematics curves, in many of the biomechanical studies the statistical analysis is made from a sample of summary measures for each curve such as minima, maxima, area under the curve, angles at heel strike, range of motion or the timing of specific events (Sadeghi et al., 1997; Sadeghi, 2003; Schmidt and Docherty, 2010; Orantes-Gonz´ alez et al., 2015). Currently, data science tools are being developed to build accurate classification and prediction models for gait research by using all the available information. One of them is functional data analysis (FDA) that begins by reconstructing the true functional form of each sample curve from discrete sampling points that could be different for different subjects. This way all the available information about the sample curves is exploited to explain the movement in the statistical analysis. A detailed description of the most common FDA methodologies, and interesting FDA applications with R and Matlab, are described in the pioneer books by Ramsay and Silverman (1997), Ramsay and Silverman (2002) and Ramsay et al. (2009). A complete study of nonparametric FDA techniques can be seen in Ferraty and Vieu (2006). Statistical inference for functional data has been studied in Horvath and Kokoszka (2012). A more recent book is by Kokoszka and Reimherr (2017), where new methods for FDA are collected (functional time series, spatial functional data, between others). Biomechanical data are usually obtained over a number of discrete time points (snapshots) and assumed to be generated by some underlying smooth function. Because of this, the steps typically used when FDA is applied to the analysis of biomechanical data are: basis expansion representation, curve registration (time normalization or landmark registration) and functional principal component analysis (FPCA) (dimension reduction and variability explanation in terms of uncorrelated scalar variables). The first step consists of obtaining smooth representations of the sample curves in terms of a basis of functions (Fourier, B-splines, wavelets, etc.). In the second step, registration is used to reduce phase variability between curves while preserving the individual curve’s shape and amplitude. The effect of different registration methods on cyclical kinematic data is analysed in Crane et al. (2010). In the third step, FPCA is successfully applied to explain the ways of variation in biomechanics of sports injuries and coordination in race-walking, jumping and running (Ryan et al., 2006; Harrison et al., 2007; Donoghue et al., 2008; Don` a et al., 2009). On the other hand, multivariate principal component analysis (PCA) on the raw discrete-time observations of the biomechanics curves has also been applied to provide biomechanics interpretation of the principal component scores and to discriminate between healthy and sick subjects (Deluzio et al., 1997; Daffertshofer et al., 2004; Milovanovi` c and Popovi` c, 2012). This work is motivated by two different sets of biomechanical data: the human activity data and the gait data. The first dataset is based on the human activity Statistical Modelling 2020; 20(6): 592–616 594 M. Carmen Aguilera-Morillo and Ana M. Aguilera recognition collected by Anguita et al. (2013). The original experiments were carried out with a group of 30 volunteers within an age bracket of 19–48 years. Each person performed three different activities wearing a smartphone on the waist (walking, walking upstairs and walking downstairs). Using its embedded accelerometer and gyroscope, they captured 3-axial linear acceleration and 3-axial angular velocity at a constant rate of 50Hz every two seconds. The aim is to classify the curves of acceleration according to the categorical variable given by the three mentioned physical activities. The gait dataset comes from a wide experimental study developed in the biomechanics laboratories of the Sport and Health Institute of the University of Granada (iMUDS). In order to collect the data, 26 reflective markers were placed on the skin of a total of 51 children between 8 and 11 years old. The data were recorded by a 3D motion capture system meanwhile each subject completed a cycle walking over the platform in three conditions (walking, carrying a backpack that weighs 20% of the subject’s weight and pulling a trolley that weighs 20% of the subject’s weight). For each subject, the 3-axial angular rotation were registered for each join (ankle, foot progress, hip, knee, pelvis, thorax), and all conditions, in 101 equidistant points of the complete gait cycle. Now, the aim is to classify the rotation curves according to the three different load types. Both case studies considered in this article are clear examples of functional data with repeated measures because the functional variables of interest (angular rotation and linear acceleration) are measured repeatedly on the same sample individuals under different experimental conditions. Therefore, the aim of this article is to classify a set of functional data with repeated measures (kinematic curves) according to a categorical variable with more than two categories (measurement conditions). In this article, an extension of linear discriminant analysis (LDA) to the case of functional data with repeated measurements will be considered. Alternative classification approaches based on logit regression were developed and successfully applied in different areas as environment, medicine, marketing and so on (James, 2002; Escabias et al., 2004, 2005, 2007; Delaigle and Hall, 2012a; Aguilera-Morillo and Aguilera, 2013; Escabias et al., 2014). An extension to functional data of nonparametric Bayes classifiers based on simple density ratios was proposed in (Dai et al., 2017) for the case of binary classification. LDA is a popular and consolidate methodology for classification and dimension reduction (Fisher, 1936). So, LDA provides a sequence of linear combinations of the original predictor variables (linear discriminants) that maximize the between-class variance relative to the within-class variance. An important problem is that LDA overfits the data when we have a large number of highly correlated predictor variables because the within-class covariance matrix is difficult to estimate. This is the case of FDA that works with a large number of discrete-time observations for each sample curve. A way to solve this problem is to introduce some kind of regularization in the estimation of the covariance matrix (Friedman, 1989; Frank and Friedman, 1989; Hastie et al., 1995). A general review of regularized techniques in discriminant analysis was developed in Mkhadri et al. (1997). A Bayesian approach for Fisher’s discriminant analysis of stochastic process was introduced in Shin (2008). An alternative solution, for the case of irregularly sampled curves, is based on using Statistical Modelling 2020; 20(6): 592–616 Multi-class classification of biomechanical data 595 as predictors a spline basis expansion of the discrete-time observations and assuming Gaussian distribution of the vector of basis coefficients with common covariance matrix for all classes, by analogy with LDA (James and Hastie, 2001). This functional LDA approach was used to assessment of embryonic growth (Bottomley et al., 2009). Other way of solution consists of projecting the predictor vectors (multivariate analysis) or curves (FDA) onto a finite dimensional basis so that LDA, or any other discrimination procedures, can then be used taking the resulting basis coefficients as predictors. A common approach is based on the representation of the original predictors by a small set of orthogonal scalar variables given by PCA or partial least squares (PLS) regression. Both approaches are commonly used in chemometrics to discriminate between essential properties of substances from discrete measurements of the near-infrared (NIR) spectra. PCA was applied in Sato (1994) to classify NIR spectral data of vegetable oils. PLS regression was performed in Li et al. (2000) to discriminate edible fats and oils by Fourier transform NIR spectroscopy. Multivariate classification techniques such as LDA, quadratic discriminant analysis (QDA) and logit regression were applied in Indahl et al. (1999). In the functional data context, reduction dimension techniques and regularization can be jointly used to get good classification rates and accurate interpretation of the results. The functional LDA approach presented in this article is inspired in this research line. Functional PCA and functional PLS regression were introduced as natural extensions of their multivariate counterparts to solve the problems of high dimension and multicollinearity associated with the scalar-on-function linear model (Deville, 1974; Dauxois et al., 1982; Oca˜ na et al., 1999, 2007; Preda and Saporta, 2005; Aguilera et al., 2016). Both methodologies were compared on different simulated datasets concluding that they have similar forecasting performance, but the estimated parameter function provided by functional PLS regression is more accurate and needs fewer components (Reiss and Ogden, 2007; Aguilera et al., 2010; Delaigle and Hall, 2012b,c). In addition, the performance of PCA for discrimination may not be optimal, because PCA only identifies gross variability, and then it is not capable to distinguish the between-groups and within-groups variability. In that sense, several authors proposed to use PLS regression for dimension reduction, as for example Barker and Rayens (2003), P´ erez-Enciso and Tenenhaus (2003) in the multivariate context and Preda et al. (2007) in the functional context. From a methodological point of view, the originality of our work lies, on the one hand, in proposing a penalized spline estimation of the PLS components to solve the problem of lack of smoothness, and on the other hand, in considering a multi-class approach for PLS regression based on the split-up variation to solve the problem of repeated measures. Then, classic LDA is carried out on the estimated PLS components. To the best of our knowledge, it is the first approach in the literature for functional linear discriminant analysis (FLDA) with repeated measures based on functional PLS. Then, in order to classify gait curves according to the kind of activity and take into account both, the lack of smoothness in the data and the correlation between repeated measurements, a new multi-class FLDA based on penalized functional PLS regression for repeated measures is proposed in Section 2. The classification results of the considered multi-class functional LDA-PLS approach on simulated data and both Statistical Modelling 2020; 20(6): 592–616 596 M. Carmen Aguilera-Morillo and Ana M. Aguilera biomechanical datasets are presented and discussed in Sections 3 and 4. Conclusions are finally included in Section 5. 2 Multi-class classification of functional data Let us consider a categorical response variable Y={1,...,K},with K(K>2) categories and a functional predictor X={X(t): t∈T}(continuous and second order stochastic process whose sample paths belong to the Hilbert space of square-integrable functions L2(T)). Then, the aim is to predict Yfrom X(t).That means to classify the sample curves according to the groups defined by the categories of Y. The aim of FLDA is to find linear combinations i(X)=˛i+T X(t)ˇi(t)dt, {i=1,...,K−1},(2.1) so that the between-class variance is maximized with respect to the total variance maxˇ V(E[(X)|Y]) V((X)). Due to the high dimension of X(t) (the number of observed variables is usually larger than the number of sample observations), the estimation of the discriminant functions is an ill-posed problem because the standard estimate for the within-class covariance matrix is singular so that it is impossible to apply the usual classification rule. This problem is solved in this article by using a dimension reduction approach based on functional PLS regression Preda et al. (2007). Then, the multi-class classification problem from repeated measures is solved by using the following two-step algorithm: Step 1. Dimension reduction by penalized and non-penalized multi-class functional PLS regression (for repeated measures) of the random vector ˜ Y Y Y= (˜ Y1,..., ˜ YK−1) on the functional predictor X(t), with {˜ Yi∈{0,1}:i= 1,...,K−1}being the dummy variables associated with the categorical response Y. Step 2. Functional LDA of Y on a reduced set of functional PLS components estimated in the above step. 2.1 Multi-class functional PLS regression In order to reduce the dimension, PLS regression of the vector ˜ Y=(˜ Y1,..., ˜ YK−1)on the functional predictor X(t),with {˜ Yi∈{0,1}:i=1,...,K−1}is performed. In that context, the non-penalized PLS components are generalized linear combinations, Statistical Modelling 2020; 20(6): 592–616 Multi-class classification of biomechanical data 597 of type t=TX(t)w(t)dt, estimated by solving the following maximization problem {w, c}=argmaxCov2T X(t)w(t)dt, K−1  i=1 ci˜ Yi(2.2) w=1 c=1 with · representing the usual norms in the spaces L2[T] and RK−1where the component weights belong to, respectively, and cbeing the weight vector of ˜ Y. From Proposition 1 in Preda and Saporta (2005), it can be seen that the solution to this maximization problem is reached for w w wand c c c, the eigenvectors associated with the largest eigenvalue of UXand U˜ Y,respectively, defined by UX=CX˜ Y◦C˜ YX and U˜ Y=C˜ YX ◦CX˜ Y,with C˜ YX and CX˜ Ybeing the cross-covariance operators. Then, the first PLS component, t1=TX(t)w1(t)dt, is estimated in terms of the associated weight function, w1(t),which is solution to the following problem CX˜ Y◦C˜ YX(w1)=maxw1. PLS regression is an iterative algorithm and the first PLS step is completed by ordinary linear regression of X0(t)=X(t) and ˜ Y0=˜ Yon t1,obtaining the residuals, X1(t) and ˜ Y1,necessary to the following step X1(t)=X0(t)−p1(t)t1t∈T ˜ Y1,i =˜ Y0,i −c1,it1i=1,...,K−1, where p1(t)=E(X0(t)t1)/E(t2 1)and c1=E(Y0t1)/E(t2 1). In general, let us consider the hth PLS component, th=TXh−1(t)wh(t)dt, which is estimated by the following problem Ch−1 X˜ Y◦Ch−1 ˜ YX (wh)=maxwh, where Ch−1 X˜ Yand Ch−1 ˜ YX are the cross covariance operators of Xh−1(t) and ˜ Yh−1, respectively. The hth PLS step is completed by ordinary linear regression of Xh−1(t) and ˜ Yh−1on th,obtaining the residuals Xh(t) and ˜ Yh Xh(t)=Xh−1(t)−ph(t)tht∈T ˜ Yh,i =˜ Yh−1,i −ch,ithi=1,...,K−1, where ph(t)=E(Xh−1(t)th)/E(t2 h)and ch=E(Yh−1th)/E(t2 h). A basis representation approach Statistical Modelling 2020; 20(6): 592–616 598 M. Carmen Aguilera-Morillo and Ana M. Aguilera Let us consider now the basis representation of the functional predictor and the weight function, that is, X(t)= p  j=1 ˛jj(t)and w(t)= p  j=1 wjj(t). As a consequence, the maximization problem in Equation (2.2) can be written as follows: {w, c}=argmaxw w w    ˛˜ Yc c cc c c   ˛˜ Yw w w w w ww w w +c c cc c c, with w w w=w1,...,w pbeing the vector of basis coefficients of w(t)and   ˛˜ Y= (ji)p×K−1being the cross-covariance matrix between˛ ˛ ˛(the vector of basis coefficients of X(t)) and ˜ Y Y Y, where ji =E[˛j˜ Yi],with {j=1...,p;i=1,...,K−1}. The cross-covariance operators expressed in terms of the basis expansion of the functional predictor X(t) are given by C˜ YX :L2(T)→RK−1 f= p  j=1 fjj(t)→C˜ YX(f)=   ˛˜ Y  f f f CX˜ Y:RK−1→L2(T) x x x→f(t)=K−1 j=1fjj(t):f f f=  ˛˜ Yx x x, where f f f=(f1,...,f p)is the vector of basis coefficients of the function f. Then, at the first PLS step, the weight function w1(t) is given by the eigenfunction associated with the largest eigenvalue of UXso that   ˛˜ Y   ˛˜ Y  w w w1=w w w1,(2.3) and the weight vector c c c1is given by the eigenvector associated with the largest eigenvalue of U˜ Yso that    ˛˜ Y    ˛˜ Yc c c1=c c c1. Let us consider now the decomposition   =  1/2  1/2. Then, w w w 1  w w w1=w w w 1  1/2  1/2w w w1=˜ w w w 1˜ w w w1, Statistical Modelling 2020; 20(6): 592–616 Multi-class classification of biomechanical data 599 with ˜ w w w1=  1/2w w w1(w w w1=(  −1/2)˜ w w w1).This way, Equation (2.3) can be expressed as follows   1/2  ˛˜ Y   ˛˜ Y  1/2˜ w w w1=˜ w w w1.(2.4) At the hth PLS step, the hth PLS component is estimated in terms of the associated weight function by solving to the following problem   1/2  ˛h−1˜ Yh−1   ˛h−1˜ Yh−1  1/2˜ w w wh=˜ w w wh,(2.5) where   ˛h−1˜ Yh−1is the cross-covariance matrix between ˛ ˛ ˛h−1(the vector of basis coefficients of Xh−1(t)) and ˜ Y Y Yh−1,and ˜ w w wh=  1/2w w wh(w w wh=(  −1/2)˜ w w wh). In general, by considering Equations (2.4) and (2.5) and taking into account that   1/2  ˛˜ Yis the cross-covariance matrix between ˜ Y Y Yand (  1/2)˛ ˛ ˛, it can be concluded that FPLS with multiple response is equivalent to ordinary PLS of ˜ Y Y Yon the random vector (  1/2)˛ ˛ ˛. 2.2 Penalized multi-class FPLS regression As the biomechanical data analysed in this article are not smooth enough, a penalized approach for multi-class functional partial least squares (FPLS) regression is proposed. Let us consider now the roughness penalty function Pend(w)=T [Dd(w)(t)]2dt, with d=2, as a measure of roughness of w(O’Sullivan, 1986). By considering the basis expansion of w(t),the penalty function can be written as Pend(w)=w w wP P Pdw w w, where w w w=w1,...,w pis the vector of basis coefficients of w(t)and P P Pdthe matrix of the cross inner products of the d-order derivatives of the basis functions. As alternative, working in any context where regression on B-splines is useful, it can be considered P P Pd=  d  d,with   dthe matrix of d-order differences between the adjacent basis coefficients (Eilers and Marx, 1996). In this section the PLS components are estimated by solving the following problem {w, c}=argmaxCov2T X(t)w(t)dt, K−1  i=1 ci˜ Yi, w=1 c=1 Statistical Modelling 2020; 20(6): 592–616 606 M. Carmen Aguilera-Morillo and Ana M. Aguilera LDA−MPLSFLDA−MFPLSFLDA−PenMFPLS 0.85 0.90 0.95 1.00 LDA−MPLSFLDA−MFPLSFLDA−PenMFPLS 0.2 0.4 0.6 0.8 1.0 FLDA−MFPLSFLDA−PenMFPLS 2 4 6 8 10 12 14 LDA-MPLS Figure 3 Simulation study. Box plots showing to the number of PLS components used in the LDA (bottom panel), the correct classification rates from the cross-validation on the training sample and from the classification of the test sample (top-left and top-right panels, respectively). Experiments run 500 times the one based on penalized multi-class functional PLS regression provides the best performance, with the highest CCR and the minimum variability. 4 Case studies In this section, the results from the analysis of two real kinematic datasets are summarized. In general, kinematic data from inertial sensors placed on human body is usually collected in the format of linear acceleration or angular rotation. Linear acceleration or angular rotation represent the trajectory of the human movement, which can be identified with a function in time and frequency domain. In that sense, data from kinematic studies can be considered as a functional dataset, and then functional data techniques can be applied to analyse this type of data. In addition, it is important to remark the presence of repeated measures in kinematic studies. So, both the between-subject and within-subject variations must be taken into account. Statistical Modelling 2020; 20(6): 592–616 Multi-class classification of biomechanical data 607 4.1 Human activity data The human activity dataset is part of a wider experiment, focused on the human activity recognition, carried out by Anguita et al. (2013). In this article, let us consider the linear acceleration (metre per second squared), measured on axis X and recorded in 128 equidistant knots at the interval [0,2.56] seconds, and related to three different stimulus (walking, walking upstairs and walking downstairs). A total of 30 subjects participated in this experiment. Then, a total of 90 sample paths are considered (one sample path per stimulus and subject). Subject 23 was removed from the sample for being an outlier. The remaining sample observations were distributed into training and test sample, with observations (repeated measures) related to 20 and 9 subjects, respectively. The raw data (displayed by stimulus) are shown in Figure 4. In order to visualize the variability of the spectra between stimulus, in Figure 5 the spectra related to the three activities have been overlapped for two subjects A and B, left and right panel, respectively. 0.0 0.5 1.0 1.5 2.0 2.5 −1.0−0.5 0.0 0.5 1.0 Walking Seconds Linear acceleration 0.0 0.5 1.0 1.5 2.0 2.5 −1.0−0.50.0 0.5 1.0 Walking upstairs Seconds Linear acceleration 0.0 0.5 1.0 1.5 2.0 2.5 −1.0 −0.5 0.0 0.5 1.0 Walking downstairs Seconds Linear acceleration Figure 4 Human activity data. Raw data. Sample paths displayed separately by stimulus: walking, walking upstairs and walking downstairs, from left to right, respectively The first step in the analysis was to approximate the sample curves by mean of a basis representation and using a cubic B-spline basis defined on 25 equidistant knots. In Figure 6 the raw data together with the regression spline can be seen. Once the sample curves have been approximated, the aim is the human activity pattern recognition. To this end FLDA based on a multi-class approach for functional PLS regression (FLDA-MFPLS) was carried out to classify the sample curves according to the stimulus which produced them. It could be assumed that the raw data, which were collected by a smartphone on the waist of the subjects, are affected by some error or noise. In that sense, and aiming to avoid a possible lack of smoothness in the estimation of the discriminant functions, the penalized version of FLDA-MFPLS (FLDA-PenMFPLS), proposed in section 2.3, was also considered. The discriminant functions estimated from penalized and non-penalized functional LDA can be seen in Figure 7. The necessity of smoothing in the estimation of the discriminant functions is obvious, with penalized functional LDA providing the smoothest and the most interpretable functions. Statistical Modelling 2020; 20(6): 592–616 608 M. Carmen Aguilera-Morillo and Ana M. Aguilera 0.0 0.5 1.0 1.5 2.0 2.5 −1.0 −0.5 0.0 0.5 1.0 Suject A: raw data Seconds Linear acceleration Walking Walking upstairs Walking downstairs Walking Walking upstairs Walking downstairs 0.0 0.5 1.0 1.5 2.0 2.5 −1.0 −0.5 0.0 0.5 1.0 Suject B: raw data Seconds Linear acceleration Figure 5 Human activity data. Raw data. Sample paths related to walking (solid line), walking upstairs (dashed line) and walking downstairs (dotted line) for two subjects A and B, left and right panel, respectively 0.0 0.5 1.0 1.5 2.0 2.5 −1.0−0.5 0.0 0.5 1.0 Walking Seconds Linear acceleration Raw data Regression Spline 0.0 0.5 1.0 1.5 2.0 2.5 −1.0−0.50.0 0.5 1.0 W alking upstairs Seconds Linear acceleration Raw data Regression Spline Raw data Regression Spline 0.0 0.5 1.0 1.5 2.0 2.5 −1.0−0.5 0.0 0.5 1.0 Walking downstair s Seconds Linear acceleration Figure 6 Human activity data. A sample path for each stimulus (dashed line) together with the regression spline (solid line) estimated with a cubic B-splines basis defined on 25 equidistant knots In order to evaluate the ability of penalized and non-penalized approaches for human activity pattern recognition, Table 1 summarizes information related to the CCR based on a leave-one-out cross-validation on the training sample (CCRtraining), and based on the test sample classification (CCRtest). In this table, a multivariate version of LDA based on multi-class PLS regression (LDA-MPLS) is also considered for comparison purpose. It can be seen that functional LDA performs better than the multivariate approach. Besides, between the two functional approaches (penalized and non-penalized), the one based on penalized multi-class functional PLS (FLDA-PenMFPLS) achieves the highest CCR in both, training and test samples. A considerable difference between Statistical Modelling 2020; 20(6): 592–616 Multi-class classification of biomechanical data 609 0.0 0.5 1.0 1.5 2.0 2.5 −3−2 −1 Seconds FLDA−MFPLS FLDA−PenMFPLS FLDA−MFPLS FLDA−PenMFPLS 0.0 0.5 1.0 1.5 2.0 2.5 −3−2 −1 Seconds 1230 123 0 Figure 7 Human activity data. Discriminant functions estimated by functional LDA based on non-penalized (dashed line) and penalized (solid line) multi-class functional PLS regression, using 4 and 7 PLS components, respectively Table 1 Human activity data. Correct classification rate based on a leave-one-out cross-validation on the training sample (CCRtraining) and based on the test sample classification (CCRtest ), and the number of PLS components (#PLScps) used in the functional LDA based on penalized and non-penalized multi-class functional PLS regression (FLDA-PenMFPLS and FLDA-MFPLS, respectively). denotes the smoothing parameter of the penalized approach. A multivariate version of LDA based on multi-class PLS regression (LDA-MPLS) is also considered for comparison purpose LDA-MPLS FLDA-MFPLS FLDA-PenMFPLS CCRtraining (%) 83 95 93 CCRtest (%) 56 67 78 #PLScps54 7 – – 0.41 the CCR in training and test samples highlights a possible overfitting mainly in the multivariate and in the non-penalized functional approaches. In the penalized approach this fact is not so remarkable, providing then the best classification rate. 4.2 Gait data The gait dataset comes from a wide experimental study developed in the biomechanics laboratories of the iMUDS. A total of 51 participants (25 boys and 28 girls) between 8 and 11 years old were involved in this study. In order to collect the data, 26 reflective markers were placed on the children’s skin. The kinematics data was recorded by a 3D motion capture system (Qualisys AB, G¨ oteborg, Sweden). Each subject completed a cycle walking over the platform in three conditions (walking, carrying a backpack that weighs 20% of the subject’s weight and pulling a trolley that weighs 20% of the subject’s weight). For each subject, the 3-axial angular rotation were registered for each join (ankle, foot progress, hip, knee, pelvis, thorax) in all conditions. Finally, the angular rotation curve represents the observation for the subject’s gait cycle for Statistical Modelling 2020; 20(6): 592–616 610 M. Carmen Aguilera-Morillo and Ana M. Aguilera each join, axis direction and experimental condition. Interested readers could request access to the data from Jose M. Heredia-Jim´ enez and Eva Orantes-Gonz´ alez from iMUDS. In this section, only a part of the above-described experimental dataset has been considered. Exactly, we are interested on the thorax angular position (radians) measured on axis Z. This is a clear example of functional data with repeated measures in the sense that three curves, concerning the three experimental conditions, are available for each subject. In addition, each sample curve was recorded in 101 equidistant points of the gait cycle. So, the interval [0,100] represents the percentage of gait cycle completed by the subject. Subject 10 was removed from the sample for being an outlier. The remaining sample observations were distributed into training and test samples, with observations (repeated measures) related to 39 and 11 subjects, respectively. The raw data (displayed by experimental conditions) are shown in Figure 8. −15−10−5 10 15 Walking Gait cycle Thorax angular position −15−10−5 Backpack 20% Gait cycle Thorax angular position −15−10−5 0 5 10 15 0 5 10 15 0 5 Trolley 20% Gait cycle Thorax angular position 0 20 40 60 80 100 0 20 40 60 80 100 0 20 40 60 80 100 Figure 8 Gait data. Raw data. Sample paths displayed separately by type of activity: walking, carrying a backpack and pulling a trolley, both weighing 20% of the children’s weight, from left to right, respectively In order to visualize the within subjects and the between subjects variability, in Figure 9 the spectra related to the three gait events have been overlapped for two subjects A and B, left and right panel, respectively. It can be seen that walking and walking with a trolley provide sample paths with a more similar shape than walking with a backpack. Also it is interesting to highlight the between subjects variability (differences in scale and shape). The sample curves have been approximated by mean of a basis representation using a cubic B-spline basis defined on 20 equidistant knots. In Figure 10 the raw data and the regression splines have been displayed. Once the sample curves have been approximated, the aim is the classification of the thorax angular rotation curves. In that sense, the discriminant functions estimated by penalized and non-penalized functional LDA can be seen in Figure 11. Once again the penalized approach provides the smoothest functions, providing an intuitive interpretation in relation with detecting periods in which the function is positive or negative. Statistical Modelling 2020; 20(6): 592–616 Multi-class classification of biomechanical data 611 −10 −5 Suject A: raw data Gait cycle Thorax angular position Walking Backpack 20% Trolley 20% Walking Backpack 20% Trolley 20% Suject B: raw data Gait cycle Thorax angular position 0 5 10 −10 −5 0 5 10 0 20 40 60 80 100 0 20 40 60 80 100 Figure 9 Gait data. Raw data. Sample paths related to walking (solid line), carrying a backpack (dashed line) and pulling a trolley (dotted line), both weighing 20% of the children’s weight and walking downstairs from two sample individuals A and B, left and right panel, respectively −4 −2 Walking Gait cycle Thorax angular position Raw data Regression Spline Raw data Regression Spline Raw data Regression Spline −4 −2 Backpack 20% Gait cycle Thorax angular position −6 −4 −2 Trolley 20% Gait cycle Thorax angular position 0 20 40 60 80 100 0 20 40 60 80 100 0 20 40 60 80 100 0 2 4 0 2 4 0 2 4 Figure 10 Gait data. A sample path for each stimulus (dashed line) together with the regression spline (solid line) estimated with a cubic B-splines basis defined on 20 equidistant knots The classification performance of the penalized and non-penalized approaches is shown in Table 2. It obvious that functional LDA performs better than the multivariate approach. Between the two functional approaches, the one based on penalized multi-class functional PLS (FLDA-PenMFPLS) achieves the best classification performance (the highest CCR on the test sample). 5 Conclusions In this work, a methodological solution to the problem of multi-class classification of functional data with repeated measures has been proposed. FLDA has been Statistical Modelling 2020; 20(6): 592–616 612 M. Carmen Aguilera-Morillo and Ana M. Aguilera −0.4 −0.2 0.0 0.2 0.4 Gait cycle FLDA−MFPLS FLDA−PenMFPLS FLDA−MFPLS FLDA−PenMFPLS −0.4 −0.2 0.0 0.2 0.4 Gait cycle 0 20 40 60 80 100 0 20 40 60 80 100 Figure 11 Gait data. Discriminant functions estimated by functional LDA based on non-penalized (dashed line) and penalized (solid line) multi-class functional PLS regression, using 5 and 3 PLS components, respectively Table 2 Gait data. Correct classification rate based on leave-one-out cross-validation on the training sample (CCRtraining) and based on the test sample classification (CCRtest ), and the number of PLS components (#PLScps) used in the functional LDA based on penalized and non-penalized multi-class functional PLS regression (FLDA-PenMFPLS and FLDA-MFPLS, respectively). denotes the smoothing parameter of the penalized approach. A multivariate version of LDA based on multi-class PLS regression (LDA-MPLS) is also considered for comparison purpose LDA-MPLS FLDA-MFPLS FLDA-PenMFPLS CCRtraining(%) 83 87 82 CCRtest (%) 33 61 85 #PLScps35 3 – – 2.87 considered as a classifier, by solving the problem of infinite dimension of the functional data by means of a novel approach of functional PLS regression for repeated measures described in Section 2. This work has been motivated by two real problems related to kinematic data. In both cases, data is affected by some noise, and then some type of penalization must be considered in the estimation of the discriminant functions. To solve this problem in the case of functional data with repeated measures, a multi-class approach for penalized functional PLS, that introduces a P-spline penalty in the definition of the inner product in the PLS algorithm, is proposed in Sections 2.2 and 2.3. In Sections 3 and 4, the performance of the two functional approaches (penalized and non-penalized, FLDA-PenMFPLS and FLDA-MFPLS, respectively) are compared with a multivariate version of LDA based on multi-class PLS regression (LDA-MPLS). As we can see in Figure 3 and Tables 1 and 2, from a classification point of view, functional approaches perform better than the multivariate version, increasing the CCR on a test sample in a very significant way. Regarding the two functional Statistical Modelling 2020; 20(6): 592–616 Multi-class classification of biomechanical data 613 approaches, the one based on penalized multi-class functional PLS achieves the best classification ability, with a difference in the CCR of more than 10% in both case studies. The discriminant functions estimated from penalized and non-penalized functional LDA are shown in Figures 7 and 11. It can be seen that the penalized version (FLDA-PenMFPLS) provides smoother functions, which are more interpretable in the sense of detecting periods in which the function is positive or negative. Finally, it can be concluded that LDA based on a multi-class approach for penalized functional PLS is the most competitive method from both classification and estimation point of view. Acknowledgements The authors would like to thank Jose M. Heredia-Jim´ enez, Eva Orantes-Gonz´ alez and Manuel Escabias for providing us the gait data from iMUDS. In addition, the authors thank the reviewers, the associate editor and the editor for their contribution to the improvement of this work. Declaration of conflicting interests The authors declared no potential conflicts of interest with respect to the research, authorship and/or publication of this article. Funding This research has been supported by the research projects MTM2017-88708-P, Spanish Ministry of Economy and Competitiveness (also supported by the FEDER program) and IJCI-2017-34038, Agencia Estatal de Investigacin, Ministerio de Ciencia, Innovacin y Universidades. References Aguilera AM and Aguilera-Morillo MC (2013) Comparative study of different B-spline approaches for functional data. Mathematical and Computer Modelling, 58, 1568–79. Aguilera AM, Aguilera-Morillo MC and Preda C (2016) Penalized versions of functional PLS regression. Chemometrics and Intelligent Laboratory Systems,154, 80–92. Aguilera AM, Escabias M, Preda C and Saporta G (2010) Using basis expansion for estimating functional PLS regression: Applications with chemometric data. Chemometrics and Intelligent Laboratory Systems,104, 289–305. Aguilera-Morillo MC and Aguilera AM (2013) P-spline estimation of functional classification methods for improving Statistical Modelling 2020; 20(6): 592–616 614 M. Carmen Aguilera-Morillo and Ana M. Aguilera the quality in the food industry. Communications in Statistics: Simulation and Computation,44, 2513–34. Anguita D, Ghio A, Oneto L, Parra X and Reyes-Ortiz JL (2013) A Public Domain Dataset for Human Activity Recognition Using Smartphones. In Proceedings of the 21th European Symposium on Artificial Neural Networks, Computational Intelligence and Machine Learning, ESANN 2013, Bruges, Belgium, 437–42. Barker M and Rayens W (2003) Partial least squares for discrimination. Journal of Chemometrics,17, 166–73. Bottomley C, Daemen C, Mukri F, Papageorghiou AT, Kirk E, Pexsters A, De Moor B, Timmerman D and Bourne T (2009) Functional linear discriminant analysis: A new longitudinal approach to the assessment of embryonic growth. Human Reproduction,24, 278–83. Crane EA, Cassidy RB, Rothman ED and Gerstner G (2010) Effect of registration on cyclical kinematic data. Journal of Biomechanics, 43, 2444–47. Cuevas A, Febrero M and Fraiman R (2004) An ANOVA test for functional data. Computational Statistics and Data Analysis, 47, 111–22. Daffertshofer A, Lamoth CJC, Meijer OG and Beek PJ (2004) PCA in studying coordination and variability: A tutorial. Clinical Biomechanics,19, 415–28. Dai X, M¨ uller HG and Yao F (2017) Optimal Bayes classifiers for functional data and density ratios. Biometrika,79, 545–60. Dauxois J, Pousse A and Romain Y (1982) Asymptotic theory for the principal component analysis of a vector random function: Some applications to statistical inference. Journal of Multivariate Analysis, 12, 136–54. de Nord OE and Theobald EH (2005) Multilevel component analysis and multilevel PLS of chemical process data. Journal of Chemometrics,19, 301–07. Delaigle A and Hall P (2012a) Componentwise classification and clustering of functional data. Biometrika,99, 299–313. ——— (2012b) Methodology and theory for partial least squares applied to functional data. Annals of Statistics,40, 322–52. ——— (2012c) Achieving near perfect classification for functional data. Journal of the Royal Statistical Society: Series B,74, 267–86. Deluzio K, Wyss U, Zee B, Costigan P and Serbie C (1997) Principal component models of knee kinematics and kinetics: Normal vs. pathological gait patterns. Human Movement Science,16, 201–17. Deville J (1974) Methodes statistiques et numeriques de l’analyse harmonique. Annales De L’insee,123, 3–101. Dona G, Preatoni E, Claudio Cobelli C, Rodano R and Harrison AJ (2009) Application of functional principal component analysis in race walking: An emerging methodology, sports biomechanics. Sports Biomechanics, 8, 284–301. Donoghue OA, Harrison AJ, Coffey N and Hayes K (2008) Functional data analysis of running kinematics in chronic Achilles tendon injury. Medicine and Science in Sport and Exercise,40, 1323–35. Durban M, Harezlak J, Wand MP and Carroll RJ (2005). Simple fitting of subject-specific curves for longitudinal data. Statistics in Medicine,24, 1153–67. Eilers PHC and Marx BD (1996) Flexible smoothing with B-splines and penalties. Statistical Science,11, 89–121. Escabias M, Aguilera AM and Aguilera-Morillo MC (2014) Functional PCA and base-line logit models. Journal of Classification,31, 296–324. Escabias M, Aguilera AM and Valderrama MJ (2004) Principal component estimation of functional logistic regression: Discussion of two different approaches. Nonparametric Statistics,16, 365–84. ——— (2005) Modeling environmental data by functional principal component logistic regression. Environmetrics, 16, 95–107. ——– (2007) Functional PLS logit regression model. Computational Statistics and Data Analysis,51, 4891–4902. Statistical Modelling 2020; 20(6): 592–616 Multi-class classification of biomechanical data 615 Ferraty F and Vieu P (2006) Nonparametric Functional Data Analysis. Theory and Practice. Berlin: Springer-Verlag. Fisher RA (1936) The use of multiple measurements in taxonomic problems. Annals of Eugenics,7, 179–88. Frank I and Friedman JH (1989) Classification: Oldtimers and newcomers. Journal of Chemometrics,3, 463–75. Friedman JH (1989) Regularized discriminant analysis. Journal of the American Statistical Association,84, 165–75. Harrison AJ, Ryan W and Hayes K (2007) Functional data analysis of joint coordination in the development of vertical jump performance. Sports Biomechanics, 6, 196–211. Hastie T, Buja A and Tibshirani R (1995) Penalized discriminant analysis. The Annals of Statistics,23, 73–102. Horvath L and Kokoszka P (2012) Inference for Functional Data with Applications. Berlin: Springer-Verlag. Indahl UG, Sahni NS, Kirkhus B and Naes T (1999) Multivariate strategies for classification based on NIR-spectra–with application to mayonnaise. Chemometrics and Intelligent Laboratory Systems,49, 19–31. James, G. M. (2002). Generalized Linear Models with Functional Predictors. Journal of the Royal Statistical Society. Series B,64, 411–32. James GM and Hastie TJ (2001) Functional linear discriminant analysis for irregularly sampled curves. Journal of the Royal Statistical Society: Series B,63, 533–50. Kokoszka P and Reimherr M (2017) Introduction to Functional Data Analysis. London: Chapman and Hall/CRC. Li H, van de Voort FR, Ismail AA, Sedman J, Cox R, Simard C and Buijs H (2000) Discrimination of edible oil products and quantitative determination of their iodine value by Fourier transform near-infrared spectroscopy. Journal of the American Oil Chemists’ Society,77, 29–36. Liquet B, Lˆ e Cao KA, Hocini H and Thiebaut R (2012) A novel approach for biomarker selection and the integration of repeated measures experiments from two assays. BMC Bioinformatics,13, 325. Milovanovic I and Popovic DB (2012) Principal component analysis of gait kinematics data in acute and chronic stroke patients. Computational and Mathematical Methods in Medicine,2012, 1–8. Mkhadri A, Celeux G and Nasroallah A (1997) Regularization in discriminant analysis: An overview. Computational Statistics and Data Analysis,23, 403–23. Oca˜ na FA, Aguilera AM and Escabias M (2007) Computational considerations in functional principal component analysis. Computational Statistics,22, 449–65. Oca˜ na FA, Aguilera AM and Valderrama MJ (1999) Functional principal components analysis by choice of norm. Journal of Multivariate Analysis,71, 262–76. Orantes-Gonz´ alez E, Heredia-Jimenez J and Soto-Hermoso VM (2015) The effect of school trolley load on spatiotemporal gait parameters of children. Gait and Posture, 42, 390–93. O’Sullivan F (1986) A statistical perspective on ill-posed inverse problems. Statistical Science,1, 505–27. Perez-Enciso M and Tenenhaus M (2003) Prediction of clinical outcome with microarray data: A partial least squares discriminant analysis (PLS-DA) approach. Human Genetics,112, 581–92. Preda C and Saporta G (2005) PLS regression on a stochastic process. Computational Statistics and Data Analysis,48, 149–58. Preda C, Saporta G and Leveder C (2007) PLS classification of functional data. Computational Statistics,22, 223–35. R Development Core Team (2008) R: A Language and Environment for Statistical Computing. Vienna: R Foundation for Statistical Computing. URL http://www.R-project.org (last accessed 29 August 2019). Ramsay JO and Silverman BW (1997) Functional Data Analysis. Berlin: Springer-Verlag. ——— (2002) Applied Functional Data Analysis: Methods and Case Studies. Berlin: Springer-Verlag. Statistical Modelling 2020; 20(6): 592–616