## 3 Materials and Methods
### Modeling Long Short-Term Neural Network  
The water level of a wetland varies continuously throughout the year. Consequently, the water level of a given day strongly relates to the water levels of previous days. Hence, it can consider a time series signal (TSS). Therefore, the temporal relationship between the daily water levels of a wetland can be considered for future water level prediction. Assuming the temporal information embedded within water level variation during a consecutive thirty days is strong enough for the future forecast, the last thirty-day water levels are used as the input for the next day's water level prediction. Among the different types of NNs, RNN, LSTM, GRU, and their variants can keep information related to previous input/output data of the NN within it (i.e., maintaining memory). Moreover, LSTM presents greater resistance to the exploding and vanishing gradient, which is one of the critical issues with the RNN family. Considering all facts, LSTM was selected for TSS-based water level prediction. The loss function of LSTM for the given application is presented in Equation (12). \[L(\theta)^{(t)}=\frac{1}{2T}\sum_{i=1}^{T}\Big{(}F_{\theta}\Big{(}\mathbf{x}^{(t) }\Big{)}-WL^{(t)}\Big{)}^{2} \tag{12}\]  
where \(L^{(t)}_{\theta}\)is the loss of time step \(t\) and \(\mathbf{x}^{(t)}\) is the input vector to the NN. In this application, \(T=30\) and \(\mathbf{x}^{(t)}=\Big{[}WL_{t-T-1},WL_{t-(T-1)-1},\dots,WL_{t-1}\Big{]}\) where \(WL\) is the water level. The architecture of the proposed LSTM network is presented in Table 2. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Layer Type** & **Hyper Parameters (Neurons)** & **Activation Function** \\ \hline
1 st Hidden Layer & 128 & ReLU \\
2 nd Hidden Layer & 64 & ReLU \\ Dropout & 0.2 Probability & \\
3 rd Hidden Layer & 32 & ReLU \\ Dropout & 0.2 Probability & \\
4 th Hidden Layer & 16 & ReLU \\ Dropout & 0.2 Probability & \\
5 th Hidden Layer & 8 & ReLU \\ Output Layer & 1 & Linear \\ \hline \hline \end{tabular}
\end{table} 
Table 1: FNN Network Architecture. Both networks were implemented using the Python programming language. Prediction performance was measured using three indicators: \(R^{2}\) Score, \(MSE\), and \(MAE\). \(R^{2}\) Score is illustrated in Equation (13). The R\({}^{2}\) Score can be determined as a ratio of the total variation of data points explained by the regression line (sum of squared regression) and the total variation of data points from the mean (also termed as the sum of squares total or total sum of squares). \[R^{2}=\frac{\sum(\hat{y}_{i}-\overline{y})^{2}}{\sum(y_{i}-\overline{y})^{2}} \tag{13}\]  
where \(\hat{y}\), and \(y_{i}\) represent the predicted value, mean of the values, and actual value, respectively. Although the \(R^{2}\) score was used for the analysis, the actual vs predicted water level graphs were also used to demonstrate the prediction performances. \(MSE\) measures the average of the squares of the errors. It can be expressed as in Equation (14). It is an indication of the difference between measured and observed values. \(MSE\) is always a positive value. A model performs better when the \(MSE\) values are lower. The zero \(MSE\) indicates that the model is error-free. \[MSE=\frac{1}{N}\sum_{i=1}^{N}\left(Y_{i,\text{ }observed}-Y_{i,\text{ }predicted}\right)^{2} \tag{14}\]  
\(MAE\) is the magnitude of the difference between the predicted value and the observed value and the true value of that relevant observation. It is shown in Equation (15). \[MAE=\frac{1}{N}\sum_{i=1}^{N}abs(Y_{i}-\lambda(X_{i})) \tag{15}\]  
where \(y_{i}\) is the true target value for the test instance \(x_{i}\), \(\lambda x_{i}\) is the predicted target value for the test instance \(x_{i}\), and \(n\) is the number of test instances. This study used two different NNs (i.e., FFNN and LAST) to investigate the possible relationships between identified independent variables and water level and the temporal relationship within daily water levels.