# Prediction of Weights during Growth Stages of Onion Using Agricultural Data Analysis Method
## 4 Experimental Results
### Functional Data Analysis  
We have applied a functional regression model with functional covariates and functional responses to see how the six environmental factors affect the onion weights over growing time. Here, to perform a functional data analysis on onion data, we have used the \"fda\" package in the R-software. First, we conducted a functional data analysis to determine how six environmental variables influence the onion weights. Figure 4 shows the time series properties of the functional regression coefficients of each environmental factor during onion cultivation. In Figure 4, we first see that wind speed has a positive effect on the onion weights from the beginning to the middle, has a negative effect beyond the midpoint, and then has a positive effect again after the third quarter. Second, both the ground and mean temperature have a similarly positive effect in the early stage of onion weight growth, a negative effect at the midpoint, and a positive effect in the later growth period. Therefore, the ground temperature and average temperatures have a similar effect on onion radish growth, but the ground temperature has a relatively large magnitude in terms of influence. Third, humidity has a negative effect on onion weight throughout the growing season, but its impact is not significant. Fourth, the amount of sunshine has a positive effect early in the growth period of onions, a negative effect from the beginning to the middle, and a positive effect after the middle. Finally, rainfall has alternating positive and negative effects during onion growth, but its impact is not significant. \begin{table}
\begin{tabular}{c c c c c c c c} \hline  & **Wind** & **Ground** & **Temp** & **Humidity** & **Sunshine** & **Rainfall** & **Weight** \\ \hline wind speed & 1.00 & \(-\)0.32 & \(-\)0.31 & \(-\)0.38 & \(-\)0.26 & 0.02 & \(-\)0.24 \\ ground temp & \(-\)0.32 & 1.00 & 0.97 & 0.24 & 0.08 & \(-\)0.51 & 0.73 \\ temperature & \(-\)0.31 & 0.97 & 1.00 & 0.11 & 0.17 & \(-\)0.41 & 0.73 \\ humidity & \(-\)0.38 & 0.24 & 0.11 & 1.00 & \(-\)0.53 & 0.17 & 0.34 \\ sunshine & \(-\)0.26 & 0.08 & 0.17 & \(-\)0.53 & 1.00 & \(-\)0.35 & \(-\)0.18 \\ rainfall & 0.02 & \(-\)0.51 & \(-\)0.41 & 0.17 & \(-\)0.35 & 1.00 & \(-\)0.11 \\ weight & \(-\)0.24 & 0.73 & 0.73 & 0.34 & \(-\)0.18 & \(-\)0.11 & 1.00 \\ \hline \end{tabular}
\end{table} 
Table 4: Correlation coefficients between onion weight and six environmental factors. Figure 4: _Cont._Second, we calculated the coefficients of determination (\(R^{2}\)) representing the explanatory power for the onion weights when environmental variables were used individually and when they were used together. We also calculated the F-test statistic to test the goodness-of-fit of each environmental variable for onion weight. Table 5 shows both coefficients of determination, \(R^{2}\) represents the explanatory power of the onion weight for each environmental variable and the F-statistics used in the goodness-of-fit test. From Table 5 we can see that our results are similar to those above. We can also observe that if all environmental factors are used, the value of \(R^{2}\) is the highest and the value of F-statistic is the largest. Figure 4: Regression coefficients in the prediction of onion weights from six environmental variables. (**a**) Wind speed, (**b**) mean temperature, (**c**) ground temperature, (**d**) humidity, (**e**) sunshine, (**f**) rainfall. Additionally, individually, the value of \(R^{2}\) and the F-statistic of ground temperature, sunshine, and rainfall is high. On the other hand, the value of \(R^{2}\) and F-statistics of wind speed, mean temperature, and humidity are lower. Third, we graphically plot the actual observations of onion weights and the predicted values of each environmental variable to determine the predictive power of the six environmental variables. Figure 5 shows the relationship between actual observations and predicted values. We also calculated a Root Mean Square Error (RMSE) to numerically measure the predictive power of each environmental variable.