## 3 Materials and Methods
### Partial Least Squares Regression  
Partial least squares regression (PLS) is a statistical tool that is very extended at the moment. It was introduced by [PERSON] [57] in the 1970s and was successively developed [58; 59]. This tool was used to relate \(\mathbf{X}_{TR}\) with \(\mathbf{Y}_{TR}\), see Figure 1.  
PLS sequentially builds pairwise lineal combinations of variables, one from \(\mathbf{X}\) and one from \(\mathbf{Y}\), defined by the \(\mathbf{r}\) and \(\mathbf{q}\) vectors, respectively, that solve  
\[\begin{array}{l}max_{\mathbf{r},\mathbf{q}}\{var(\mathbf{X}_{TR}\mathbf{r} )[corr(\mathbf{X}_{TR}\mathbf{r},\mathbf{Y}_{TR}\mathbf{q})]^{2}var(\mathbf{ Y}_{TR}\mathbf{q})\}=max_{\mathbf{r},\mathbf{q}}\{[(\mathbf{X}_{TR} \mathbf{r})^{\mathsf{T}}\mathbf{Y}_{TR}\mathbf{q}]^{2}\}\\ \text{subject to }\|\mathbf{r}\|=\|\mathbf{q}\|=1,\end{array} \tag{7}\]  
where \(var\) and \(corr\) stand for variance and correlation, respectively, of the new variables \(\mathbf{X}_{TR}\mathbf{r}\) and \(\mathbf{Y}_{TR}\mathbf{q}\) that are named latent variables of PLS model.  
Maximization of the product \(var\)\((\mathbf{X}_{TR}\mathbf{r})[corr(\mathbf{X}_{TR}\mathbf{r},\mathbf{Y}_{TR} \mathbf{q})]^{2}var(\mathbf{Y}_{TR}\mathbf{q})\) tends to look for directions of large variance in both \(\mathbf{X}\)- and \(\mathbf{Y}\)-spaces (with more information), avoiding those of small variance (probably noise). In addition, the criterion includes the term \(corr\)\((\mathbf{X}_{TR}\mathbf{r},\mathbf{Y}_{TR}\mathbf{q})\) that helps in avoiding directions in the signal space with small correlation with the class codification.  
PLS is particularly useful when the variables \(\mathbf{X}_{TR}\) and/or \(\mathbf{Y}_{TR}\) are very correlated or are colinear. In our case, \(\mathbf{X}_{TR}\), the sEMG signals, present both characteristics: They are not independent, and they do not define 4860 dimensions, and neither do \(\mathbf{Y}_{TR}\), the gesture codes, define approximately 30 dimensions. PLS is very efficient in finding the subjacent structure in the data by using a reduced number of latent variables, \(nvl\). These latent variables define a subspace of \(\mathbf{X}\) of \(nvl\) dimensions that explains the variability in the object codes, \(\mathbf{Y}_{TR}\), that, in our problem, is the variability between gesture classes. The value of \(nvl\) is adjusted between one and \(K\) to obtain the best response using the method described in Section 3.6.  
This step of procedure returns a linear regression model described by 4860 \(\times\)\(c\) coefficients along with the PLS-box [60], which is a closed region in the space of the sEMG signals. The complement set to the PLS-box identifies signals to which the model cannot be applied because they are significantly different from the training matrix. PLS-box is defined by two critical values fixed in this work to a confidence level of 0.95. As all the responses are fitted together, PLS provides a common PLS-box for the c binary learners.  
The result of applying the model to sEMG signals (\(\mathbf{X}_{TR}\) or \(\mathbf{X}_{TS}\)) will return, respectively, the predicted code (\(\mathbf{\hat{Y}}_{TR}\) and \(\mathbf{\hat{Y}}_{TS}\), respectively), see Figure 1. For this task, the function 'pls' of PLSToolbox [56] has been used.