1 Introduction

Forecasts of future streamflows are required for many activities associated with the planning and operation of components in a water resource system. Both short-and long-term forecasts of streamflow events are needed for hydrologic components in order to optimize the system or to plan for future expansion or reduction (Kisi 2008).

Streamflow forecasting has a significant role in the mitigation of the impacts of deficit/surplus on water resources systems (Wood 1980). Most techniques currently used to model hydrologic time series assume linear relationships among the variables. These techniques are generally based on the classical Box & Jenkins methodology to model the time series and forecast (Box et al. 1994). The auto-regressive moving average (ARMA) model has been commonly used in water resources, especially for monthly streamflow forecasting (Maier and Dandy 2000).

Regression and ARMA models are standard forecasting models for time series analysis. One source of complexity in forecasting streamflow is the non-stationary nature of inflow series (Grino 1992). While most of the existing models can be classified as linear models with limited non-stationary modeling abilities streamflow pattern is highly nonlinear and non-stationary (Hsu et al. 1995). Despite the inadequacies of ARMA, streamflow forecasting has been commonly modeled using ARMA models during the past several decades (Salem and Dorrah 1982; Karunanithi et al. 1994).

The application of artificial intelligence (AI) has received much attention in different fields of water resources engineering (Coulibaly et al. 2000, 2001; Kumar et al. 2002; Kisi 2006, 2007; Guven 2009; Guven and Talu 2010; Goyal and Ojha 2011). In the last decade, the use of ANFIS models has attracted much attention due to their many advantages. One of the advantages of fuzzy rule-based models (i.e., ANFIS) for the purpose of modeling, is that it may include all of the causes which are not included in idealized models whereas it may exclude some of the causes which are taken into account in physically-based models (Hundecha et al. 2001).

Kisi (2005) used neuro-fuzzy and neural network techniques for the estimation of suspended sediment. Kisi (2006) applied the ANFIS approach for daily pan evaporation estimation. Ozger and Yildirim (2009) determined the turbulent flow friction coefficient in pipe lines using an ANFIS-GP model. Shiri and Kisi (2010) applied a wavelet and neuro-fuzzy conjunction model for short- and long-term streamflow forecasting.

Cobaner (2011) used two different ANFIS models for the estimation of evapotranspiration and found that the ANFIS-SC model yields plausible accuracy with fewer amounts of computations as compared to the ANFIS-GP and neural network models. El-shafie et al. (2007) applied a neuro-fuzzy model for inflow forecasting of the Nile River. Chu and Chang (2009) used ANFIS-GP for obtaining optimal solutions for time-varying groundwater remediation design. Güldal and Tongal (2010) compared the ANFIS-GP, recurrent neural network (RNN), auto-regressive (AR) and auto-regressive moving average (ARMA) models and found that the RNN and ANFIS can be applied successfully and provide high accuracy and reliability for lake-level changes than the AR and the ARMA models. Talei et al. (2010) used the ANFIS-GP technique in rainfall-runoff modeling. Talebizadeh and Moridnejad (2011) investigated the uncertainty of neural networks (NNs) and ANFIS-GP approaches for lake level fluctuation forecasting. Firat and Gungor (2007) used an ANFIS-GP model for river flow estimation and reported that it could be applied successfully and provided high accuracy and reliability for river flow estimation. Kisi et al. (2012) compared the ANFIS-GP, ANNs, support vector machine (SVM), local linear regression (LLR) and the dynamic local linear regression (DLLR) models for forecasting daily intermittent streamflows and found that the ANN and ANFIS performed better than the others. In the hydrological forecasting context, only a very limited number of studies have been conducted by using the ANFIS-SC approach. To the best knowledge of the authors, no study has been previously carried out on the use of the ANFIS-SC approach for monthly streamflow forecasting.

The present study describes the utilization of the input-output mapping capabilities of two different ANFIS techniques in monthly streamflow prediction. The ANFIS techniques are also used to estimate the monthly flows of the Garzan Stream using the data of the Bitlis Stream.

2 Adaptive Neuro-Fuzzy Inference System (ANFIS)

Jang (1993) presented a learning procedure for the fuzzy inference system (FIS) that uses a NN learning algorithm for constructing a set of fuzzy if-then rules with appropriate membership functions (MFs) from specified input-output pairs. A basic structure of ANFIS is illustrated in Fig. 1.

Fig. 1
figure 1

Basic structure of the ANFIS (see Kisi et al. 2009)

ANFIS is a network structure consisting of a number of nodes connected through directional links. Each node is characterized by a node function including fixed or adjustable parameters. The training phase of an NN is a process to determine parameter values to sufficiently fit the training data. The basic learning rule is the well-known back-propagation method which seeks to minimize some measure of error between the network’s outputs and desired outputs (Drake 2000).

Depending on the types of inference operations upon the ‘if-then rules’, most FISs can be classified into three types: Mamdani’s system (Mamdani and Assilian 1975), Sugeno’s system (Takagi and Sugeno 1985) and Tsukamoto’s system (Tsukamoto 1979). Mamdani’s system is the most commonly used; however, Sugeno’s system is more compact and computationally efficient. The output of the Sugeno’s system is crisp and it has a mathematically intractable defuzzification operation. It is by far the most popular candidate for sample-data based fuzzy modeling and it lends itself to the use of adaptive techniques (Takagi and Sugeno 1985).

To build up a fuzzy system, firstly, the linguistic variables should be provided in addition to the numerical variables. Then, the system requires If/Then fuzzy rules to qualify simple relationships between the fuzzy variables. A typical rule set with two fuzzy If/ Then rules in a first-order Sugeno system, can be shown as

$$ {\text{Rule}}\;{1}:{\text{If}}\;{\text{x}}\;{\text{is}}\;{\text{A1}}\;{\text{and}}\;{\text{y}}\;{\text{is}}\;{\text{B1}},\;{\text{then}}\;{{\text{f}}_1} = {{\text{p}}_1}{\text{x}} + {{\text{q}}_1}{\text{y}} + {{\text{r}}_1} $$
(1)
$$ {\text{Rule}}\;{2}:{\text{If}}\;{\text{x}}\;{\text{is}}\;{\text{A2}}\;{\text{and}}\;{\text{y}}\;{\text{is}}\;{\text{B2}},\;{\text{then}}\;{{\text{f}}_2} = {{\text{p}}_2}{\text{x}} + {{\text{q}}_2}{\text{y}} + {{\text{r}}_2} $$
(2)

where x and y refer to input and output variables, respectively. The A and B terms denote the linguistic terms of the precondition part with MF. The if part of the rule ‘x is A’ is called the premise, while the then part of the rule ‘y is B’ is called the consequent. The p, q, r indicates the consequent parameters (Sayed et al. 2003). A detailed description of ANFIS can be found in Jang (1993).

2.1 Grid Partitioning

By combining ANFIS and grid partition, the ANFIS Grid Partition (ANFIS-GP) model was obtained. Grid partition divides the input space into rectangular subspaces using a number of local fuzzy regions by axis-paralleled partition based on a predefined number of MFs and their types in each dimension. Figure 2 shows a schematic description of this model. For calculating fuzzy sets and parameters, the least square method according to the partition and MF type is used. During the construction of the fuzzy rules consequent parameters in the linear output MF are set to zero. Therefore, by using ANFIS, parameters are identified and refined. GP and its combination with ANFIS are illustrated in detail by Abonyi et al. (1999) and Kennedy et al. (2003). By increasing the number of input variables, the number of fuzzy rules is exponentially increased. For instance, if there are n input variables and m MFs for each input variable for the problem, the total number of fuzzy rules equals mn (Wei et al. 2007). To apply grid partition, the number of input variables must be small and less than 6 (http://www.cs.nthu.edu.tw/~jang/an.sfaq.htm). In the current study, streamflows were forecasted by using five input variables and therefore applying an ANFIS-GP model in this paper is reasonable.

Fig. 2
figure 2

Grid partition of an input domain with two input variables and two MFs for each input variable (see Wei et al. 2007)

2.2 Subtractive Clustering

By combining ANFIS and subtractive clustering, ANFIS subtractive clustering (ANFIS-SC) model was obtained. This model is an extension of the mountain clustering method proposed by Yager and Filev (1994) in which each data point (not a grid point) is considered as a potential cluster center (Chiu 1994). Using this method, the number of effective “grid points” to be evaluated equals the number of data points, independent of the dimension of the problem. Another advantage of this method is that it eliminates the need to specify a grid resolution, in which tradeoffs between accuracy and computational complexity must be considered. The subtractive clustering method also extends the criterion of the mountain method for accepting and rejecting cluster centers.

The subtractive clustering method works as follows:

Consider a collection of n data points {x 1,x 2,…,x n } in an M dimensional space, without loss of generality and assume that the data points have been normalized in each dimension so that they are bounded by a unit hypercube. Each data point is considered as a potential cluster center and a measure of the potential of data point xi is defined as

$$ {P_i} = \sum\limits_{j = 1}^n {{e^{ - \alpha {{\left\| {{X_i} - {X_j}} \right\|}^2}}}} $$
(3)

where \( \alpha = 4/r_a^2 \), \( {\left\| {{X_i} - {X_j}} \right\|^2} \)indicates the Euclidean distance, and r a is a positive constant. Therefore, the measure of the potential for a data point is a function of its distances to all other data points. A data point with many neighboring data points will have a high potential value. The constant r a is the radius defining a neighborhood; data points outside this radius have little influence on the potential. After the potential of every data point has been computed, the data point with the highest potential is selected as the first cluster center. If \( x_1^* \) is the location of the first cluster center and \( P_1^* \) is its potential value, the potential of each data point x i is represented by the following formula:

$$ {P_i} \Leftarrow {P_i} - P_1^*{e^{ - \beta {{\left\| {{X_i} - X_1^*} \right\|}^2}}} $$
(4)

where \( \beta = 4/r_b^2 \) and r b is a positive constant. Therefore, an amount of potential from each data point as a function of its distance from the first cluster center is subtracted. The data points near the first cluster center will have greatly reduced potential, and therefore will be unlikely to be selected as the next cluster center. The constant r b is effectively the radius defining the neighborhood which will have measurable reductions in potential. To avoid obtaining closely spaced cluster centers, r b is set somewhat greater than r a and a good value is r b equals to 1.25 r a .

When the potential of all data points has been revised according to Eq. 4, the data point with the highest remaining potential as the second cluster center is selected. Then further reduction in the potential of each data point according to its distance to the second cluster center is done. In general, after the k’th cluster center has been obtained, the potential of each data point is given by the formula:

$$ {P_i} \Leftarrow {P_i} - P_k^*{e^{ - \beta {{\left\| {{X_i} - X_k^*} \right\|}^2}}} $$
(5)

where \( {\text{x}}_{\text{k}}^* \) is the location of the k’th cluster center and \( {\text{P}}_{\text{k}}^* \) is its potential value.

The process of acquiring a new cluster center and revising potentials is repeated until the remaining potential of all data points falls below some fraction of the potential of the first cluster center \( {\text{P}}_1^* \). Other criteria are available for accepting and rejecting cluster centers that help to avoid marginal cluster centers (Chiu 1997).

The influential radius is critical for determining the clusters’ number. Selecting a smaller radius results in too many smaller clusters in the data space and more rules are required and vice versa. Therefore, it is important to select the proper influential radius for clustering the data space. The number of fuzzy rules and premises of a fuzzy MF is then determined. Finally, the linear least squares estimate is used to determine the consequent in the output MF, resulting in a valid FIS. Subtractive clustering and ANFIS have been used in different fields of engineering (Chang and Chang 2001; Wei et al. 2007; Samhouri et al. 2009; Cobaner 2011).

3 Case Studies

The monthly flow data from the Besiri Station (No: 2603) on the Garzan Stream and the Baykan Station (No: 2610) on the Bitlis Stream, in the Firat-Dicle Basin of Turkey were used in this study. The location of the stations is shown in Fig. 3. The drainage areas at these sites are 2,450 km2 and 636 km2 for the Besiri and Baykan stations, respectively. For these stations, the data were obtained from the report of the Turkish General Directorate of Electrical Power Resources Survey and Development Administration. The observed data cover 30 years (360 months) long with an observation period between 1965 and 1994 for both stations.

Fig. 3
figure 3

The Agi (2603) and Agi (2610) stations on rivers Garzan and Bitlis

Two different program codes, including fuzzy toolbox were written in MATLAB language for the grid partition and subtractive clustering simulations. The ANFIS models were written in two parts: the first part trains the network and the second part produces an output (a prediction) for a given input pattern. In the application, the first 23 years (276 months, 76% of whole data set) were used for training and the remaining 7 years (84 months, 24% of whole data set) were used for testing. The monthly flow statistics are presented in Table 1 for each station. The observed monthly flows show high positive skewness (Csx = 2.02 and 2.08). The auto-correlations for both stations are quite low showing low persistence.

Table 1 The monthly statistical parameters of data set for Besiri and Baykan stations (Xmean, Xmax, X min, Sx, Csx, r1, r2, r3 denote the overall mean, standard deviation, skewness, lag-1, lag-2, lag-3 auto-correlation coficients, respectively)

4 Application and Results

4.1 Comparison of ANFIS Models in 1-Month Ahead Streamflow Prediction

In this study, three input combinations based on preceding monthly flows were evaluated. The effect of periodicity was investigated by adding a component α which takes values between 1 and 12 according to the month of the year to be forecast into each combination. Let us assume that Qt represents the discharge at time t, the input combinations evaluated in the study are: (i) Qt-1, (ii) Qt-1, and α, (iii) Qt-1, Qt-2, (iv) Qt-1, Qt-2, and α, (v) Qt-1, Qt-2, Qt-3, (vi) Qt-1, Qt-2, Qt-3 and α. Here α indicates the periodicity component.

For each input combination, two different ANFIS models were trained. Root mean squared errors (RMSE), mean absolute errors (MAE) and determination coefficient (R2) statistics were used as evaluation criteria. The R2 shows the degree to which two variables are linearly related. RMSE and MAE provide different types of information about the predictive accuracies of the model. The RMSE shows the goodness of fit relevant to high values whereas the MAE measures a more balanced perspective of goodness of fit at moderate values (Karunanithi et al. 1994). The RMSE and MAE are expressed as follows:

$$ RMSE = \sqrt {{\frac{1}{N}\sum\nolimits_{i = 1}^N {{{\left( {Q{i_{observed}} - Q{i_{predicted}}} \right)}^2}} }} $$
(6)
$$ MAE = \frac{1}{N}\sum\nolimits_{i = 1}^N {\left| {Q{i_{observed}} - Q{i_{predicted}}} \right|} $$
(7)

where N is the number of data, Qi observed is the observed discharge values and Qi predicted is the model’s estimated discharge values.

The final architectures of the ANFIS models were determined by an extensive trial and error process for each input combination. In order to generate fuzzy rules using ANFIS-SC, it is critical to determine the proper cluster radius (radii). The cluster radius shows the range of influence of a cluster when you assume the data space as a unit hypercube. Radius values vary between 0 and 1. Generally, specifying a small cluster radius will yield many small clusters in the data, (with many rules) and specifying a large cluster radius will produce a few large clusters in the data, (with fewer rules). Samhouri et al. (2009) reported that the good values for radii are usually between 0.2 and 0.5.

In this study, the RMSE criterion was used for determining the optimum radius values for each input combination. The ANFIS models were then tested and the results were compared by means of RMSE, MAE and R 2 statistics. The RMSE, MAE and R 2 statistics of each ANFIS model in the test period for the stations Besiri and Baykan are given in Tables 2 and 3.

Table 2 The RMSE, MAE and R 2 statistics of ANFIS-GP models in test period
Table 3 The RMSE, MAE and R2 statistics of ANFIS-SC models in test period

According to Tables 2 and 3 both ANFIS-GP and ANFIS-SC models comprising inputs Qt-1, Qt-2, α have the best performance. To see the effect of periodicity in monthly flow forecasting, one more input (α) was added into combinations (i), (iii), (v). It can be clearly seen from the Tables 2 and 3 that the periodicity considerably decreased the number of errors in each model. The performance of ANFIS-SC seems to be slightly better than the ANFIS-GP model.

For extreme flows, i.e. where minimum and maximum values are important for certain water resources problems such as dam spillway and sluiceway operations, a detailed analysis of the model’s prediction performances was undertaken. The ANFIS-GP, ANFIS-GP-periodic, ANFIS-SC and ANFIS-SC-periodic models are compared in peak flow estimation for the Besiri Station (in case of input combination i and ii) and Baykan Station (in case of input combinations v and vi) in Tables 4 and 6. It can be seen from the tables that the peak forecasts of ANFIS-GP-periodic and ANFIS-SC-periodic models are mostly better than those of the ANFIS-GP and ANFIS-SC models for both stations. The comparison of model forecasts of low flows is presented in Tables 5 and 7. The ANFIS-GP-periodic and ANFIS-SC-periodic models show much better performance than the ANFIS-GP and ANFIS-SC models in low flow prediction. The variation in observed and predicted flows by ANFIS-GP, ANFIS-GP-periodic, ANFIS-SC and ANFIS-GP-periodic models is shown in Figs. 4, 5, 6 and 7. It can be seen from these figures that the ANFIS-GP-periodic and ANFIS-SC-periodic forecasts are closer to the corresponding observed values than those of the ANFIS-GP and ANFIS-SC especially for the peak and low flows (Tables 6 and 7).

Table 4 The comparison of ANFIS-GP, ANFIS-GP-periodic, ANFIS-SC and ANFIS-SC-periodic in estimation of hydrograph peaks in test period—Besiri Station
Table 5 The comparison of ANFIS-GP, ANFIS-GP-periodic, ANFIS-SC and ANFIS-SC-periodic in estimation of low flows in test period—Besiri Station
Fig. 4
figure 4

The observed and forecasted monthly river flows by ANFIS-GP—Besiri Station

Fig. 5
figure 5

The observed and forecasted monthly river flows by ANFIS-SC—Besiri Station

Fig. 6
figure 6

The observed and forecasted monthly river flows by ANFIS-GP—Baykan Station

Fig. 7
figure 7

The observed and forecasted monthly river flows by ANFIS-SC—Baykan Station

Table 6 The comparison of ANFIS-GP, ANFIS-GP-periodic, ANFIS-SC and ANFIS-SC-periodic in estimation of hydrograph peaks in test period—Baykan Station
Table 7 The comparison of ANFIS-GP, ANFIS-GP-periodic, ANFIS-SC and ANFIS-SC-periodic in estimation of low flows in test period—Baykan Station

4.2 Streamflow Estimation Using Nearby River Data

Streamflow data estimation using a nearby river is an important subject since flow data are often missing for many rivers. In this case the flow data from nearby rivers may be used to estimate the missing flows. This part of the study focused on the investigation accuracy of different ANFIS techniques in cross-station application. The dependent variables are the flows of the Besiri and Baykan stations that have drainage basins with similar hydrological characteristics. The data of the Besiri Station were used to estimate the monthly flows of the Baykan Station. In this application, also, the first 276 monthly flow data were used for training and the remaining 84 months were used for testing. Cross-correlation between the two stations was equal to 0.944. Different input combinations were used for both ANFIS models. The RMSE, MAE and R 2 statistics of the different ANFIS models in monthly flow estimation are given in Tables 8 and 9. According to these tables, the best performance for both ANFIS models was obtained for input combination (v) comprising monthly flows at times t, t-1 and t-2. The performance of the ANFIS-SC model is slightly better than the ANFIS-GP for all the input combinations. These results confirm the results of Cobaner (2011) that ANFIS-GP and ANFIS-SC models can be used for the estimation of evapotranspiration. In this part of the study, triangular MFs showed better accuracy than Gaussian MFs for the ANFIS-GP models (see Tables 8 and 9). The hydrographs and scatterplots of the observed and estimated flows using ANFIS-GP and ANFIS-SC models are shown in Fig. 8. As can be seen from the figure, the fit lines of both the ANFIS models are very close to the exact (45°) line with high R 2 values equal to 0.967 and 0.970 for ANFIS-GP and ANFIS-SC, respectively. The scatterplots confirm the statistics given in Tables 8 and 9. In overall, both ANFIS models seem to be adequate for estimating river flows by using nearby station data.

Table 8 The RMSE, MAE and R 2 statistics of ANFIS-GP model for river flow estimation by nearby station in test period
Table 9 The RMSE, MAE and R 2 statistics of ANFIS-SC model for river flow estimation by nearby station in test period
Fig. 8
figure 8

Observed and estimated river flows by two different ANFIS models in test period

5 Conclusions

In the current study, monthly streamflows were estimated by using two different adaptive neuro-fuzzy approaches. In the first part of the study, several input combinations including monthly streamflows from previous months were used as inputs to the ANFIS models to estimate current streamflow for two stations in Turkey. For both stations, it was found that the ANFIS-GP model whose inputs were one and two previous streamflows were more accurate than the other models. For the ANFIS-SC model, using inputs including one, two and three previous streamflows showed the optimal results. Adding the periodicity component to input combinations significantly increased the models’ performances. The comparison results revealed that the ANFIS-SC model performed better than the ANFIS-GP model in streamflow forecasting. For the Baykan Station, the ANFIS-SC model reduced root mean square errors and mean absolute errors with respect to the ANFIS-GP model by 21.4% and 16.8% and increased the correlation by 6.2%, respectively. In the second part of the study, the accuracy of the ANFIS-GP model was compared with the ANFIS-SC model for prediction of the streamflows of the Besiri Station by using nearby streamflows (Baykan Station). For this purpose, different input combinations including current streamflow, one and two previous streamflows were used. For both ANFIS models, current streamflow, one and two previous streamflows gave a better performance than the other input combinations. By adding the periodicity component to the input combination, the performances of the models were decreased except for the models whose input was the current streamflow. Overall, the results indicated that the ANFIS-SC model provided slightly better estimates than the ANFIS-GP model.