## 3 Materials and Methods
### Long Short-Term Memory (LSTM) Network  
The extended recurrent neural network (RNN) is known as the long short-term memory (LSTM) network. There are several internal connections between nodes in the hidden layer of the RNN, which allows information to pass backward or forwards without restrictions [54; 55; 56]. The output of the RNN may be seen as a response to both the input layer and the previous state of each hidden unit, and the state of the preceding node can be considered as the input. The following two reasons explain why its effectiveness in the investigation is far less efficient than expected. At first, it could be difficult for an RNN to determine the right window size for historical observations, which can lead to insufficient retrieval of the data's variational properties. Secondly, the gradient of an RNN could potentially exhibit an ascending expansion or decline whilst utilizing the technique of gradient descent to handle historical data, which specifically results in gradient explosion. The extended connection structure of an RNN retains a lot of unimportant information without filtering, which is the motivation for the aforementioned approach. The conventional RNN is, therefore, a poor choice for handling long-term data. The hidden layer nodes of the RNN are replaced by unique memory cells (blocks) that employ filtering as well as the conversion of previous states and information in LSTM's expressive \"gate\" structure, which optimizes the RNN. Figure 2 shows the basic structure of memory cells. Input gate \(i_{t}\), forget gate \(f_{t}\), and output gate \(o_{t}\) make up each of the three gates that make up a memory cell. Based on the most recent timestamp, the input gate determines the amount of current information in the cell. The forget gate's contribution is to determine how much information from the previous cell state should be maintained and how much should be discarded, which prevents the internal cell values from increasing without bounds. The structure of the output gate allows it to filter the new state and output the filtered data. Following are the steps that describe the procedure of the LSTM network.  
Firstly, the initial gate \(i_{t}\) filters and draws additional information belonging to the input \(x_{t}\) appearing in the current state (time \(t\)), as well as computes the value of the memory cell \(\widetilde{c}_{t}\) for updating the state.  
\[i_{t}=\delta(Z_{i}\cdot[h_{t-1},x_{t}]+a_{i}) \tag{7}\]  
\[\widetilde{c}_{t}=tanh(Z_{c}\cdot[h_{t-1},x_{t}]+a_{c} \tag{8}\]  
Determine the value of the forget gate \(f_{t}\). The forget gate refines and stores the prior information to such an extent that they can represent long-term tendencies and eliminates irrelevant information.  
\[f_{t}=\delta\Bigl{(}Z_{f}\cdot[h_{t-1},x_{t}]+a_{F}\Bigr{)} \tag{9}\]  
By removing a piece of the information from the old cell, moreover adding together the filtered candidate value, the old cell state \(c_{t-1}\) is restructured to the new cell state \(c_{t}\).  
\[c=f_{t}*c_{t-1}+i_{t}*\widetilde{c}_{t} \tag{10}\]The * symbol in the last equation defined above is known as the dot product between matrices. Conclusively, the previously mentioned output gate \(o_{t}\) filters the updated state \(c_{t}\), and the resulting output is determined based on the updated state and the output gate state.  
\[o_{t}=\delta(Z_{o}\cdot[h_{t-1},x_{t}]+a_{0}) \tag{11}\]  
\[h_{t}=o_{t}*tanhtanh\ (c_{t}) \tag{12}\]  
In the above Equations, (7)-(12) \(h_{t}\) is the hidden layer technically known as the activation of the memory cell, \(Z_{c}\), \(Z_{f}\), and \(Z_{o}\), are suitable weight matrices, \(a_{i}\), \(a_{c}\), \(a_{f}\), and \(a_{0}\) represent the respective bias vectors, and \(\sigma\left(\cdot\right)\) and \(tanh\ (\cdot)\) are the sigmoid functions and hyperbolic tangent function, correspondingly. The schematic view of the LSTM network is presented in Figure 2.