## 2 Materials and Methods
### Statistical Analysis  
Statistical analyses were conducted using R Statistical Software v4.1.2 [19]. For the physiological measurements, the lme4 package [20] was used to derive the model. Before the experiment, a power analysis was conducted to determine the required sample size per treatment group to achieve a type error probability of 0.05 with a power superior of 0.90 based on a power \(t\)-test. Normality was tested for the model derivation process through the evaluation of residual plots. Relationships were analyzed as a linear mixed-effect model with period and group as a random effect. Response variables included respiration rate (RR) (breaths/minute [BrPM]), heartbeat (HR) (beats/minute [BPM]), and rectal temperature (RT, \({}^{\circ}\)C). Because of the temperature pattern used, there were several explanatory variables used to dissect aspects of the thermal environment for their influence on animal vital signs. The primary response of interest was the temperature experienced during a 4-day monitoring period. However, because that temperature could be experienced following a higher or a lower temperature, we also included a continuous variable to indicate the change in temperature from the previous period. Furthermore, temperatures could be experienced in the gradual (low temperature, to high temperature, back to low temperature) sequence or in the drastic (high temperature immediately) sequence. These sequence differences were also accounted for, as were the 2- and 3-way interactions among the thermal environment variables. Formally, the response variables were analyzed using the following model:  
\[Y_{ijklm}=\mu+\alpha_{i}+\beta_{j}+\gamma_{k}+\alpha\beta\gamma_{ijk}+c_{l}+d_{ m}+\varepsilon_{ijklm}\]  
where \(\mu\) represents the overall mean, \(\alpha_{i}\) is the effect of the \(i\)th ambient temperature, \(\beta_{j}\) is the effect of \(j\)th overall trend in the temperature changes (representing whether the gradual or drastic temperature pattern was used), \(\gamma_{k}\) is the effect of the \(k\)th difference in the temperature from the current period to the previous period, \(\alpha\beta\gamma_{ijk}\) represents the 2- and 3-way interactions of ambient temperature \(i\), temperature trend \(j\), and temperature lag \(k\), \(c_{l}\) is the random effect of period \(l\), \(d_{m}\) is the random effect of group \(m\), and \(\varepsilon_{ijklm}\) is the residual error associated with temperature \(i\), temperature trend \(j\), temperature lag \(k\), and period \(l\), and group \(m\). For the behavior classification, the random forest (RF) algorithm from the package _randomForest_[21] was derived for each temperature of interest. To investigate the predictive capacity of the algorithm, 70% of the IMU sensing data were randomly selected to build a training dataset, and 30% of the dataset was randomly selected to build the test dataset. A set of four models were derived, using data either from all thermal environments together or using data from each thermal environment. In addition to evaluating against the 30% of each dataset that was held out during derivation, we also evaluated the individual thermal environment algorithms against the data obtained under the other thermal conditions to explore the transferability of these algorithms among thermal conditions. Irrespective of the derivation dataset, models were derived using the 9-axis data from the IMU as explanatory variables and the behaviors of interest as the response variable. During each evaluation task (i.e., using either held-out data or data from other thermal environments), the _confusionMatrix_ function of the package _caret_[19] was used to compute accuracy, precision, sensitivity, and specificity metrics.