## 2 Materials and Methods
### Statistical Method
#### 2.2.2 Capability of Discrimination or Multivariate Sensitivity
Therefore, each of the CD\(\beta\) and the corresponding critical values with \(\alpha/2\) and \(\beta/2\) are determined as indicated in Equations (10)-(12), for which the graphical interpretation can be made observing Figure 4. In summary, the capability of detection, CD\(\beta\), has, in this case, a minimum value, CD\(\beta_{\text{lower}}\), and a maximum value, CD\(\beta_{\text{upper}}\), evaluated using Equation (10). \[ \begin{array}{l}\text{CD}\beta_{\text{lower}}=\text{x}_{0}-\frac{\Delta( \alpha/2,\beta/2)w_{\text{y}_{0}}\phi}{\beta}\\ \text{CD}\beta_{\text{upper}}=\text{x}_{0}+\frac{\Delta(\alpha/2,\beta/2)w_{ \text{y}_{0}}\phi}{\beta}\end{array}  \tag{10}\]  
In the same way, the decision limit, CD\(\alpha\), is divided into two values depending on whether it is above or below the PL value. These values are calculated using Equation (11). \[ \begin{array}{l}\text{CD}\alpha_{\text{lower}}=\frac{\text{y}_{\text{cl}} -\alpha}{\text{b}}\\ \text{CD}\alpha_{\text{upper}}=\frac{\text{y}_{\text{cl}}-\delta}{\text{b}} \end{array}  \tag{11}\]  
where ycl and ycu are the values that satisfy Equation (12) for a discrimination problem. \[ \begin{array}{l}\alpha/2=\text{probability}\big{\{}y<\text{y}_{\text{cl}}|x= \text{x}_{0}\big{\}}\\ \alpha/2=\text{probability}\big{\{}y>\text{y}_{\text{cu}}|x=\text{x}_{0}\big{\}} \end{array}  \tag{12}\]  
Figure 4 is a schematic representation of the elements that make up the capability of discrimination. Methodologically, it is analogous to the cases in which there is a minimum or a maximum permitted/established limit (Figures 2 and 3) but distributing the probabilities of false compliance and false non-compliance bilaterally regarding y0. As in the previous cases, x is the true concentration of a sample, y, the concentration obtained based on the PLS calibration, and ycl and ycu depend on the significance level (\(\alpha\)) of the test. Figure 4 shows that the two critical values from Equation (12) are established with the density function of the response in x0, assigning the probability \(\alpha/2\) in each one of their tails (marked in red in the figure). As the concentration x moves away from the value x0 based on higher or by lower values, the probability of false compliance decreases (the sum of the two areas marked in blue in the figure). In a similar way as in Figure 2 (but in this case, bilaterally) if the interval [CD\(\alpha_{\text{cl}}\), CD\(\alpha_{\text{ul}}\)] is considered as the capability of discrimination regarding x0, the probability of incorrectly stating that the concentration is x0 is \(\beta\), which is practically 1. On the contrary, by expanding the interval around x0, or what is the same, decreasing \(\beta\), that is the probability of incorrectly stating that the concentration is different from x0. 2.2.3. Global Procedure for Multivariate Calibration to Guarantee CC\(\alpha\) and CC\(\beta\) (or CD\(\alpha\) and CD\(\beta\)) with NIR Spectroscopy and a PLS Model  
To determine CC\(\alpha\) and CC\(\beta\) (or CD\(\alpha\) and CD\(\beta\)), a multivariate PLS calibration model is built using the NIR spectra as predictor variables and the concentration of the analyte or substance as a response. Particularly, the matrix size of the predictor variables of this work could be seen in Table 1.  
In order to carry out the complete procedure, the specific following steps were followed in this work:  
1. To build a PLS model for each parameter, y = f(**X**), (i) first, the predictors were preprocessed by applying the standard normal variate (SNV) followed by a first (D1) or a second (D2) derivative and a second-degree polynomial (also varying the window size from 9 and 15) depending on the case of study. Then, both the predictors and the responses were mean-centered (all the details can be consulted for each data set and each case in Table 2). (ii) The number of latent variables was selected through cross validation.