## 2 Materials and Methods
### Model Development  
#### 2.2.1 Neural Networks  
Two typical models of neural networks with an input layer, a hidden layer (transfer function), and an output layer were used. Representations of both architectures are shown in Figures 1 and 2. NAR is a non-linear autoregressive neural model based on a single data series that functions as an input and output. This model predicts the values of the series using only past observations of the series to be predicted (target variable) [53]. Autoregressive models with exogenous variables (ARX) are mathematical tools that weigh the inputs to the system through linear filters. These models have many advantages in their estimation and predictive use because optimal predictors are always stable [54]. NARX is based on this ARX model and is a repetitive dynamic system. It is also a non-linear autoregressive model with exogenous variables, i.e., one of the variables that explain it is a dependent variable [55]. NARX networks with the gradient descent learning algorithm were applied as they offer several significant advantages: first, learning is more effective in NARX than in traditional neural networks; second, convergence is more accurate and faster in NARX than in other networks [56]. In artificial neural networks, models are obtained by trial and error. This implies that there is no specific procedure to obtain the best network. In this sense, the procedure starts from an initial network and by testing several training algorithms a final network that meets the expectations is obtained [57]. Aspects such as data preparation or the training technique used play a central role in the quality of the final model obtained; for this reason, the model construction process is a non-trivial task [58]. The variable elements for modeling are mainly the definition of relevant inputs, delays, and hidden neurons (hidden layers) [54]. NAR or NARX are multilayer perceptron networks, where once the series for use is available, delays (a simple way to recognize past patterns of the input variables), the number of hidden layers (number of neurons in the network), and the training algorithm (learning of the neural network to calculate the correct output) are defined [20] (Figure 3). Input: The input layer is used to accept raw data for network processing and consists of neurons from which the input signals are sent to the hidden layer. In this study, five input signals were evaluated (four exogenous variables and the target variable). The input dataset is divided into two groups: (a) training data and (b) test data. Hidden layer: In this layer, the effectiveness of the network is measured by the activation function. The activation function refers to the feature of activated neurons that allows them to be retained and mapped out by a non-linear function, which can be used to solve non-linear problems. The activation function is used to increase the expression ability of the neural network model, which gives the neural network a kind of artificial intelligence [59]. In this work, we used the tanh function, which is a symmetric function centered on zero. The convergence rate is higher than the common sigmoid function. The formula of the tanh function is defined as Equation (1):  
\[f(x)=\frac{1-e^{-2x}}{1+e^{-2x}} \tag{1}\]  
Figure 3: General architecture of a NARX model of neural networks (MATLAB, 2021). Output: The output layer has a number of neurons that is equal to the number of target variables. In this work, the activation function of the output layer is linear because a regression with the ANN was used. A Bayesian training algorithm was used to determine the weights of neural network connections since this solves generalization and optimization issues, achieving convergence toward a set of optimal weights [60]. This training was developed to convert non-linear systems into \"well posed\" problems [60]. In general, the training step is aimed at reducing the sum squared error of the model output and target value.