## 3 Global Horizontal Irradiance Models
### Long Short-Term Memory Model  
The long short-term memory (LSTM) model is a variant of the recurrent neural network model that enables learning order dependence in sequential data [42]. The model was successfully applied for temporal and ordinal data, including image captioning, machine translation, and speech recognition [43; 44; 45]. Although the LSTM model works in similar steps to the recurrent neural network model, the procedures inside the cell are different. As shown in Figure 3, LSTM contains three main gates: input, output, and forget gates with internal memory. Each cell memorizes values in certain time intervals and these three gates control the information that comes in and out of the cell. The gates and internal memory of LSTM are used to resolve the vanishing and exploding gradient problems that often occur in recurrent neural network models.  
The operational formulas of the LSTM method and definitions of notation are as follows:  
\[f_{t}=\sigma(W_{f}X_{t}+U_{f}h_{t-1}+b_{f}) \tag{43}\] \[i_{t}=\sigma(W_{i}X_{t}+U_{i}h_{t-1}+b_{i}) \tag{44}\]  
Figure 3: Architecture of the long short-term memory (LSTM).  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Model** & & & **Input** & & & **Total** \\ \hline  & \(\theta_{z}\) (or \(\gamma\)) & \(\varphi\) & \(T_{L}\) & \(\psi\) & z & \(C_{\text{max}}\) & \\ \multirow{2}{*}{Beyer} & \(\bullet\) & \(\bullet\) & & \(\bullet\) & & 3 \\  & \(\bullet\) & \(\bullet\) & \(\bullet\) & & & \(\bullet\) & 4 \\  & \(\bullet\) & \(\bullet\) & \(\bullet\) & \(\bullet\) & & & 4 \\  & \(\bullet\) & & \(\bullet\) & \(\bullet\) & & \(\bullet\) & 3 \\  & \(\bullet\) & & \(\bullet\) & \(\bullet\) & \(\bullet\) & & 4 \\ \hline \hline \end{tabular}
\end{table}
Table 5: Comparison of input variables in semi-empirical models.  
\[o_{t}=\sigma(W_{o}X_{t}+U_{o}h_{t-1}+V_{o}C_{t}+b_{o}) \tag{45}\] \[S_{t}=\tanh(W_{c}X_{t}+U_{c}h_{t-1}+b_{c})\] (46) \[C_{t}=i_{t}S_{t}+f_{t-1}S_{t}\] (47) \[h_{t}=o_{t}\text{tanh}(C_{t}) \tag{48}\]
* \(X_{t}\) is the input vector to the memory cell at time \(t\).
* \(\sigma\) is the sigmoid function.
* \(b\) is the bias vector.
* \(W\), \(U\) and \(V\) are weight matrices.
* \(i_{t}\), \(f_{t}\), and \(o_{t}\) are the values of the input, forget, and output gates at time \(t\), respectively.
* \(S_{t}\), \(C_{t}\), and \(h_{t}\) are the values of candidate state of the memory cell, the state of the memory cell at time \(t\), and the value of the memory cell at time \(t\), respectively.  
The sigmoid function, \(\sigma\) in Equations (43)-(45) generates values from zero to one. A value of one signifies that the input data are available to transfer through the gate, while the value of zero implies the opposite [43; 46]. \(S_{t}\) via tanh function in Equation (46) produces a new value at time \(t\), which ranges from \(-1\) to \(1\). The value of \(C_{t}\) in Equation (47) is obtained from the inputs of \(i_{t}\) and \(f_{t}\), and the multiplication between \(o_{t}\) and \(\tanh(C_{t})\) in Equation (48) results in the final output, \(h_{t}\).  
The LSTM model showed the best performance compared to the other machine learning methods for GHI prediction. [PERSON] et al. [43] mentioned that the RMSE of the LSTM model ranged from 108.88 W/m2 to 30.21 W/m2, depending on location, input parameter, forecast horizon, and time interval. Thus, this study applied LSTM for solar irradiance forecasting in order to compare it with semi-empirical models, which contain regression equations. The inputs for the LSTM model were \(C_{sat}\), \(\theta_{x}\), \(T_{L}\), and \(\psi\), whereas the constant value of z was ignored. The data from January-September 2018 were used for training, and those from October-December 2018 were selected for data tests.