# Daily Reservoir Runoff Forecasting Method Using Artificial Neural Network Based on Quantum-behaved Particle Swarm Optimization

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Artificial Neural Network

**Y**=

**H**(

**X**), where

**X**= [X

_{1},…,X

_{i},…,X

_{n}]

^{T}is input vector; X

_{i}is the ith input data; n is the number of input data;

**Y**= [Y

_{1},…,Y

_{j},…,Y

_{u}]

^{T}is output vector; Y

_{j}is the jth input data; u is the number of output data;

**H**(

**·**) denotes the complex nonlinear relation which can be estimated by some meta-heuristic methods like artificial neural network.

**H**(

**·**) of the nonlinear hydrological system. The main advantage of BP is that it can reflect the complex nature of underlying process with less information than other traditional methods. A typical BP neural network consists of three layers, input layer, hidden layer and output layer, whose structure is shown in Figure 1. Each layer is composed of a series of interconnected processing nodes. As a specific neuron, each node in any layer uses a nonlinear transfer function to calculate the inner product of input vector and weight vector to get a scalar result. Two neighboring layers are connected via the weights of the nodes between these layers. The input layer receives and transmits input data to hidden layer. The hidden layer may contain a single layer or multi-layer that receives values from the previous layer. Each hidden layer is responsible for the input information conversion and then delivers them to the next hidden layer or output layer. The output layer presents the simulated results and has only one single layer with one or several nodes. In a single calculation, the BP neural network can obtain overall error between the estimated output values and the target output values, then loss function gradient is calculated. The gradient-descent algorithm is fed to update weights and thresholds to minimize loss function. The connection weights and thresholds between any two feed forward-connected neurons will be unceasingly adjusted until the error meets the termination conditions. Then, the optimized BP neural network can be used to forecast the target value with the corresponding input vector.

## 3. Quantum-Behaved Particle Swarm Optimization

#### 3.1. Particle Swarm Optimization

**pbest**, and the best known position of the whole population,

**gbest**. Each particle has position vector and velocity vector, and explores in the searching space by a few simple formulas.

#### 3.2. Quantum-Behaved Particle Swarm Optimization

^{2}is the probability density function of its position. Let M particles in d dimensional space with $\overline{k}$ maximum generations, the position vector of ith particle at kth generation can be expressed as

**x**

_{i}(k) = [x

_{i}

_{,1}(k),x

_{i}

_{,2}(k),…,x

_{i}

_{,d}(k)]

^{T}. There will be

**gbest**(k) = [gbest

_{1}(k),gbest

_{2}(k),…,gbest

_{d}(k)]

^{T}and

**pbest**

_{i}(k) = [pbest

_{i}

_{,1}(k),pbest

_{i}

_{,2}(k),…,pbest

_{i}

_{,d}(k)]

^{T}. Employing Monte-Carlo method, particle moves according to the following iterative equation:

_{i,j}(k) is position for jth dimension of ith particle in kth generation; r

_{1}, r

_{2}, r

_{3}are random variables distributed uniformly in [0,1]; a(k) is contraction-expansion coefficient in kth generation which controls the convergence speed of the particle; a

_{1}, a

_{2}are maximum and minimum value of a(k), respectively; and there are usually a

_{1}= 1.0, a

_{2}= 0.5 [28]; p

_{i,j}(k) is the jth dimension of local attractor i in kth generation;

**mbest**represents the mean best position defined as mean of all

**pbest**position of the whole population.

## 4. Parameters Selection for Artificial Neural Network Based on QPSO Algorithm

- Step 0: Set basic parameters for the proposed method.
- Step 0.1: Set maximize iterations $\overline{k}$ and population size M in QPSO.
- Step 0.2: Divide data into training and testing sets.
- Step 0.3: Define transfer function of neurons, which is a sigmoid function in this paper, i.e.:$$f\left[x\right]=\frac{1}{1+{e}^{-x}}$$

_{i}is the normalized value and real value of each vector, respectively; ${X}_{i}^{\mathrm{min}}$ and ${X}_{i}^{\mathrm{max}}$ are the minimum and maximum value of input or output arrays; a and b are the positive normalized parameters, respectively. Based on large numbers of numerical experiments, we found that when the variable a = 0.2 and b = 0.6 are adopted to normalize the raw data, the forecasting models performs better. Hence, we use the variable a = 0.2 and b = 0.6 for data normalization in this paper.

**x**

_{i}(k) = {

**w**,

_{i}**b**}. Here,

_{i}**w**and

_{i}**b**represent the connection weights and bias matrix between any two layers of the BP neural network, respectively.

_{i}_{ji}represents the connection weight from the input node i to the hidden node j, b

_{j}stands for bias of neuron j, y

_{j}is the output value of the hidden layer node j.

_{1j}represent the connection weight from hidden node j to the output node 1, b

_{1}stands for the bias of the neuron; o

_{1}stands for the output data of network.

_{i}(k).

_{s}and t

_{s}is the sth normalized output value and target value in the training data, respectively. S is the number of training set samples.

## 5. Simulations

#### 5.1. Study Area and Data Used

^{2}and the mean annual runoff is 155 m

^{3}·s

^{−1}at the dam site. The total reservoir storage is 4.95 billion cubic meters and the regulated storage is 3.36 billion cubic meters. Locations of Wu River and Hongjiadu reservoir are shown in Figure 3.

#### 5.2. Performance Assessment Measures

_{i}and ${\widehat{Y}}_{i}$ are the observed value and predictive value of ith data, respectively. $\overline{Y}$ and $\tilde{Y}$ represent the mean value of the observed value and predictive value, respectively. n is the total number of data set used for performance evaluation and comparison.

#### 5.3. ANN Model Development

Model | Inputs | Relation between Output Variable and Input Variables |
---|---|---|

1 | Runoff(t-1),Rainfall(t-1) | Runoff(t)=H[Runoff(t-1),Rainfall(t-1)] |

2 | Runoff(t-1),Rainfall(t-1),Rainfall(t-2) | Runoff(t)=H[Runoff(t-1),Rainfall(t-1),Rainfall(t-2)] |

3 | Runoff(t-1),Runoff(t-2),Rainfall(t-1) | Runoff(t)=H[Runoff(t-1),Runoff(t-2),Rainfall(t-1)] |

4 | Runoff(t-1),Runoff(t-2),Rainfall(t-1),Rainfall(t-2) | Runoff(t)=H[Runoff(t-1),Runoff(t-2),Rainfall(t-1),Rainfall(t-2)] |

Model | Model Architecture | Training | Testing | ||||||
---|---|---|---|---|---|---|---|---|---|

R | NSE | RMSE (m^{3}·s^{−1}) | MAPE (%) | R | NSE | RMSE (m^{3}·s^{−1}) | MAPE (%) | ||

1 | 2-4-1 | 0.892 | 0.740 | 82.490 | 38.150 | 0.883 | 0.747 | 63.562 | 35.912 |

2 | 3-6-1 | 0.891 | 0.737 | 82.989 | 37.903 | 0.903 | 0.757 | 62.321 | 38.417 |

3 | 3-5-1 | 0.893 | 0.742 | 82.090 | 36.493 | 0.903 | 0.761 | 61.792 | 37.190 |

4 | 4-7-1 | 0.907 | 0.783 | 75.286 | 34.866 | 0.904 | 0.773 | 60.252 | 35.680 |

#### 5.4. Comparison of Different Methods

Method | Time(s) | Training | Testing | ||||||
---|---|---|---|---|---|---|---|---|---|

R | NSE | RMSE (m^{3}·s^{−1}) | MAPE (%) | R | NSE | RMSE (m^{3}·s^{−1}) | MAPE (%) | ||

ANN-QPSO | 10.1 | 0.943 | 0.888 | 54.074 | 18.102 | 0.953 | 0.908 | 38.354 | 25.401 |

ANN | 30.2 | 0.907 | 0.783 | 75.286 | 34.866 | 0.904 | 0.773 | 60.252 | 35.680 |

**Figure 5.**Convergence characteristic of the objective function of two methods for Hongjiadu reservoir (

**a**) ANN-QPSO; (

**b**) ANN.

^{3}·s

^{−1}and 1258.3 m

^{3}·s

^{−1}instead of the observed 1696.4 m

^{3}·s

^{−1}, corresponding to about 3.2% and 25.8% underestimation, respectively. Furthermore, the absolute averages of the relative error of the ANN-QPSO and ANN models for forecasting the 8 peak flow are 11.6% and 30.9%, respectively. In summary, the ANN-QPSO method performs better than ANN in term of peak flow estimation.

Period | Date | Observed Peak (m ^{3}·s^{−1}) | Forecasted Peak (m^{3}·s^{−1}) | Relative Error (%) | ||
---|---|---|---|---|---|---|

ANNP-QPSO | QPSO | ANNP-QPSO | QPSO | |||

Training | 2006-06-30 | 854.3 | 792.7 | 747.6 | −7.2 | −12.5 |

Training | 2007-07-30 | 1435.8 | 1234.2 | 1108.2 | −14.0 | −22.8 |

Training | 2008-06-22 | 1663.8 | 1514.5 | 861.5 | −9.0 | −48.2 |

Training | 2009-08-04 | 628.5 | 456.4 | 407.4 | −27.4 | −35.2 |

Training | 2010-07-11 | 1076.0 | 1053.8 | 806.7 | −2.1 | −25.0 |

Training | 2011-06-23 | 561.9 | 471.6 | 426.6 | −16.1 | −24.1 |

Training | 2012-07-26 | 1696.4 | 1641.8 | 1258.3 | −3.2 | −25.8 |

Testing | 2013-06-09 | 1343.0 | 1151.9 | 622.5 | −14.2 | −53.6 |

Average (absolute) | 11.6 | 30.9 |

^{3}·s

^{−1}during the training period while an obvious deviation exists between the original observed data and the forecasted data in ANN model. Hence, the ANN-QPSO model can mimic daily runoff better than that by ANN model.

**Figure 6.**Scatter plots of observed data vs. forecasted data during the training period. (

**a**) ANN-QPSO; (

**b**) ANN.

**Figure 7.**Scatter plots of observed data vs. forecasted data during the testing period. (

**a**) ANN-QPSO; (

**b**) ANN.

**Figure 9.**ANN, ANN-quantum-behaved particle swarm optimization (QPSO) forecasted data and observed runoff data during testing period.

## 6. Conclusions

## Acknowledgments

## Author Contributions

## Conflicts of Interest

## References

- Zhang, J.; Cheng, C.T.; Liao, S.L.; Wu, X.Y.; Shen, J.J. Daily reservoir inflow forecasting combining QPF into ANNs model. Hydro. Earth Syst. Sci.
**2009**, 6, 121–150. [Google Scholar] [CrossRef] - Wang, W.C.; Chau, K.W.; Xu, D.M.; Chen, X.Y. Improving forecasting accuracy of annual runoff time series using ARIMA based on EEMD decomposition. Water Resour. Manag.
**2015**, 29, 1–21. [Google Scholar] [CrossRef][Green Version] - Duan, Q.Y.; Sorooshian, S.; Gupta, V. Effective and efficient global optimization for conceptual rainfall-runoff models. Water Resour. Res.
**1992**, 28, 1015–1031. [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] - Kneis, D.; Bürger, G.; Bronstert, A. Evaluation of medium-range runoff forecasts for a 500 km
^{2}watershed. J. Hydrol.**2012**, 414, 341–353. [Google Scholar] [CrossRef] - Zhao, R.J. The Xinanjiang model applied in China. J. Hydrol.
**1992**, 135, 371–381. [Google Scholar] - Cheng, C.T.; Ou, C.P.; Chau, K.W. Combining a fuzzy optimal model with a genetic algorithm to solve multi-objective rainfall-runoff model calibration. J. Hydrol.
**2002**, 268, 72–86. [Google Scholar] [CrossRef] - Wang, W.C.; Chau, K.W.; Cheng, C.T.; Qiu, L. A comparison of performance of several artificial intelligence methods for forecasting monthly discharge time series. J. Hydrol.
**2009**, 374, 294–306. [Google Scholar] [CrossRef] - Lin, G.F.; Chen, G.R.; Huang, P.Y. Effective typhoon characteristics and their effects on hourly reservoir inflow forecasting. Adv. Water Resour.
**2010**, 33, 887–898. [Google Scholar] [CrossRef] - Hsu, K.; Gupta, H.V.; Sorroshian, S. Artificial neural network modeling of the rainfall-runoff process. Water Resour. Res.
**1995**, 31, 2517–2530. [Google Scholar] [CrossRef] - Machado, F.; Mine, M.; Kaviski, E.; Fill, H. Monthly rainfall-runoff modelling using artificial neural networks. Hydrol. Sci. J.
**2011**, 56, 349–361. [Google Scholar] [CrossRef] - Duan, Q.Y.; Sorooshian, S.; Gupta, V.K. Optimal use of the SCE-UA global optimization method for calibrating watershed models. J. Hydrol.
**1994**, 158, 265–284. [Google Scholar] [CrossRef] - Duan, Q.Y.; Gupta, V.K.; Sorooshian, S. Shuffled complex evolution approach for effective and efficient global minimization. J. Optim. Theory Appl.
**1993**, 76, 501–521. [Google Scholar] [CrossRef] - Lin, J.Y.; Cheng, C.T.; Chau, K.W. Using support vector machines for long-term discharge prediction. Hydrol. Sci. J.
**2006**, 51, 599–612. [Google Scholar] [CrossRef] - Lima, A.R.; Cannon, A.J.; Hsieh, W.W. Nonlinear regression in environmental sciences by support vector machines combined with evolutionary strategy. Comput. Geosci.
**2013**, 50, 136–144. [Google Scholar] [CrossRef] - Guo, W.J.; Wang, C.H.; Zeng, X.M.; Ma, T.F.; Yang, H. Subgrid parameterization of the soil moisture storage capacity for a distributed rainfall-runoff model. Water
**2015**, 7, 2691–2706. [Google Scholar] [CrossRef] - Kamruzzaman, M.; Shahriar, M.S.; Beecham, S. Assessment of short term rainfall and stream flows in South Australia. Water
**2014**, 6, 3528–3544. [Google Scholar] [CrossRef] - Chau, K.W.; Wu, C.L.; Li, Y.S. Comparison of several flood forecasting models in Yangtz River. J. Hydrol. Eng.
**2005**, 10, 485–491. [Google Scholar] [CrossRef] - Piotrowski, A.P.; Napiorkowski, J.J. Optimizing neural networks for river flow forecasting evolutionary computation methods versus the Levenberg-Marquardt approach. J. Hydrol.
**2011**, 407, 12–27. [Google Scholar] [CrossRef] - Chau, K.W. Particle swarm optimization training algorithm for ANNs in stage prediction of Shing Mun River. J. Hydrol.
**2006**, 329, 363–367. [Google Scholar] [CrossRef] - Asadnia, M.; Chua, L.H.C.; Qin, X.S.; Talei, A. Improved particle swarm optimization based artificial neural network for rainfall-runoff modeling. J. Hydrol. Eng.
**2014**, 19, 1320–1329. [Google Scholar] [CrossRef] - Liu, W.C.; Chung, C.E. Enhancing the predicting accuracy of the water stage using a physical-based model and an artificial neural network-genetic algorithm in a river system. Water
**2014**, 6, 1642–1661. [Google Scholar] [CrossRef] - Wu, C.L.; Chau, K.W. Rainfall-runoff modeling using artificial neural network coupled with singular spectrum analysis. J. Hydrol.
**2011**, 399, 394–409. [Google Scholar] [CrossRef] - Jeong, D.I.; Kim, Y.O. Combining single-value streamflow forecasts—A review and guidelines for selecting techniques. J. Hydrol.
**2009**, 377, 284–299. [Google Scholar] [CrossRef] - Sun, J.; Feng, B.; Xu, W.B. Particle swarm optimization with particles having quantum behavior. In Congress on Evolutionary Computation, 2004 (CEC2004), Proceedings of the 2004 Congress on Evolutionary Computation, Portland, OR, USA, 19–23 June 2004; pp. 325–331.
- Fang, W.; Sun, J.; Ding, Y.; Wu, X.; Xu, W. A review of quantum-behaved particle swarm optimization. IETE Tech. Rev.
**2010**, 27, 336–348. [Google Scholar] [CrossRef] - Xi, M.; Sun, J.; Xu, W. An improved quantum-behaved particle swarm optimization algorithm with weighted mean best position. Appl. Math. Comput.
**2008**, 205, 751–759. [Google Scholar] [CrossRef] - Feng, Z.K.; Liao, S.L.; Niu, W.J.; Shen, J.J.; Cheng, C.T.; Li, Z.H. Improved quantum-behaved particle swarm optimization and its application in optimal operation of hydropower stations. Adv. Water Sci.
**2015**, 26, 413–422. (in Chinese). [Google Scholar] - Sun, C.; Lu, S. Short-term combined economic emission hydrothermal scheduling using improved quantum-behaved particle swarm optimization. Expert Syst. Appl.
**2010**, 37, 4232–4241. [Google Scholar] [CrossRef] - Eberhart, R.; Kennedy, J. A new optimizer using particle swarm theory. In Proceedings of the 6th International Symposium on Micro Machine and Human Science, New York, NY, USA, 4–6 October 1995; pp. 39–43.
- Gaing, Z.L. Particle swarm optimization to solving the economic dispatch considering the generator constraints. IEEE Trans. Pow. Syst.
**2003**, 18, 1187–1195. [Google Scholar] [CrossRef] - Clerc, M.; Kennedy, J. The particle swarm-explosion, stability, and convergence in a multidimensional complex space. IEEE Trans. Evol. Comput.
**2002**, 6, 58–73. [Google Scholar] [CrossRef] - Ren, C.; An, N.; Wang, J.; Li, L.; Hu, B.; Shang, D. Optimal parameters selection for BP neural network based on particle swarm optimization: A case study of wind speed forecasting. Knowl. Based Syst.
**2014**, 56, 226–239. [Google Scholar] [CrossRef]

© 2015 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 license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Cheng, C.-t.; Niu, W.-j.; Feng, Z.-k.; Shen, J.-j.; Chau, K.-w.
Daily Reservoir Runoff Forecasting Method Using Artificial Neural Network Based on Quantum-behaved Particle Swarm Optimization. *Water* **2015**, *7*, 4232-4246.
https://doi.org/10.3390/w7084232

**AMA Style**

Cheng C-t, Niu W-j, Feng Z-k, Shen J-j, Chau K-w.
Daily Reservoir Runoff Forecasting Method Using Artificial Neural Network Based on Quantum-behaved Particle Swarm Optimization. *Water*. 2015; 7(8):4232-4246.
https://doi.org/10.3390/w7084232

**Chicago/Turabian Style**

Cheng, Chun-tian, Wen-jing Niu, Zhong-kai Feng, Jian-jian Shen, and Kwok-wing Chau.
2015. "Daily Reservoir Runoff Forecasting Method Using Artificial Neural Network Based on Quantum-behaved Particle Swarm Optimization" *Water* 7, no. 8: 4232-4246.
https://doi.org/10.3390/w7084232