## 3 Results  
The parameters (see Table 6) of the Modified Compartmental model were estimated using R programming language [51] to fit the egg production curve (1 st cycle). From Table 6, all parameters are significant (\(p<0.001\), represented with three ''*\" in the last column of the table) and are applicable for this forecasting task. The model parameters then can be filled with the estimated values (2), where the only input parameter is t, representing the number of weeks laying:  
\[\hat{y}(t)=0.13099\mathrm{e}^{-(-0.90414)t}/(1+\mathrm{e}^{-(-0.90766)(t-2.24 435)}), \tag{2}\]  
The fitted curve on the test egg production data set using the Modified Compartmental model can be seen in Figure 5.  
As Figure 5 shows, the result of the model shows only the trend in the production rate, based on the previously trained data, but does not incorporate input values that could influence the prediction and point to potential problems. This production cycle demonstrates that it is not enough to base conclusions only on the week of egg production alone to achieve high accuracy, rather it allows the farmers to see the deviations from the trend. The ML model's results and observed egg production rate with a sliding window of size two are depicted in Figure 6.  
The ML models tended to follow an abnormal decrease in production (see Figure 6), thus indicating their ability to adjust to these kinds of situations. The possible reasons for the egg production variations in the 2 nd production cycle were described in Section 3. Although further data inspection showed that the environmental factors did not change dramatically to have an impact on production decrease, the models forecasted the drop, \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Parameter** & **Estimate** & **Std. Error** & **T Value** & **Pr (\textgreater{}) \textless{}t\textgreater{}** \\ \hline a & 0.13099 & 0.01316 & 9.954 & \(4.45\times 10^{-14}\) *** \\ \hline b & \(-0.90414\) & 0.03927 & \(-23.024\) & \textless{}2 \(\times 10^{-16}\) *** \\ \hline d & 2.24435 & 0.04658 & 48.182 & \textless{}2 \(\times 10^{-16}\) *** \\ \hline c & \(-0.90766\) & 0.03923 & \(-23.139\) & \textless{}2 \(\times 10^{-16}\) *** \\ \hline \hline \end{tabular}
\end{table} 
Table 6: The estimated parameter values of Modified Compartmental model. Figure 5: Fitted curve and observed egg production rate. due to the fact that the previous day (depending on the sliding window size) production data served as inputs. Regarding the ML models, several window sizes were tested to determine the one that provided best prediction results. The window sizes of 1, 2, 3, 5, 7, and 14 were considered. The results of model performance per different window sizes to predict egg production for the next day are presented in Table 7. Regarding the size of the sliding window, the results showed that the LSTM performed best when using a sliding window size of two, having the smallest MAPE and RMSPE values 5.390% and 7.751%, respectively. There was also not a large difference between the models' performances when using the window size lengths three and five, except for the CNN model that performed the worst and could be explained as potential model overfitting. \begin{table}
\begin{tabular}{p{113.8 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt}} \hline \hline
**Windows Size** & **Error Metric** & **LSTM** & **CNN** & **XGBoost** & **RF** \\ \hline  
MSPE & 8.982 & 9.718 & **8.158** & 9.221 \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Machine learning model performance by different sliding window sizes. Figure 6: Results of the trained ML models tested on the 2 nd production cycle. Table 8 summarizes the best results obtained from the model evaluation. We can conclude that the LSTM, RF, and XGBoost models overall showed the best performances. The results of the evaluation, taking the best metric values for different sliding window sizes (for machine learning models), showed that the performances varied.