## 4 Discussions and Conclusions  
This study proposes the application of KPCA to identify faults in a reverse osmosis plant operating in the pharmaceutical industry. Specifically, the purpose of the process is to purify the water before entering it into the processing cycle. The process has many critical issues regarding its monitoring, thus making it complex to perform proper fault detection. It is interesting to note that the monitoring criticalities come from two different points: some are intrinsic to the process itself; others instead are dependent on the management chosen for the implementation of the monitoring process. In the first case, the process itself operates under conditions that vary over time, since the characteristics of the input water are different and discontinuous over time. This means that different characteristics of the input water have different responses of the monitored parameters. Therefore, an incorrect analysis of these differences can lead to an incorrect analysis of the health state of the machinery. Other critical monitoring issues, on the other hand, are induced externally and do not depend on the process itself. In fact, the monitoring and the consequent recording of the parameters is neither continuous in time nor determined with regularity. The sampling is at irregular and undefined intervals, introducing into the system a discontinuity of data that can hide necessary information for correct data analysis. In conclusion, the process is highly dynamic and time-variant. Considering the dynamic nature of the process, this paper proposes the application of KPCA for monitoring and fault detection in this process. However, the time-variability makes it necessary to examine other considerations on how manage and consider the variability in the phase of fault detection. This analysis led to the core part of the paper, which suggested different combinations of past measurement matrices and future measurement matrices to be included as input for the subsequent fault detection with KPCA. This solution, which opens several future research scenarios, allowed for inclusion in the KPCA the issue of temporal dependence of the process as well. Several combinations were tested, specifically:  
1. Only the past matrix of the dataset both for the training phase and for the testing phase
2. The difference between future and past matrices both for training and test
3. The difference between the matrix of future measurements and that of past measurements for the training phase, while for the test phase only the matrix of past measurements
4. The sum of the past and future matrices both for the training and test
5. The sum of the past and future matrices for the training and only the past matrix for the test  
For the evaluation of the results with the various approaches tested, the initial situation was considered to be that in which the KPCA was trained with the entire dataset without any form of evaluation of the temporal relationships present in it. This situation, whose results are presented in Table 1, was therefore defined as the benchmark situation, i.e., the situation that needed to be overcome. Firstly, it is interesting to note that the approach in which the training process was performed only with the matrix of past measurements (Table 4) was the least effective, with completely unacceptable results. Moreover, this approach produced results worse than those presented in the benchmark situation alongside the approach in which both the training dataset and the test dataset were a result of the subtraction between the matrix of future measurements and the matrix of past measurements (Table 7). It is interesting to note that the results show that the use of the matrix of future measurements is limited to the training phase. In fact, its use in the test phase, i.e., in the real monitoring phase, compromised the achievable results. In general, the joint use of information obtained from past and future measurements increased the predictive power of the model.