# Medium Term Streamflow Prediction Based on Bayesian Model Averaging Using Multiple Machine Learning Models

^{1}

^{2}

^{3}

^{4}

^{5}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Materials and Methods

#### 2.1. Machine Learning Algorithms

#### 2.1.1. Recurrent Neural Network (RNN)

#### 2.1.2. Long- and Short-Term Memory Neural Network (LSTM)

#### 2.1.3. Gate Recurrent Unit (GRU) Neural Network

#### 2.1.4. The Back Propagation (BP) Neural Network

#### 2.1.5. Multiple Linear Regression (MLR)

#### 2.1.6. Support Vector Regression (SVR)

#### 2.1.7. Random Forest Regression (RFR)

#### 2.1.8. AdaBoost Regression (ABR)

#### 2.2. The Bayesian Model Average (BMA) Method

_{k}is the weight, which is also the probability when the kth mode is the best return mode, which is non-negative and satisfies $\sum _{k=1}^{K}}{w}_{k}=1$, reflecting the relative contribution of the kth mode to the prediction technique during the training period. ${h}_{k}\left(y\mid {f}_{k}\right)$ is the conditional probability density function linked to a single pattern return result.

#### 2.3. Hyperparameter Optimization

- (1)
- Set the initial temperature, termination temperature and control parameters update function: t
_{0}, t_{f}, T_{(t)}, which t_{0}should be sufficiently large, and set the initial value of the cycle counter k = 1. - (2)
- Generate a random initial state i and use it as the current state to calculate its corresponding objective function value f(i).
- (3)
- Let t
_{k}= T(t_{k−}_{1}), given the maximum number of loop steps L_{k}, the inner loop counter is assigned an initial value of m = 1. - (4)
- Randomly perturb the current state i, and a new state j is produced after a simple change, then, calculate the value of the objective function f(j) corresponding to j, and calculate the difference $\u2206f=f\left(j\right)-f\left(i\right)$ of the target function value corresponding to state j and state i.
- (5)
- If f < 0, the newly generated state j is accepted as the current state; conversely, if f ≥ 0, the probability P is used to determine whether state j replaces state i.

- (6)
- If m < L
_{k}, then let m = m + 1 and turn to step (4). - (7)
- If t
_{k}> t_{f}, then let k = k + 1 and turn to step (3); if t_{k ≤}t_{f}, then output the current state and the algorithm ends.

#### 2.4. Overall Process of the Proposed Model

_{i+}

_{1}and x

_{i}represent streamflow data at a time (i + 1) and ith, respectively; Δx

_{j}are streamflow data at time j after the first order difference.

_{i}is the normalized results, x

_{i}is the streamflow data at the time i, and x

_{min}and x

_{max}represent the minimum and maximum values of the streamflow sequence, respectively.

#### 2.5. Study Area

## 3. Evaluation Metrics

## 4. Results and Discussion

#### 4.1. Experimental Date Description

#### 4.2. Parameter Selection

#### 4.3. Result Analysis and Discussion

## 5. Conclusions

- (1)
- Through the application of ten-scale streamflow forecasting in Three Gorges Reservoir. The proposed method has the best performance in the test results of the ten-scale streamflow from the Three Gorges Reservoir from 1 January 2017 to 21 December 2019, with a Nash–Sutcliffe efficiency NSE of 0.876, correlation coefficient r of 0.936, MAPE of 0.128, MAE of 2066, and RMSE of 3416. For the single model, the GRU model has the best prediction effect, and the SVR model performed the worst. The result shows that the proposed method has better forecasting performance compared with a single forecasting model, and the forecasting results can meet the production requirements of water and electricity regulation and other management parts.
- (2)
- By analyzing the prediction results of different hyperparameter models, it can be concluded that the hyperparameter optimization method adopted in this paper can obtain a better set of hyperparameters and has reliability.
- (3)
- By comparing and analyzing the forecasting effect of flood season and non-flood season, we found that the forecasting effect of the model for non-flood season is very good, while the model in flood season has a general fitting effect. Therefore, we suggest that more relevant information should be introduced to further strengthen the study of flood season forecasting.

## Author Contributions

## Funding

## Data Availability Statement

## Acknowledgments

## Conflicts of Interest

## References

- Devia, G.K.; Ganasri, B.P.; Dwarakish, G.S. A Review on Hydrological Models. Aquat. Procedia
**2015**, 4, 1001–1007. [Google Scholar] [CrossRef] - Abbott, M.B.; Bathurst, J.C.; Cunge, J.A.; O’Connell, P.E.; Rasmussen, J. An introduction to the European Hydrological System—Systeme Hydrologique Europeen, “SHE”, 2: Structure of a physically-based, distributed modelling system. J. Hydrol.
**1986**, 87, 61–77. [Google Scholar] [CrossRef] - Arnold, J.G.; Srinivasan, R.; Muttiah, R.S.; Williams, J.R. Large area hydrologic modeling and assessment part I: Model development 1. JAWRA J. Am. Water Resour. Assoc.
**1998**, 34, 73–89. [Google Scholar] [CrossRef] - Beven, K.J.; Kirkby, M.J. A physically based, variable contributing area model of basin hydrology/Un modèle à base physique de zone d’appel variable de l’hydrologie du bassin versant. Hydrol. Sci. J.
**1979**, 24, 43–69. [Google Scholar] [CrossRef][Green Version] - Sugawara, M.; Watanabe, I.; Ozaki, E.; Katsugama, Y. Tank Model with Snow Component; Research Notes of the National Research Center for Disaster Prevention No. 65; Science and Technolgoy: Ibaraki-Ken, Japan, 1984. [Google Scholar]
- Bergstrom, S. Development and Application of a Conceptual Runoff Model for Scandinavian Catchments; SMHI Norrköping: Norrköping, Switzerland, 1977. [Google Scholar]
- Zang, S.; Li, Z.; Zhang, K.; Yao, C.; Liu, Z.; Wang, J.; Huang, Y.; Wang, S. Improving the flood prediction capability of the Xin’anjiang model by formulating a new physics-based routing framework and a key routing parameter estimation method. J. Hydrol.
**2021**, 603, 126867. [Google Scholar] [CrossRef] - Valipour, M.; Banihabib, M.E.; Behbahani, S.M.R. Comparison of the ARMA, ARIMA, and the autoregressive artificial neural network models in forecasting the monthly inflow of Dez dam reservoir. J. Hydrol.
**2013**, 476, 433–441. [Google Scholar] [CrossRef] - Besaw, L.E.; Rizzo, D.M.; Bierman, P.R.; Hackett, W.R. Advances in ungauged streamflow prediction using artificial neural networks. J. Hydrol.
**2010**, 386, 27–37. [Google Scholar] [CrossRef] - Mouatadid, S.; Adamowski, J. Using extreme learning machines for short-term urban water demand forecasting. Urban Water J.
**2017**, 14, 630–638. [Google Scholar] [CrossRef] - Kisi, O. Pan evaporation modeling using least square support vector machine, multivariate adaptive regression splines and M5 model tree. J. Hydrol.
**2015**, 528, 312–320. [Google Scholar] [CrossRef] - Castellano-Méndez, M.; González-Manteiga, W.; Febrero-Bande, M.; Manuel Prada-Sánchez, J.; Lozano-Calderón, R. Modelling of the monthly and daily behaviour of the runoff of the Xallas river using Box–Jenkins and neural networks methods. J. Hydrol.
**2004**, 296, 38–58. [Google Scholar] [CrossRef] - Niu, W.; Feng, Z.; Cheng, C.; Zhou, J. Forecasting daily runoff by extreme learning machine based on quantum-behaved particle swarm optimization. J. Hydrol. Eng.
**2018**, 23, 04018002. [Google Scholar] [CrossRef] - Adnan, R.M.; Liang, Z.; Trajkovic, S.; Zounemat-Kermani, M.; Li, B.; Kisi, O. Daily streamflow prediction using optimally pruned extreme learning machine. J. Hydrol.
**2019**, 577, 123981. [Google Scholar] [CrossRef] - Noorbeh, P.; Roozbahani, A.; Kardan Moghaddam, H. Annual and monthly dam inflow prediction using Bayesian networks. Water Resour. Manag.
**2020**, 34, 2933–2951. [Google Scholar] [CrossRef] - Costa Silva, D.F.; Galvão Filho, A.R.; Carvalho, R.V.; de Souza, L.; Ribeiro, F.; Coelho, C.J. Water Flow Forecasting Based on River Tributaries Using Long Short-Term Memory Ensemble Model. Energies
**2021**, 14, 7707. [Google Scholar] [CrossRef] - Dai, Z.; Zhang, M.; Nedjah, N.; Xu, D.; Ye, F. A Hydrological Data Prediction Model Based on LSTM with Attention Mechanism. Water
**2023**, 15, 670. [Google Scholar] [CrossRef] - He, F.; Zhou, J.; Feng, Z.; Liu, G.; Yang, Y. A hybrid short-term load forecasting model based on variational mode decomposition and long short-term memory networks considering relevant factors with Bayesian optimization algorithm. Appl. Energy
**2019**, 237, 103–116. [Google Scholar] [CrossRef] - He, F.; Zhou, J.; Mo, L.; Feng, K.; Liu, G.; He, Z. Day-ahead short-term load probability density forecasting method with a decomposition-based quantile regression forest. Appl. Energy
**2020**, 262, 114396. [Google Scholar] [CrossRef] - Hou, T.; Fang, R.; Tang, J.; Ge, G.; Yang, D.; Liu, J.; Zhang, W. A Novel Short-Term Residential Electric Load Forecasting Method Based on Adaptive Load Aggregation and Deep Learning Algorithms. Energies
**2021**, 14, 7820. [Google Scholar] [CrossRef] - Acaroğlu, H.; García Márquez, F.P. Comprehensive Review on Electricity Market Price and Load Forecasting Based on Wind Energy. Energies
**2021**, 14, 7473. [Google Scholar] [CrossRef] - Wang, Y.; Zou, R.; Liu, F.; Zhang, L.; Liu, Q. A review of wind speed and wind power forecasting with deep neural networks. Appl. Energy
**2021**, 304, 117766. [Google Scholar] [CrossRef] - Malik, P.; Gehlot, A.; Singh, R.; Gupta, L.R.; Thakur, A.K. A review on ANN based model for solar radiation and wind speed prediction with real-time data. Arch. Comput. Method. E
**2022**, 29, 1–19. [Google Scholar] [CrossRef] - Ahmad, N.; Ghadi, Y.; Adnan, M.; Ali, M. Load forecasting techniques for power system: Research challenges and survey. IEEE Access
**2022**, 10, 71054–71090. [Google Scholar] [CrossRef] - Wu, Z.; Lu, C.; Sun, Q.; Lu, W.; He, X.; Qin, T.; Yan, L.; Wu, C. Predicting Groundwater Level Based on Machine Learning: A Case Study of the Hebei Plain. Water
**2023**, 15, 823. [Google Scholar] [CrossRef] - Hassoun, M.H. Fundamentals of Artificial Neural Networks; MIT Press: Cambridge, MA, USA, 1995. [Google Scholar]
- Hochreiter, S.; Schmidhuber, J. Long Short-Term Memory. Neural Comput.
**1997**, 9, 1735–1780. [Google Scholar] [CrossRef] - Cho, K.; Van Merriënboer, B.; Bahdanau, D.; Bengio, Y. On the properties of neural machine translation: Encoder-decoder approaches. arXiv
**2014**, arXiv:1409.1259. [Google Scholar] - LeCun, Y.; Touresky, D.; Hinton, G.; Sejnowski, T. A theoretical framework for back-propagation. In Proceedings of the 1988 Connectionist Models Summer School; Morgan Kaufmann: Pittsburgh, PA, USA, 1988; pp. 21–28. [Google Scholar]
- Uyanık, G.K.; Güler, N. A study on multiple linear regression analysis. Procedia-Soc. Behav. Sci.
**2013**, 106, 234–240. [Google Scholar] [CrossRef][Green Version] - Smola, A.J.; Schölkopf, B. A tutorial on support vector regression. Stat. Comput.
**2004**, 14, 199–222. [Google Scholar] [CrossRef][Green Version] - Breiman, L. Random forests. Mach. Learn.
**2001**, 45, 5–32. [Google Scholar] [CrossRef][Green Version] - Segal, M.R. Machine Learning Benchmarks and Random Forest Regression; UCSF: Center for Bioinformatics and Molecular Biostatistics: San Francisco, CA, USA, 2004. [Google Scholar]
- Zhu, X.; Zhang, P.; Xie, M. A Joint Long Short-Term Memory and AdaBoost regression approach with application to remaining useful life estimation. Measurement
**2021**, 170, 108707. [Google Scholar] [CrossRef] - Raftery, A.E.; Madigan, D.; Hoeting, J.A. Bayesian model averaging for linear regression models. J. Am. Stat. Assoc.
**1997**, 92, 179–191. [Google Scholar] [CrossRef] - Wasserman, L. Bayesian model selection and model averaging. J. Math. Psychol.
**2000**, 44, 92–107. [Google Scholar] [CrossRef] [PubMed][Green Version]

Period | Date Range | Mean | Max. | Min. | SD | Skew. | Kurt. | Correlation Coefficent |
---|---|---|---|---|---|---|---|---|

Runoff | 1 January 2010–21 December 2019 | 13422 | 57100 | 3040 | 9996.9 | 1.14 | 0.80 | 0.797 |

Rain | 1 January 2010–21 December 2019 | 201.9 | 759.1 | 1.3 | 173.7 | 0.79 | −0.35 |

Sequence | Date Range | Test Result | p-Value | 1% | 5% | 10% |
---|---|---|---|---|---|---|

Inflow | 1981–2021 | −14.767 | 2.356 × 10^{−27} | −3.435 | −2.864 | −2.568 |

Index | Number of Neural Network Nodes | Input Dimension m | MAE | MAPE | RMSE | r | NSE |
---|---|---|---|---|---|---|---|

1 | 10 | 36 | 2099 | 0.130 | 12,018,323 | 0934 | 0.872 |

2 | 20 | 72 | 2079 | 0.132 | 11,937,780 | 0.935 | 0.873 |

3 | 30 | 72 | 2098 | 0.137 | 12,180,883 | 0.934 | 0.871 |

4 | 10 | 72 | 2050 | 0.128 | 11,691,335 | 0.936 | 0.876 |

Date Range | Error | LSTM | GRU | RNN | BP | MLR | RFR | ABR | SVR |
---|---|---|---|---|---|---|---|---|---|

1 December 1988–21 December 2009 | MAE | 1956 | 1904 | 2368 | 2735 | 2449 | 886 | 3185 | 3396 |

MAPE | 0.158 | 0.135 | 0.222 | 0.225 | 0.177 | 0.056 | 0.381 | 0.418 | |

RMSE | 3055 | 3045 | 3508 | 4143 | 3842 | 1486 | 3668 | 3960 | |

r | 0.964 | 0.965 | 0.958 | 0.928 | 0.929 | 0.990 | 0.956 | 0.946 | |

NSE | 0.913 | 0.914 | 0.886 | 0.841 | 0.863 | 0.979 | 0.875 | 0.854 |

Date Range | Error | LSTM | GRU | RNN | BP | MLR | RFR | ABR | SVR |
---|---|---|---|---|---|---|---|---|---|

1 January 2010–21 December 2019 | MAE | 2064 | 1931 | 2497 | 2791 | 2467 | 2258 | 3458 | 3847 |

MAPE | 0.162 | 0.136 | 0.236 | 0.250 | 0.188 | 0.151 | 0.377 | 0.444 | |

RMSE | 3160 | 3130 | 3465 | 4136 | 3948 | 3847 | 4450 | 4812 | |

r | 0.944 | 0.944 | 0.938 | 0.908 | 0.908 | 0.914 | 0.903 | 0.891 | |

NSE | 0.886 | 0.888 | 0.863 | 0.805 | 0.823 | 0.832 | 0.775 | 0.736 |

Date Range | Error | LSTM | GRU | RNN | BP | MLR | RFR | ABR | SVR | BMA |
---|---|---|---|---|---|---|---|---|---|---|

1 January 2017–21 December 2019 | MAE | 2333 | 2164 | 2734 | 2758 | 2416 | 2243 | 3197 | 3474 | 2066 |

MAPE | 0.173 | 0.142 | 0.246 | 0.208 | 0.159 | 0.137 | 0.329 | 0.370 | 0.128 | |

RMSE | 3625 | 3491 | 3820 | 4210 | 4008 | 3686 | 4119 | 4674 | 3416 | |

r | 0.931 | 0.935 | 0.928 | 0.912 | 0.911 | 0.925 | 0.920 | 0.894 | 0.936 | |

NSE | 0.861 | 0.871 | 0.845 | 0.812 | 0.829 | 0.856 | 0.820 | 0.768 | 0.876 |

Date Range | Season Divided | MAE | MAPE | RMSE | r | NSE |
---|---|---|---|---|---|---|

1 January 2017–21 December 2019 | flood season | 3581 | 0.166 | 4776 | 0.806 | 0.646 |

non-flood season | 550 | 0.09 | 729 | 0.947 | 0.881 |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

He, F.; Zhang, H.; Wan, Q.; Chen, S.; Yang, Y.
Medium Term Streamflow Prediction Based on Bayesian Model Averaging Using Multiple Machine Learning Models. *Water* **2023**, *15*, 1548.
https://doi.org/10.3390/w15081548

**AMA Style**

He F, Zhang H, Wan Q, Chen S, Yang Y.
Medium Term Streamflow Prediction Based on Bayesian Model Averaging Using Multiple Machine Learning Models. *Water*. 2023; 15(8):1548.
https://doi.org/10.3390/w15081548

**Chicago/Turabian Style**

He, Feifei, Hairong Zhang, Qinjuan Wan, Shu Chen, and Yuqi Yang.
2023. "Medium Term Streamflow Prediction Based on Bayesian Model Averaging Using Multiple Machine Learning Models" *Water* 15, no. 8: 1548.
https://doi.org/10.3390/w15081548