# A Tri-Model Prediction Approach for COVID-19 ICU Bed Occupancy: A Case Study
## 3 Research Design
### Models & Algorithms
#### 3.2.1 ARIMA and SARIMAX  
This model averages the output from ARIMA and SARIMAX algorithmic executions. Next, we present the functionality of these two algorithms and the hyperparameter tuning for our experimentation. The ARIMA method models the next step in a sequence of observations. It uses a function to linearly calculate the dissimilarity of observations and residual errors of antecedent time steps. A dissimilarity pre-processing step of the sequence and the integration of Autoregression (AR) with Moving Average (MA) models makes the sequence stationary, a process labelled as integration (I). Mathematically, ARIMA can be represented by Equation (1). \[\Delta y_{t}=c+\phi_{1}\Delta y_{t-1}+\theta_{1}\epsilon_{t-1}+\epsilon_{t} \tag{1}\]  
where, \(c\): an intercept of the ARMA (Autoregressive Moving Average) model [49], \(\Delta\): the first difference operator and \(y\): the time lags. For the execution of ARIMA we set the order of AR (p), I (d) and MA (q) models as parameters where, p: the lags in the autoregressive model, d: the differencing/integration order and q: the moving average lags. These parameters are often used to implement AR, MA and ARIMA models. We exploit ARIMA, when our data are univariate time series, with the existence of trend, yet, with no seasonal components [50]. Initially, we set the order (p, d, q) to (1, 1, 0) i.e., the default parameters set by scikit-learn [45] implementation of ARIMA. Next, since our predictions were running on a weekly basis and as more data were being appended to our initial dataset, we were recalibrating these parameters according to autocorrelation coefficient (ACF) and partial autocorrelation coefficient (PACF) per week. For brevity, we omit reporting these parameter values as it would require showing results for three different models, from the first week of our experimentation until the end. Next, to examine the existence of seasonality and exogenous variables, we utilized SARIMAX. The exogenous variables are parallel input sequences containing data instances at the time steps of the original (endogenous) data. The exogenous instances stick directly to the model for each time step, while the endogenous time series are modelled differently \begin{table}
\begin{tabular}{c c} \hline \hline
**Variable** & **Model Execution Date** \\ \hline \(d_{0}\) & 16 November 2020 \\ \(d_{1}=d_{0}+x\) & 23 November 2020 \\ \(d_{2}=d_{1}+x\) & 30 November 2020 \\... &... \\ \(d_{n-1}=d_{n-2}+x\) & 1 March 2020 \\ \(d_{n}=d_{n-1}+x\) & 8 March 2020 \\ \hline \hline \end{tabular} where \(d_{(0..n)}\) all the execution dates, from 16 November 2020 up to 8 March 2021, and \(x=7\).  
\end{table} 
Table 1: Periodic forecasting of dataset and model executions. (e.g., AR, MA). SARIMAX is often used to model the methods involved with exogenous variables, such as ARX, MAX, ARIMAX and many others [49]. Mathematically, SARIMAX can be represented by Equation (2). \[\phi_{p}(L)\overline{\phi}_{p}(L^{s})\Delta^{d}\Delta_{s}^{D}y_{t}=A(t)+\theta_{ q}(L)\overline{\theta}_{Q}(L^{s})\epsilon_{t} \tag{2}\]  
where, \(\phi_{p}(L)\): the non seasonal autoregressive lag polynomial, \(\overline{\phi}_{p}(L^{s})\): the seasonal autoregressive lag polynomial, \(\Delta^{d}\Delta_{s}^{D}y_{t}\): the time series, differenced \(d\) times, and seasonally differenced \(D\) times, \(A(t)\): the trend polynomial (including the intercept), \(\theta_{q}(L)\): the non seasonal MA lag polynomial, and \(\overline{\theta}_{Q}(L^{s})\): the seasonal MA lag polynomial. This method is suitable for univariate time series with the existence of trend and/or seasonality and exogenous instances. Similarly, to ARIMA the (p, d, q) parameters set the AR parameters, dissimilarity, and MA parameters. The parameter d is an integer for the integration, p an integer for the AR order and q an integer for the MA order. Otherwise, these parameters are iterables for AR and MA lags for the model. Regarding the seasonal process of SARIMAX we set a (P, D, Q, s) order that models AR, dissimilarities, MA and periodicity, respectively.