Journal of Animal Science and Technology
Korean Society of Animal Science and Technology
Research Article

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

Mohammad Ismail1, Dae Yeong Kang2, Oluwasegun Moses Ogundele1, Seong Hun Kim2, Reginald Gbenga Azuatalam1, D. L. Vindya Sathsarani Dasanayaka2, Usama Hanif1, Pirlepesov Daniyar Maratovich2, Myeong Yong Kang2, Jayanta Kumar Basak3, Hyeon Tae Kim4,*
1Department of Bio-systems Engineering, Gyeongsang National University, Jinju 52828, Korea.
2Department of Smart Farm, Gyeongsang National University, Jinju 52828, Korea.
3Department of Environmental Science and Disaster Management, Noakhali Science and Technology University, Noakhali 3814, Bangladesh.
4Department of Bio-industrial Machinery Engineering, Gyeongsang National University, Institute of Smart Space Agriculture (ISSA), Jinju 52828, Korea.
*Corresponding Author: Hyeon Tae Kim, Department of Bio-industrial Machinery Engineering, Gyeongsang National University, Institute of Smart Space Agriculture (ISSA), Jinju 52828, Korea, Republic of. E-mail: bioani@gnu.ac.kr.

© Copyright 2026 Korean Society of Animal Science and Technology. This is an Open-Access article distributed under the terms of the Creative Commons Attribution Non-Commercial License (http://creativecommons.org/licenses/by-nc/4.0/) which permits unrestricted non-commercial use, distribution, and reproduction in any medium, provided the original work is properly cited.

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.

Keywords: Carbon dioxide; Time-series models; Commercial pig barns; Animal welfare