## 8 Simulation Results
### Trade-Offs of Our Solution  
After the results above, we decided to repeat the simulation to evaluate the energy consumption and prediction accuracy performance and analyze the behavior of our solution. The trade-off between these two performances is intrinsic because, in order to increase prediction accuracy, our solution sends samples gathered from a variable. Therefore, our solution consumes more energy than current solutions. The relationship between energy consumption and prediction accuracy does not depend on the amount of sensor nodes, because prediction is done in a distributed and localized way. We learned that it depends on the amount of samples. Therefore, when we increase the amount of samples, energy consumption decreases, SSerr increases and R\({}^{2}\) decreases, but the WSN cannot spend much energy, thus scenario #6 was simulated again, due to the fact that it had better performance results than the other scenarios. The amount of samples ranged from 6 (six), 8 (eight) and 10 (ten), which we respectively named Scenario #6C, Scenario #6B and Scenario #6A. The energy consumption results in these scenarios from messages sent by the sensor nodes show that, in order to decrease the amount of samples from 10 (Scenario #6A with 100 sensor nodes) to 6 (Scenario #6C with 100 sensor nodes), the E\({}_{\text{trans}}\) of the network increased from 1,834.32 \(\upmu\)J to 2,465.70 \(\upmu\)J. This happens because, by reducing the amount of samples, more packets will be sent. The E\({}_{\text{recp}}\) results show that the energy consumption increased from 489,567.40 \(\upmu\)J (Scenario #6A with 100 sensor nodes) to 578,866.80 \(\upmu\)J (Scenario #6C with 100 sensor nodes). The prediction improvement of humidity for the application version 4 (multiple linear regression) decreased from 0.995868 to 0.978811 [Figure 17(a)] and the SSerr of humidity increased from 0.021840 to 0.203488 [Figure 17(b)]. It should also be noted that application version 4 always had better results than the others versions. \begin{table}
\begin{tabular}{l c c c c c c} \hline  & \multicolumn{6}{c}{**Independent variable**} \\ \cline{2-7}  & \multicolumn{2}{c}{**Count (Time)**} & \multicolumn{2}{c}{**Temperature**} & \multicolumn{2}{c}{**Count and Temperature**} \\ \cline{2-7}  & \multicolumn{2}{c}{**version 2**} & \multicolumn{2}{c}{**version 3**} & \multicolumn{2}{c}{**version 4**} \\ \cline{2-7}  & **SSerr** & **R\({}^{2}\)** & **Serr** & **R\({}^{2}\)** & **SSerr** & **R\({}^{2}\)** \\ \hline Temperature & 0.210300 & 0.296891 & – & – & – & – \\ Humidity & 9.355700 & 0.025813 & 2.033940 & 0.788210 & 0.203488 & 0.978811 \\ Light & 2.121380 & 0.000000 & 0.073135 & 0.965525 & 0.054342 & 0.974384 \\ \hline \end{tabular}
\end{table} 
Table 6: Performance results of the SSerr and R\({}^{2}\) from all versions in scenarios #1, #4 and #6. \begin{table}
\begin{tabular}{l c c c c c c} \hline  & \multicolumn{6}{c}{**Independent variable**} \\ \cline{2-7}  & \multicolumn{2}{c}{**Count (Time)**} & \multicolumn{2}{c}{**Temperature**} & \multicolumn{2}{c}{**Count and Temperature**} \\ \cline{2-7}  & \multicolumn{2}{c}{**version 2**} & \multicolumn{2}{c}{**version 3**} & \multicolumn{2}{c}{**version 4**} \\ \cline{2-7}  & \multicolumn{2}{c}{**SSerr**} & \multicolumn{2}{c}{**R\({}^{2}\)**} & \multicolumn{2}{c}{**Serr**} & \multicolumn{2}{c}{**R\({}^{2}\)**} & \multicolumn{2}{c}{**SSerr**} & \multicolumn{2}{c}{**R\({}^{2}\)**} \\ \hline Temperature & 10.321800 & 0.290535 & – & – & – & – \\ Humidity & 4.964100 & 0.476813 & 8.583820 & 0.095316 & 0.185308 & 0.980470 \\ Light & 140.150060 & 0.869629 & 794.135000 & 0.261311 & 1075.06000 & 0.000000 \\ \hline \end{tabular}
\end{table} 
Table 7: Performance results of the SSerr and R\({}^{2}\) from all versions in scenarios #2, #3 and #5. The results for light level prediction are a little bit different from the results for humidity, but they display the same behavior.