# Parallel Hierarchical Genetic Algorithm for Scattered Data Fitting through B-Splines
## 5 Simulation Results
### Results
Figure 6 shows the results obtained with SNR = 1, where PHGA had a better performance in functions 1, 2, 4-6. In the case of function 3, LOWESS had the lowest error level compared with all the other methods, although PHGA did not have the best performance, it was very close to LOWESS and also PHGA had an error dispersion lower than LOWESS. Figure 5: Boxplots of MSE computed for each algorithm per function, using 100 test sets, 100 scattered points(x,y) and SNR = 2. In order to visually compare the performances of PHGA, CSSPL, FCF and LOWESS approaches, we present in Figures 7-9 some graphs of the best curves obtained with each one of the methods. In general, curves fitted with PHGA had a smoother appearance in contrast to curves adjusted by the others methods, this is because of the fitness function for the PHGA is a multi-objective function, looking for reducing the number of knots of the curve, placing them uniformly distributed in the domain of \(x\) and reducing the MSE. Figure 6: Boxplots of MSE computed for each algorithm by function, using 100 test sets, 100 scatered points(x,y) and SNR = 1. Based on the results showed in Figures 7-9, it can be observed that the proposed PHGA shows a better visual performance that those obtained with the other methods. This is particularly visible in the experiments with higher noise i.e., experiments with SNR = 1. In this case, we can observe that curves fitted with CSSPL for the function 2, 4, and 6 present a remarkable over fitting. This is the main drawback of the CSSPL method due to the results are very sensitive to the smoothing parameter. For the proposed approach, it could be assumed that the success is due to the simultaneous global search performed over all degrees of freedom of the B-spline model, as well as, the ability of the GA to find optimal solutions despite of the high level of noise in the signal. On the other hand, we can see from standard errors of the mean that both algorithm presents nearly the same certainty in the estimate of the mean. About the FCF method, it shows oscillations for functions 4 and 6 in the three levels of noise. The results are shown in Figures 7-9, it can be observed that the proposed PHGA is able to detect the optimal solutions of the B-spline model, as well as the accuracy of the proposed PHGA. Figure 7: Data and best fitting with SNR = 3 for parallel hierarchical genetic algorithm (PHGA), cubic smoothing spline (CSSPL), Fourier curve fitting (FCF) and locally weighted scatterplot smoothing (LOWESS) methods (solid line: estimated function; dashed line: real function). noise due to the fact that it is based on sum of sine and cosine terms. In the case of LOWESS method, it produces smooth curves but in most of the experiments its MSE is upper to the other methods. In order to evaluate the computational performance of our approach, two versions were implemented, sequential and parallel. The OpenCL framework was used for the parallel version due that it can be used over different platforms with multiple processors and for the sequential version C++ was chosen. Table 5 reports the average amount of time needed to run our approach using a single processor for sequential version, and eight, sixteen and thirty two processors for the parallel version. In such a table, the letter T is the time in seconds necessary to finish the execution of the genetic algorithm, and the letter S is the speed-up compared with the sequential version, under the same sense, different configurations of number of islands, subpopulation size and number of points to fit were set in the tests. Figure 8: Data and best fitting with SNR = 2 for PHGA, CSSPL, FCF and LOWESS methods (solid line: estimated function; dashed line: real function).