*Artificial Neural Network*

Artificial neural networks have been largely used to solve multiple problems in engineering, and are based on artificial intelligence [4]. They have a wide range of applications, from pattern classification and clustering, to optimization and prediction, among others [50]. Here the ANNs are used to predict the most probable temperature and solar radiation.

Typically, the ANNs go through three processes: training, adjusting and validating. There are multiples nonlinear learning rules to use in the training. We used the following rule to train the ANN:

$$y(t) = f\left(y(t-1), \dots, y(t-n\_{\mathcal{Y}}), x(t-1), \dots, x(t-n\_{\mathcal{X}})\right) \tag{9}$$

where *x* and *y* are input and output data, respectively. *ny* and *nx* are the last values of the prediction and the input data, respectively.

The ANN applied to solar radiation forecasting has been trained, adjusted and validated with 70%, 15% and 15% of the data, respectively. Additionally, two inputs (time and temperature), six delays and 18 hidden neurons have been implemented on the ANN. This was implemented in MATLAB R2019b employing *ntstool*. Figure 2 depicts its schematic implementation.

**Figure 2.** ANN scheme for solar radiation prediction [50].

The ANN scheme illustrated in Figure 2 contains a two-layer feedforward network. The first is the hidden layer that works with a sigmoid transfer function, while the second one is the output layer, which consists of a linear transfer function. The hidden layer uses delays to stores previous values of input *x*(*t*) and output *y*(*t*) data. *W* and *b* are weights and bias values in the training process of the proposed ANN, respectively. The output *y*(*t*) in the output layer also applies rectified linear unit (ReLU) layer, which consists of

$$f(y) = \begin{cases} y, \ y \ge 0, \\ 0, \ y < 0. \end{cases} \tag{10}$$

The ReLU layer is used since in some cases the radiation estimation may be negative.

In the training process of the proposed ANN for solar forecasting the Levenberg–Marquardt algorithm was employed and it is available for the *ntstool* in MATLAB [52]. The main advantage of this training process in relation to classical Newton algorithm or Gauss-Newton algorithm is the rate of convergence and its stability. More information about the Levenberg-Marquardt algorithm can be found in [53,54].
