Journal of Advanced Informatics in Water, Soil, and Structure

Journal of Advanced Informatics in Water, Soil, and Structure

Dynamic K-Nearest Neighbors (DKNN) Approach Optimized by PSO for Daily River Inflow Prediction

Document Type : Research Article

Authors
Faculty of Civil Engineering, Water, and Environmental Engineering, Shahid Beheshti University, Tehran, Iran
Abstract
Streamflow forecasting is one of the most important components of water resources management. Accurate long-term forecasts are essential for planning water supply and storage, while short-term predictions are crucial for anticipating extreme flows and supporting flood warning systems. Data-driven models, as relatively simple yet powerful approaches, are widely used for streamflow prediction. The K-Nearest Neighbors (KNN) method is an effective non-parametric learning approach that has been applied to solve various problems. In this study, a novel neighbor selection method called Dynamic K-Nearest Neighbors (DKNN) is introduced. Using an SVM model, optimal distance thresholds are determined, and neighbors located within this optimal range are selected for each prediction case. The performance of the proposed method was evaluated using two years of daily inflow data from the Gheshlagh Dam in western Iran. The results indicate that the proposed method improves prediction accuracy by reducing the overall error (RMSE) by 6%, with the improvement reaching 7.8% in predicting extreme events.
Keywords
Subjects

  1. Araghinejad, S. (2013). Data-driven modeling: using MATLAB® in water resources and environmental engineering (Vol. 67). Springer Science & Business Media.
  2. Araghinejad, S., Fayaz, N., & Hosseini-Moghari, S.M. (2018). Development of a hybrid data driven model for hydrological estimation. Water Resources Management, 32(11), 3737-3750.
  3. Domeniconi, C., Peng, J., & Gunopulos, D. (2002). Locally adaptive metric nearest-neighbor classification. IEEE Transactions on Pattern Analysis and Machine Intelligence, 24(9), 1281-1285.
  4. Galeati, G. (1990). A comparison of parametric and non-parametric methods for runoff forecasting. Hydrological Sciences Journal, 35(1), 79-94.
  5. Hadi, S.J., & Tombul, M. (2018). Monthly streamflow forecasting using continuous wavelet and multi-gene genetic programming combination. Journal of Hydrology, 561, 674-687.
  6. Huda, M.S., Alam, K.M.R., Mutsuddi, K., Rahman, M.K.S., & Rahman, C.M. (2004). A dynamic k-nearest neighbor algorithm for pattern analysis problem. In 3rd International Conference on Electrical & Computer Engineering.
  7. Karlsson, M., & Yakowitz, S. (1987). Nearest-neighbor methods for nonparametric rainfall-runoff forecasting. Water Resources Research, 23(7), 1300-1308.
  8. Laio, F., Porporato, A., Revelli, R., & Ridolfi, L. (2003). A comparison of nonlinear flood forecasting methods. Water Resources Research, 39(5).
  9. Shamseldin, A.Y., & O'Connor, K.M. (1996). A nearest neighbour linear perturbation model for river flow forecasting. Journal of Hydrology, 179(1-4), 353-375.
  10. Sivakumar, B., Jayawardena, A.W., & Fernando, T.M.K.G. (2002). River flow forecasting: use of phase-space reconstruction and artificial neural networks approaches. Journal of Hydrology, 265(1-4), 225-245.
  11. Souza Filho, F.A., & Lall, U. (2003). Seasonal to interannual ensemble streamflow forecasts for Ceara, Brazil: Applications of a multivariate, semiparametric algorithm. Water Resources Research, 39(11).
  12. Wu, J., Cai, Z., & Gao, Z. (2010). Dynamic K-Nearest-Neighbor with distance and attribute weighted for classification. In 2010 International Conference on Electronics and Information Engineering (Vol. 1, pp. V1-356). IEEE.
  13. Jain, M., Saihjpal, V., Singh, N., & Singh, S. B. (2022). An Overview of Variants and Advancements of PSO Algorithm. Applied Sciences, 12(17), 8392. https://doi.org/10.3390/app12178392
Volume 1, Issue 2 - Serial Number 2
September 2025
Pages 255-267

  • Receive Date 11 September 2025
  • Revise Date 28 September 2025
  • Accept Date 17 October 2025
  • First Publish Date 27 October 2025
  • Publish Date 27 October 2025