Linear Models for the Prediction of Animal Zone Ammonia in a Weaned Piglet Building

: Measuring ammonia inside livestock buildings poses many challenges that hinder the in-corporation of this variable into environmental control systems. The aim of this study was to measure various microclimate variables inside a weaned piglet building and analyse their interactions with NH 3 concentrations for setpoint temperatures of 26 and 25 ◦ C, in order to control NH 3 concentrations based on other easily measurable variables. The experimental test was conducted on a conventional farm in Northwest Spain. NH 3 concentrations in the animal zone were best correlated with CO 2 concentrations in the animal zone (R = 0.91 and R = 0.55) and velocity of air extracted through the fan (R = 0.72 and R = 0.65) for setpoint temperatures of 26 and 25 ◦ C, respectively. Similarly, strong correlations were found with relative humidity in the animal zone and temperature of inlet air. Because NH 3 concentration in the animal zone is related to the performance of the ventilation system, strong positive correlations were found between NH 3 concentration and temperature of inlet air whereas negative correlations were found between NH 3 concentration and ventilation rates. Linear regression models based on CO 2 concentrations in the animal zone and temperature of inlet air are recommended, because they provide a good ﬁt for both setpoint temperatures using variables that can be readily measured.


Introduction
In recent years, the gradual intensification of animal production has brought about many new environmental problems. At the same time, there has been a growing public awareness of the need to protect and respect animals, which has led to market initiatives for pork production systems with increased animal welfare [1]. In the near future, animal welfare, food safety and respect for the environment will be major challenges for pig production. In this context, indoor climate control in livestock buildings becomes crucial to the welfare, health and productivity of animals. Among other parameters, indoor climate control includes temperature, relative humidity, and air velocity and quality, which is defined in terms of microorganisms including pathogens, concentration of airborne contaminants such as dust, ammonia (NH 3 ), carbon monoxide (CO), carbon dioxide (CO 2 ) [2] or hydrogen sulphide (H 2 S) and methane (CH 4 ). Therefore, indoor climate in livestock buildings deserves particular attention because it affects animal health and welfare, animal production, workers' health and the environment. Indeed, a well-designed environmental control system is the most efficient tool to ensure optimal production in livestock housing [3].

Animals and Housing
An experimental test was conducted on a commercial pig farm located in northwest Spain (ETRS89. 43 • 10 12 N, 8 • 19 30 W). The farm housed weaned piglets of 20 kg live weight and was the largest in the study area, with a maximum capacity of 4985 sows.
The weaner room, with an area of 69.26 m 2 and a volume of 164.50 m 3 , consisted of twelve 2.55 × 1.97 m pens on both sides of a central aisle. The room could hold a maximum of 300 piglets, with an area of 0.20 m 2 per piglet. The piglets, which were Large White × Landrace hybrids weaned at 3 weeks of age, entered the room on February 25 and exited the room on April 8. The floor was completely slatted over a pit with a depth of 45 cm. The negative pressure ventilation system was composed of a helical extractor fan, model EU50, EXAFAN ©, Zaragoza, Spain, of 500 mm of diameter, 230 VAC, 50 Hz, 1330 rpm and 480 W with a maximum volume of 8746 m 3 h −1 . Fan speed was adjusted by changing the voltage using a temperature-based digital controller, which allowed ventilation rates between 25% Agronomy 2021, 11,1927 3 of 12 and 100% and bandwidth temperatures of ±1.5 • C. Additionally, the ventilation rate was modulated with a manual system that reduced the area of the air outlet through the fan and provided volumes of between 1.03 and 10.58 m 3 h −1 per piglet. Fresh air entered the room through two 0.70 m 2 windows with manually controlled air deflectors. The radiant floor heating system was composed of two 1.20 × 0.50 m polyester spreader plates for water, with 19 l capacity, placed at the center of each pen. The average temperature of the plates was 30.60 • C, with a mean difference between inlet and outlet temperature of 5.80 • C. The heating system was controlled with a manual valve.

Variables and Measurement
The following microclimate variables were measured ( Figure 1): Temperature of air in external corridor (T CA ), velocity of the air extracted through the ventilation system (V EX ), and temperature, relative humidity, air velocity and CO 2 and NH 3 concentrations in the animal zone (T, RH, V IN , CO 2 , NH 3 ). T CA was recorded using a BetaTherm 100K6A1B Thermistor sensor (Campbell Scientific ©, Loughborough, UK), with a measurement range of −5-95 • C and ±0.5 • C accuracy from −5 • C to 90 • C. The sensor was placed at 1.80 m height outside the room, in the external corridor ( Figure 1). V EX was measured using an active air speed transmitter (Delta Ohm HD2903TTC310, Selvazzano Dentro, Italy) with a measurement range of 0.20-20 ms −1 and an accuracy of ±0.4 ms −1 + 3% of measurement ( Figure 1). The transmitter was installed in a 0.55 × 0.55 m duct with a length of 1.20 m, fixed to the fan outlet, according to the method proposed by [28], and was adapted to the hotwire probe used.
The negative pressure ventilation system was composed of a helical extractor fan, model EU50, EXAFAN © , Zaragoza, Spain, of 500 mm of diameter, 230 VAC, 50 Hz, 1330 rpm and 480 W with a maximum volume of 8746 m 3 h −1 . Fan speed was adjusted by changing the voltage using a temperature-based digital controller, which allowed ventilation rates between 25% and 100% and bandwidth temperatures of ± 1.5 °C. Additionally, the ventilation rate was modulated with a manual system that reduced the area of the air outlet through the fan and provided volumes of between 1.03 and 10.58 m 3 h −1 per piglet. Fresh air entered the room through two 0.70 m 2 windows with manually controlled air deflectors. The radiant floor heating system was composed of two 1.20 × 0.50 m polyester spreader plates for water, with 19 l capacity, placed at the center of each pen. The average temperature of the plates was 30.60 °C, with a mean difference between inlet and outlet temperature of 5.80 °C. The heating system was controlled with a manual valve.

Variables and Measurement
The following microclimate variables were measured ( Figure 1): Temperature of air in external corridor (TCA), velocity of the air extracted through the ventilation system (VEX), and temperature, relative humidity, air velocity and CO2 and NH3 concentrations in the animal zone (T, RH, VIN, CO2, NH3). TCA was recorded using a BetaTherm 100K6A1B Thermistor sensor (Campbell Scientific © , Loughborough, UK), with a measurement range of −5-95 °C and ± 0.5 °C accuracy from −5 °C to 90 °C. The sensor was placed at 1.80 m height outside the room, in the external corridor ( Figure 1). VEX was measured using an active air speed transmitter (Delta Ohm HD2903TTC310, Selvazzano Dentro, Italy) with a measurement range of 0.20-20 ms −1 and an accuracy of ±0.4 ms −1 + 3% of measurement ( Figure 1). The transmitter was installed in a 0.55 × 0.55 m duct with a length of 1.20 m, fixed to the fan outlet, according to the method proposed by [28], and was adapted to the hotwire probe used. The sensors located in the animal zone were placed in a pen that was representative of room conditions. Sensors were arranged inside a protection cage at 0.2 m height above the slats to reduce the risk of destruction by the animals (Figure 1). T and RH were measured using a Temperature/RH smart sensor (ONSET ® S-THB-M002, Bourne, MA, USA) with a measurement range of −40-75 °C and accuracies of ± 0.2 °C for temperature and ±2.5% for humidity. To measure VIN, a hotwire probe (Delta Ohm HD103T.0, Selvazzano Dentro, Italy) with a measurement range of 0-5 ms −1 and ± 0.06 ms −1 accuracy was used. The sensors located in the animal zone were placed in a pen that was representative of room conditions. Sensors were arranged inside a protection cage at 0.2 m height above the slats to reduce the risk of destruction by the animals (Figure 1). T and RH were measured using a Temperature/RH smart sensor (ONSET ® S-THB-M002, Bourne, MA, USA) with a measurement range of −40-75 • C and accuracies of ±0.2 • C for temperature and ±2.5% for humidity. To measure V IN , a hotwire probe (Delta Ohm HD103T.0, Selvazzano Dentro, Italy) with a measurement range of 0-5 ms −1 and ±0.06 ms −1 accuracy was used. CO 2 was measured using a transmitter (Delta Ohm HD37BTV.1, Selvazzano Dentro, Italy) with a measurement range of 0-5000 ppm and 50 ppm ±4% accuracy. Finally, NH 3 was measured by using an electrochemical sensor MGS 150 (Murco ©, Dublin, Ireland), with a measurement range of 0-100 ppm and accuracy from −40 to +40 • C < 1 ppm. The 10-min averages of the measured values were stored at 1-sec intervals in a HOBO ® data logger (Bourne, MA, USA), and a CR-10X Campbell Scientific (Loughborough, UK). The electrochemical sensors used were suitable for use in livestock housing. Nevertheless, the sensors showed some problems, among which saturation after long exposures, need for regular maintenance and low sensitivity. The first two issues were minimized by using the equipment in short periods, with the required maintenance tasks. However, sensitivity is inherent to the sensor and affects mainly measurements of low concentrations. In order to improve data accuracy, each day with the same T S was considered as a repeated measurement. Under this consideration, two standard days were prepared, one for each T S (26 and 25 • C), by calculating the hourly average for every day, which resulted in values more indicative of daily variation.

Data Analysis
Data were collected at setpoint temperatures (T S ) of 26 and 25 • C between March 2 and 17 March 2013, which corresponded to days 5 to 22 after weaning. We chose this study period because of the type of sensor used, which saturates and loses reliability for continuous measurements performed in long periods (more than 20 days). The 10-min averages of the measured values were transformed into hourly averages (H) because the dynamics of the processes associated with the distribution of heat and diffusion of gases did not allow us to establish good linear relationships at shorter times. In order to obtain the daily evolution of the variables, the hourly mean values were calculated for every day (D) in the study period.
A statistical analysis was carried out using IBM SPSS Statistics V22.0 (SPSS: Chicago, IL, USA)for Windows. To demonstrate the effect of T S on NH 3 , an independent-samples T test was conducted. For that purpose, once the Box-cox transformation was applied, the normality of concentrations of NH 3 was checked through the Kolmogorov-Smirnov statistic. Results were higher than 0.05 for both setpoint temperatures (0.20 and 0.07 for T S of 26 • and 25 • C respectively). Thus, concentrations of NH 3 for both temperatures derive from normal populations. After that, we worked with two different datasets based on T S , T S = 26 • C or T S = 25 • C [17].
The correlations between the seven study variables were assessed by examining the correlation matrices and testing the significance between variables (NH 3 , CO 2 , T, T CA , RH, V IN , V EX ).
From the resulting correlation table, we selected the variables with the highest and most significant values of r with variable (NH 3 ) in order to perform a regression analysis for both groups (26 and 25 • C setpoint temperatures), thus excluding the variables with low or non-significant correlations. Following these criteria, a simple regression analysis was performed between NH 3 , CO 2 , RH, T CA , V EX for T S = 26 • C and NH 3 and V EX for T S = 25 • C.
Data analysis was performed by using multiple regressions, in which the dependent variable was NH 3 . The maximum number of independent variables that could be included in the regression model was nine. However, this did not mean that the effect of all the parameters was necessarily significant.
In Forward Stepwise Regression, variables are added sequentially into the model. The first variable added into the model is the one that shows the strongest correlation (+ or −) with the dependent variable. This variable is added into the equation only if it meets the entry criteria (significance of the term and criteria of global adjustment). Next, the independent variable with the highest partial correlation (out of those that are not already in the equation) is added into the model. The process ends when there are no more variables left that meet the entry criteria. In this work, we used an SPSS procedure that performed all possible subset regressions.

Concentration of NH 3 for T S 26 and 25 • C
For both setpoint temperatures, daily mean NH 3 concentrations ( Figure 2) were well below the strict safe exposure limits set by [11] at 10 ppm, and most of the time below the 7 ppm established by [16]. Piglets were in a clean environment, with concentrations below 6 ± 0.5 ppm [12], for 85.32% and 66.67% of the time for 26 and 25 • C, respectively, and exceeded this limit only for 14.68% (26 • C) and 33.33% (25 • C) of the time. variables left that meet the entry criteria. In this work, we used an SPSS procedure that performed all possible subset regressions.

Concentration of NH3 for TS 26 and 25 °C
For both setpoint temperatures, daily mean NH3 concentrations ( Figure 2) were well below the strict safe exposure limits set by [11] at 10 ppm, and most of the time below the 7 ppm established by [16]. Piglets were in a clean environment, with concentrations below 6 ± 0.5 ppm [12], for 85.32% and 66.67% of the time for 26 and 25 °C, respectively, and exceeded this limit only for 14.68% (26 °C) and 33.33% (25 °C) of the time.

Correlations between the Study Variables for TS 26 and 25 °C
Except for VIN, stronger correlations were found for TS = 26 °C than for TS = 25 °C (Table 1), which suggests an important effect of TS on the dynamics of mass and energy flows that occur in the building. A strong correlation was found between NH3 and CO2 concentrations, with values of 0.91 and 0.55 for 26 and 25 °C, respectively. These values

Correlations between the Study Variables for T S 26 and 25 • C
Except for V IN , stronger correlations were found for T S = 26 • C than for T S = 25 • C (Table 1), which suggests an important effect of T S on the dynamics of mass and energy flows that occur in the building. A strong correlation was found between NH 3 and CO 2 concentrations, with values of 0.91 and 0.55 for 26 and 25 • C, respectively. These values are in agreement with the values reported by other authors [29][30][31]. The difference between the correlations found for the concentrations of NH 3 and CO 2 for the two T S was evident and was related to the performance of the ventilation system. The lowest T S (25 • C) showed lower correlations because the ventilation system was much more efficient in removing NH 3 than CO 2 , due to the dynamics of the gases in the building, caused by the difference in density between both gases. CO 2 accumulates in lower layers of the building and is more difficult to extract, whereas NH 3 is on the upper layers, and thus easier to extract.
The correlation between T and NH 3 was near zero for both T S , which is in contrast with the findings reported by other authors [30]. Such a null correlation was due to the capacity of the climate control system which was composed of ventilation and heating to keep temperature in the animal zone (T) almost constant at the desired values.
For both T S , a negative correlation was found between NH 3 and T CA , with higher values for 26 • C (−0.80) than for 25 • C (−0.29), which is in agreement with [20]. This effect can be explained by the ventilation rates [32]. When the outdoor temperatures drop, there is a decrease in the ventilation rate inside the building, with the consequent increase in NH 3 concentration. This has been confirmed in our study, with correlations between ventilation (V EX ) and NH 3 of −0.72 and −0.65 for 26 and 25 • C, respectively.
For V IN , which indirectly characterizes ventilation, correlations with N H3 were −0.35 for 25 • C and almost null for 26 • C. Higher values of NH 3 during the night are indicative of a low ventilation rate, which suggests that the system could not extract all the NH 3 produced.
Correlations between RH and NH 3 were in the range 0.78 and 0.16 for T S = 26 • C and T S = 25 • C, respectively. The value obtained for 26 • C was similar to the value reported by [30], and intermediate with respect to the values reported by [24,33].

Linear Regression Models of NH 3 from Mean Hourly Data
Statistical significance shows the predictor variables included in the analyses that are significant at 95% confidence level. To check for collinearity in the model, two indicators were used: tolerance (T') and variance inflation factor (VIF). A multicollinearity problem occurs when tolerance is < 0.10 and VIF is higher than 10. Therefore, no multicollinearity was found among variables.
To study independence and lack of correlation between residuals (the difference between observed values and predicted values), we used the Durbin-Watson statistic, which varies from 0 to 4. When the DW statistic takes values in the range of 1.5 to 2.5, the residuals are assumed to be independent [34]. Therefore, no autocorrelation was observed in the models in accordance with the DW statistic, as shown in Table 2. All the models are significant and suggest a significant linear relationship. The significance of each variable is explained for each model. The result of the analysis of variance (ANOVA) indicates whether the model is significant as a whole. The sum of squares of the regression indicates Agronomy 2021, 11, 1927 7 of 12 which part of the variability of the dependent variable explains the model, and the sum of squares of the residuals indicates which part does not explain it. The F statistic indicates the predictive function of the regression model, determining whether every regression coefficient is significantly different to 0. The F test analyses the combined influence of explicative variables, instead of individually evaluating each explicative variable. The F statistical indicator presents an associated p value, which indicates the probability of the relationships between data being caused through chance. A small p value is required, normally less than or equal to 0.05, in order to determine that the relationships of the model are not caused by coincidence. The p-value is lower than 0.05 for all the models so every model is significant (Table 3).
The first model proposed in our study, model 26H-1, predicted the interactions between CO 2 and NH 3 concentrations ( Table 2) and yielded an adjusted R 2 value of 0.83, with a standard error (SE) of the estimate of 0.97 ppm. Model 26H-2 considered RH as the independent variable and yielded an R 2 of 0.60 with an SE of 1.49 ppm. Despite the poorer fit of model 26H-2 with respect to the first model, model 26H-2 is interesting because it reveals that keeping humidity at low levels ensures low concentrations of NH 3 .  Model 26H-3, for the relationship between T CA and NH 3 , yielded an R 2 of 0.64 and improved the prediction of NH 3 slightly as compared to model 26H-2. This finding is interesting because model 26H-3 incorporates an easily measurable variable, T CA . Model 26H-3 considerably improves the model proposed by [35] who, using non-continuous measurements, reported values between 0.95 and 0.97 for dairy cattle. Such an improvement could be explained in terms of the differences between forced ventilation and natural ventilation.
Model 26H-4 included V EX as the independent variable and showed poorer results (R 2 = 0.52) that were in agreement with the values reported by [36] and below those reported by [37].
Incorporating T CA , model 26H-5, or V EX , model 26H-6, into model 26H-1 slightly improved the predictions, with R 2 values of 0.86 and 0.84, respectively. Model 26H-8 yielded the best results, with an R 2 of 0.87 and an SE of 0.86 ppm, Yet, as with the previous models, model 26H-8 is not interesting from a practical standpoint because only the models requiring fewer, easily measurable variables can be incorporated into microclimate control in the building in terms of ammonia concentration. The standardized coefficients suggest that RH has a slightly greater effect on the prediction of NH 3 than T CA .
As regards the regression models for T S = 25 • C, model 25H-1, with V EX as the independent variable, showed an R 2 of 0.42, which is lower that the value reported by [37]. Incorporating new variables into the model produced slight improvements, such that the best results were obtained with model 25H-4, which yielded an R 2 of 0.53. Yet, the main drawback of model 25H-4 is the need to incorporate four variables into the control system. For a setpoint temperature of 25 • C, the standardized coefficients suggest that V EX is the variable with the greatest impact on the dependent variable, which implies that ventilation is essential in the determination and prediction of NH 3 concentrations, which is in agreement with the findings reported by [37].

Linear Regression Models of NH 3 from Mean Daily Data
Models built from mean daily data (Table 4) using a single variable did not improve the results for T S = 26 • C, even though the SE was considerably lower. On the contrary, models built from mean daily data improved considerably for T S = 25 • C. No multicollinearity was found among variables neither autocorrelation was observed in the models in accordance with the DW statistic. All the models are significant and suggest a significant linear relationship (Table 5). Table 4. Non-standardized coefficients (B), standardized coefficients (β), constants (CTE), correlation coefficients (R), adjusted determination coefficients (R 2 ), standard errors (SE), collinearity statistics (T' and VIF) and Durbin Watson statistics (DW) for the estimation of NH 3 from multiple regressions with the variables (V): CO 2 , RH, T CA and V EX for mean daily data (D) and T S 26 • C or 25 • C.  Overall, the accuracy of the models built from mean daily data (Table 4) did not improve for T S = 26 • C, even though these models showed a notably lower SE. Conversely, for T S = 25 • C, the goodness of fit increased considerably and the SE decreased. For both TS, the models incorporating V EX , T CA or CO 2 as the single control variable produced remarkable results, which did not sensibly improve by adding new variables to the model. Consequently, these models provide an efficient and inexpensive method for the control of NH 3 concentrations insofar as they use a single variable that can be readily measured.

Research Limitations
This study was performed on a single farm without considering the heterogeneity of the air inside the building. Yet, measurements of CO 2 and NH 3 concentration, relative humidity and temperature were carried out at a location that was representative of the environment in the animal zone.

Conclusions
The following conclusions can be drawn from the analysis of microclimate variables, particularly NH 3 concentration and its prediction from other inexpensive, easily measurable microclimate variables: NH 3 concentration in the animal zone correlates positively with CO 2 concentration and relative humidity in the animal zone for setpoint temperatures of 26 and 25 • C. In addition, because NH 3 concentration is directly related to the performance of the ventilation system, the correlation coefficients are strong and negative for air velocity extracted through the ventilation system and positive for temperature of air in the external corridor, which is not environmentally controlled and, therefore, shows a linear relation with outdoor temperature.
For a setpoint temperature of 26 • C, the variables that yield the best linear models are temperature of air in external corridor and CO 2 concentration, both for daily and hourly data. For 25 • C, the velocity of the air extracted through the ventilation system gains relevance and can be compared to the temperature of air in the external corridor.
Based on these differences, linear regression models based on CO 2 concentration in the animal zone and temperature of air in external corridor using mean daily values are recommended, because these models provide good fits for both setpoint temperatures using variables that require simpler measuring technology.  Data Availability Statement: Publicly available datasets were analyzed in this study. This data can be found here: https://www.dropbox.com/sh/njbugesrtr7omks/AADbL7geDiaj-shRA48S9hSva?dl=0.