Short-term forecasting of indoor CO2 concentration in commercial pig barns using time-series models: A walk-forward validation and out-of-sample testing framework
Received: Jul 27, 2026; Revised: Sep 21, 2026; Accepted: Nov 03, 2026
Published Online: Nov 13, 2026
Abstract
Short-term forecasting of CO2 concentration in commercial pig barns (CPBs) is essential for effective indoor air quality management. However, previous studies have often used simple train–test splitting for CO2 forecasting, which may not adequately capture real-world temporal variability in CPBs. Therefore, this study integrated walk-forward (WF) validation with continuous model updating and out-of-sample (OOS) testing to assess forecasting performance on unseen observations. Hourly-resampled data were used to generate one-step-ahead forecasts for the subsequent hour. Four time-series models, ARIMA, SARIMA, SARIMAX, and Prophet, were evaluated using indoor environmental data from Barn A (piglets) and Barn B (sows), while Barn C (control) was included for comparison of indoor environmental conditions across the three barn types. Model performance was assessed using root mean squared error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE), residual diagnostics, and the entropy-weighted residual quality index (EW-RQI). Significant differences in indoor air quality parameters were observed among the barns (p < 0.001). During WF validation, SARIMAX achieved the best overall forecasting performance in Barn A, reducing RMSE, MAE, and MAPE by 4.58–55.37%, 3.50–61.73%, and 2.54–63.83%, respectively, compared with the other models, whereas performance differences in Barn B were relatively small. During OOS testing, SARIMAX remained the best-performing model in Barn B, reducing RMSE, MAE, and MAPE by 15.67–42.04%, 7.10–41.31%, and 6.67–40.71%, respectively. In Barn A, SARIMAX achieved lower MAE and MAPE, although ARIMA produced the lowest RMSE. Moreover, SARIMA and SARIMAX exhibited the better overall residual quality, achieving the highest EW-RQI values across both WF validation and OOS testing. These findings may provide valuable insights for monitoring CO2 concentrations and support improved indoor atmospheric management in CPBs.
Metrics
QR Code of this Article:
Related Articles
Applying and adapting the welfare quality® protocol for assessing animal welfare in Korean cattle and pig slaughterhouses
J Anim Sci Technol 2025;67(6):1406-1426.
Animal welfare indicators and stress response of broiler chickens raised at low and high stocking density
J Anim Sci Technol 2025;67(5):1126-1138.
Effect of loading density and weather conditions on animal welfare and meat quality of slaughter pigs
J Anim Sci Technol 2023;65(6):1323-1340.
Evaluation of the quality characteristics of nitrogen gas-stunned chicken meat and small intestine
J Anim Sci Technol 2024;66(4):792-806.
Just transition in the livestock sector under the frameworks of the Paris agreement and environmental, social, and governance: a review
J Anim Sci Technol 2026 [published online ahead of print: Nov 16, 2026]
