Clear Sky Science · en
Modeling and predicting water consumption in fattening pigs using autoregressive moving average with external parameters
Why barn water use matters
On modern pig farms, a steady supply of clean water is as vital as feed. When pigs suddenly drink more or less than usual, it can be an early sign of illness, heat stress, or problems with the housing. This study tracked how much water growing pigs used hour by hour over three years and built a mathematical tool that can predict what “normal” drinking looks like. Once that normal pattern is known, farmers and vets can spot trouble sooner and manage animals more humanely and efficiently.

Watching pigs drink around the clock
The research took place on a large commercial farm in northeastern Spain that raises pigs from about 23 to 110 kilograms. Water meters recorded how much water flowed into each barn every hour, while sensors monitored temperature, humidity, gases such as ammonia, and the pigs’ stage in the fattening period. After removing readings linked to cleaning and cooling, as well as obvious sensor errors, the team analysed 30 separate time series covering five pig batches in six barns, amounting to more than 77,000 hourly observations.
Daily rhythms and growing needs
The pigs’ drinking showed a clear daily rhythm. Most water was consumed during the day, with two main peaks: one in the morning and another in the late afternoon, and very little drinking at night. Over the weeks of fattening, daily water use per pig rose from roughly 2–3 litres to around 8 litres, reflecting their growth. The pattern also shifted with the seasons. During warm months, pigs showed a stronger morning peak and a steeper overall rise in water use, while in cold months the early peak was much weaker. These observations confirm that both body size and environment shape how and when pigs drink.
Turning patterns into a predictive tool
To turn these regularities into a practical forecasting tool, the authors used a time-series model known as ARMAX. In plain terms, the model learns how current water use depends on previous hours (the internal rhythm of the herd), on random short-term bumps and dips, and on outside influences such as outdoor temperature and barn air quality. They also added mathematical terms that capture the daily cycle, similar to combining simple waves to reconstruct a repeating pattern. The model was trained on most of the data and then tested on the remaining batches to see how well it could predict hourly water use a short time into the future.

How well the predictions worked
The final ARMAX model successfully reproduced both the long-term increase in water use as pigs grew and the daily up-and-down cycles. When the model generated forecasts, most observed values fell inside the 95% prediction bands, and statistical checks showed no important leftover structure in the errors. The strongest external influences were outdoor temperature and ammonia, along with the day of the fattening period. Warm conditions tended to lift drinking levels, while the role of ammonia likely reflected broader changes in barn ventilation and air quality. One limitation was that the model underestimated the first daily peak, probably because there were fewer warm-season batches in the training data.
What this means for farms and animal care
For a lay reader, the key outcome is that pigs have a reliable “drinking fingerprint” that depends on time of day, growth stage, and weather. The authors show that this fingerprint can be captured in a model that predicts how much water pigs should be using each hour under normal conditions. Once such a model is in place on a farm, sudden departures from the expected pattern could flag heat stress, illness, equipment failures, or other welfare problems before they become severe. While this study focused on a single farm, it points toward a future in which routine sensor data and smart analysis help farmers keep animals healthier and production more sustainable.
Citation: Marroco, M., Fernández-Fontelo, A., Segalés, J. et al. Modeling and predicting water consumption in fattening pigs using autoregressive moving average with external parameters. Sci Rep 16, 10027 (2026). https://doi.org/10.1038/s41598-026-40343-7
Keywords: pig water consumption, precision livestock farming, time series modeling, animal welfare monitoring, farm environmental conditions