Forecasting Daily Precipitation Using Hybrid Model of Wavelet-Artificial Neural Network and Comparison with Adaptive Neurofuzzy Inference System (Case Study: Verayneh Station, Nahavand)

Doubtlessly the first step in a river management is the precipitation modeling over the related watershed. However, considering high-stochastic property of the process, many models are still being developed in order to define such a complex phenomenon in the field of hydrologic engineering. Recently artificial neural network (ANN) as a nonlinear interextrapolator is extensively used by hydrologists for precipitation modeling as well as other fields of hydrology. In the present study, wavelet analysis combined with artificial neural network and finally was compared with adaptive neurofuzzy system to predict the precipitation in Verayneh station, Nahavand, Hamedan, Iran. For this purpose, the original time series using wavelet theory decomposed to multiple subtime series. Then, these subseries were applied as input data for artificial neural network, to predict daily precipitation, and compared with results of adaptive neurofuzzy system.The results showed that the combination of wavelet models and neural networks has a better performance than adaptive neurofuzzy system, and can be applied to predict both shortand long-term precipitations.


Introduction
Estimation and forecasting of precipitation and its runoff have played effective and critical role in the watershed management and proper utilization of watershed, dams, and reservoirs and finally minimizing the damage caused by floods and drought.Therefore, this subject is the hydrologist's interest.Predicting any event forms the basis of crisis management, and when this goal can be achieved, the predicting model could be accessed.Several methods are used for predicting hydrological events such as precipitation.Using each of these methods is always with some error in results.Accurate prediction of hydrological signals such as precipitation can provide useful information to predict amount of precipitation for water resources and soil management in a basin.In addition, correct prediction of hydrological signals plays an important role in reducing the effects of drought on water resources systems.
Hydrological systems are affected by many factors such as climate, land cover, soil infiltration rates, evapotranspiration which is dependent on stochastic components, multitemporal scales, and above-mentioned nonlinear characteristics.
Despite nonlinear relationships, uncertainty, and high lack of precision and variables temporal and spatial characteristics in water circulation system, none of the statistical and conceptual models which are proposed for accurate precipitation and runoff modeling were able to become a superior and capable model.
Today, nonlinear networks are widely used as one intelligent system in predicting such a complex phenomenon.One of the methods that have been considered in recent years in the field of hydrology is the application of wavelet 2 Advances in Civil Engineering transform as new and effective method in signals and time series analysis.
Monthly modeling and predicting of river flow D4 structure was used with application of wavelet neural network method and monthly flow data from two stations (Gerdelli Station on Canakdere River and Isakoy Station on Goksudere River) in the Eastern Black Sea, Turkey.The neurowavelet model improved by two methods: combining discrete wavelet transform and multilayer perceptron (MLP) to predict monthly flow, compared with multilayer perceptron models of multilinear regression (MLR) and autocorrelated model (AR).The comparison of the results revealed that the suggested model could increase the forecast accuracy and perform better than MLP, MLR, and AR models [1].Improvement in the performance of artificial neural networks (ANN) to predict seasonal time series was reviewed.So several structures of proposed artificial neural network are presented to predict seasonal time series.The model for four full time series was tested.The results of proposed neural network had been compared with the results of current statistical models and other structures of neural network.This comparison showed that the proposed model of neural network has less prediction error than other methods [2].A combined neural-wavelet model is provided for prediction of Ligvan Chai (Tabriz, Iran) watershed precipitation.For this purpose, the original time series by wavelet transform converted into several subseries, which these converted series were used as an input to the Neural network for Monthly precipitation prediction.The results showed that the proposed model can predict both short-and long-term precipitation events because of using multiscale time series as the ANN input layer [3].The approach with surface water modeling and wavelet analysis is performed for understanding the base flow components of rivers discharge in Karst environments.This investigation examined the advantages of wavelet analysis in this regard [4].Approach improvement based on the precipitation-runoff modeling using a combination of artificial neural network-wavelet is performed, which shows the model that precipitation and discharge data entered as an input outperformed than the model just precipitation was entered as an input [5].Precipitation-runoff model using a combination of wavelet-neural network model is presented.According to the fitted coefficients ( 2 ), Root Mean Square Error (RMSE) concluded that the hybrid model of waveletneural network is more efficient than the neural network and regression [6].A method based on transform discrete wavelet and artificial neural networks to predict applied flow in seasonal river in semiarid watershed in Cyprus was presented.Wavelet coefficients as input Levenberg Marquardt (LM) artificial neural network models were used to predict the flow.The relative performance of the wavelet-neural network (WA-ANN) and artificial neural network (ANN) models was compared to lead times of 1 and 3 days flow forecasting for two different rivers.In both cases, neural network-wavelet model for flow predictions was more accurate than artificial neural network.The results indicate that wavelet-neural network models are a promising new method of short-term flow forecasting in nonperennial rivers in semiarid watersheds such as those found in Cyprus [7].Two combination methods of artificial intelligence for modeling precipitation-runoff for two watersheds in Azerbaijan, Iran, are presented.Two hybrid AI-based models which are reliable in capturing the periodicity features of the process are introduced for watershed precipitation-runoff modeling.In the first model, the SARIMAX 1 -ANA (seasonal autoregressive integrated moving average with exogenous input) model is used and and in the second model the wavelet-ANFIS model is used.The results showed that the proposed models can predict both short-and long-term runoff discharges, considering seasonality effects, but the second model is relatively more appropriate because it used the multiscale time series of precipitation and runoff data in the ANFIS input layer [8].A new combination of neural networks for modeling precipitation-runoff in the basin Aq Chay, Iran, is presented.The model was combined with data processing methods, genetic algorithms, and Levenberg Marquardt algorithm for training the neural network input.Results showed that this method has more accurately predicted runoff from artificial neural networks and adaptive neuralfuzzy inference system [9].Feature extraction method based on the self-organizing map and the combined wavelet-neural network method was combined and presented for modeling the precipitation-runoff. Two-stage procedure to model the precipitation-runoff process of the Delaney Creek and Payne Creek Basins, Florida, USA, was presented.The two-stage procedure includes data preprocessing and model building.The results proved that the proposed model leads to better outcome especially in terms of determination coefficient for detecting peak points (DC peak) [10].For modeling daily precipitation-runoff in the Eel River Basin, California, at several stations, the artificial intelligence (AI) techniques have been used.In this way, different ANFIS structures were trained, using Sugeno algorithm in order to estimate daily discharge values at different stations.In order to improve the model efficiency, the input data were then classified into some clusters by the means of fuzzy C-means (FCMs) method.The goodness-of-fit measures support the gainful use of the IGANFIS and FCM methods in spatiotemporal modeling of hydrological processes [11].
Because predicting the amount and timing of precipitation can be an important aid to managers, planners, and farmers in conjunction with the planning and optimal use of water resources, different methods are used to predict precipitation.One of these methods that has recently received considerable attention is the use of wavelet theory.Due to widespread use of artificial neural networks and wavelet transform in various disciplines, especially science related to water, and according to rarely use of wavelet transform in Iran, forecast precipitation with a hybrid model of neural network-wavelet and adaptive fuzzy wavelet neural network model is examined in this research.

Wavelet Transform.
The wavelet transform has increased in usage and popularity in recent years since its inception in the early 1980s, yet still does not enjoy the wide spread usage of the Fourier transform.Fourier analysis has a serious drawback.In transforming to the frequency domain, time information is lost.When looking at a Fourier transform of a signal, it is impossible to tell when a particular event took place but wavelet analysis allows the use of long time intervals where we want more precise low-frequency information and shorter regions where we want high-frequency information.Figure 2 compares Fourier transform and wavelet transform [3].In the field of earth sciences, Grossmann and Morlet [12], who worked especially on geophysical seismic signals, introduced the wavelet transform application.A comprehensive literature survey of wavelet in geosciences can be found in Fofola-Georgiou and Kumar [13] and the most recent contributions are cited by Labat [14].As there are many good books and articles introducing the wavelet transform, this paper will not delve into the theory behind wavelets and only the main concepts of the transform are briefly presented; recommended literature for the wavelet novice includes Mallat [15] or Labat et al. [16].The time-scale wavelet transform of a continuous time signal, (), is defined as follows: where  * corresponds to the complex conjugate and () is called wavelet function or mother wavelet.The parameter  acts as a dilation factor, while  corresponds to a temporal translation of the function (), which allows for the study of the signal around  [17].
The main property of wavelet transform is to provide a time-scale localization of processes, which derives from the compact support of its basic function.This is opposed to the classical trigonometric function of Fourier analysis.The wavelet transform searches for correlations between the signal and wavelet function.This calculation is done at different scales of  and locally around the time of .The result is a wavelet coefficient ((, )) contour map known as a scalogram.In order to be classified as a wavelet, a function must have finite energy, and it must satisfy the following "admissibility conditions" [15]: where ĝ() is Fourier transform of (); that is, the wavelet must have no zero frequency component.In order to obtain a reconstruction formula for the studied signal, it is necessary to add "regularity conditions" to the previous ones.Consider So the original signal may be reconstructed using the inverse wavelet transform as follows: For practical applications, the hydrologist does not have at his or her disposal a continuous-time signal process but rather a discrete-time signal.A discretization of (2) based on the trapezoidal rule maybe is the simplest discretization of the continuous wavelet transform.This transform produces 2 coefficients from a data set of length ; hence redundant information is locked up within the coefficients, which may or may not be a desirable property [17].
To overcome the mentioned redundancy, logarithmic uniform spacing can be used for the  scale discretization with correspondingly coarser resolution of the  locations, which allows for  transform coefficients to completely describe a signal of length .Such a discrete wavelet has the form [15] where  and  are integers that control the wavelet dilation and translation, respectively,  0 is a specified fined dilation step greater than 1, and  0 is the location parameter and must be greater than zero.The most common and simplest choices for parameters are  0 = 2 and  0 = 1.This power-of-two logarithmic scaling of the translation and dilation is known as the dyadic grid arrangement.The dyadic wavelet can be written in more compact notation as [15] Discrete dyadic wavelets of this form are commonly chosen to be orthonormal; that is, [15] where  is Kronecker delta.This allows for the complete regeneration of the original signal as an expansion of a linear combination of translates and dilates of orthonormal wavelets.For a discrete-time series,   , the dyadic wavelet transform becomes where  , is wavelet coefficient for the discrete wavelet of scale  = 2  and location  = 2  .Equation ( 9) considers a finite time series   ,  = 0, 1, 2, . . .,  − 1;  is an integer power of 2:  = 2  .This gives the ranges of  and  as, respectively, 0 <  < 2 − − 1 and 1 <  < .At the largest wavelet scale (i.e., 2  , where  = ) only one wavelet is required to cover the time interval, and only one coefficient is produced.At the next scale (2 −1 ), two wavelets cover the time interval; hence, two coefficients are produced and so on down to  = 1.At  = 1, the  scale is 2 1 ; that is, 2 −1 or /2 coefficients are required to describe the signal at this scale.The total number of wavelet coefficients for a discrete-time series of length  = 2  is then In addition to this, a signal smoothed component  is left, which is the signal mean.Thus, a time series of length  is broken into  components, that is, with zero redundancy.The inverse discrete transform is given by [15] or in a simple format as [15]   =  () where () is called approximation subsignal at level  and   () are details subsignals, at levels  = 1, 2, . . ., .
The wavelet coefficients,   () ( = 1, 2, . . ., ), provide the details signals, which can capture small features of interpretational value in the data; the residual term, (), represents the background information of data.

Hybrid Wavelet-Artificial Neural Network (WANN)
Model.In this study, daily precipitation in a 43-year period of Verayneh Station in the city of Nahavand is used, to check the homogeneity of the data Vasaj Station as an auxiliary stations and the double mass curve used, which shows the homogeneity of data.Then the data were analyzed using wavelet transform.Thus, using MATLAB program and considering different levels and mother wavelet coded in MATLAB, wavelet transform got on the input parameter.For the data set considered in the present study, the input variables as well as the target variables are first normalized linearly in the range of 0 and 1.This range is selected because of the use of the logistic function (which is bounded between 0.0 and 1.0) as the activation function for the output layer [18], that is, (11).The normalization is done using the following equation: The coefficient of efficiency (CE) was used to compare the goodness of fit between the measured flow and the simulated flow.CE which is also known as the Nash-Sutcliffe coefficient is defined as [19] where  obs is the observed precipitation rate,  pre is the simulated flow rate, and  is the average value of the observed flow rate [3,8].RMSE was used to measure prediction accuracy which produces a positive value by squaring the errors.The RMSE increases from zero for perfect predictions through large positive values as the discrepancies between predictions and observations become increasingly large.Obviously, high value for CE (up to one) and small value for RMSE indicate high efficiency of the model.Although Legates and McCabe (1999) indicated that a hydrological model can be sufficiently evaluated by DC and RMSE, the Akaike Information Criterion (AIC), which is based on the parsimony, penalizes the RMSE with the number of trained parameters (par) which was also utilized as [11] AIC =  × ln (RMSE) + 2 (par) , where  is number of inputs and smaller value of AIC indicates a better model.The following formula determines the maximum decomposition level [17]: where  and  are decomposition level ( and ) and number of time series data, respectively.For the study at hand  = 15705, so  = 4.In this study it was tried to investigate the effects of the used mother wavelet type as well as decomposition level on the model efficiency.Hence, time series were decomposed to two, three, four, five, six, and seven levels by four different kinds of wavelet transforms, that is, 1-Haar wavelet, a simple wavelet, 4-Daubechies wavelet (db4), a most popular wavelet, and 3-sym3 wavelet.These wavelets are shown in Figure 3.
Figure 4 shows schematic structures of WANN model.

Adaptive Neurofuzzy Inference System (ANFIS).
Of course the leading theory in quantifying uncertainty in scientific models from the late nineteenth century until the late twentieth century had been the probability theory.However, the gradual evolution of the expression of uncertainty using probability theory was challenged first in 1937 by Max Black with his studies in vagueness and then with the introduction of fuzzy sets by Zadeh 1965.Zadeh's paper had a profound influence on thinking about uncertainty because it challenged not only probability theory as the sole representation for uncertainty but also the very foundations upon which probability theory was based: classical binary (two-valued) logic [20].Each fuzzy system contains three main parts: fuzzifier, fuzzy data base, and defuzzifier.Fuzzy data base contains two main parts: fuzzy rule base and inference engine.In fuzzy rule base, rules related to fuzzy propositions are described [21].Thereafter, analysis operation is applied by fuzzy inference engine.There are several fuzzy inference engines which can be employed for this goal, with Sugeno and Mamdani being the two of well-known ones [22].Neurofuzzy simulation refers to the algorithm of applying different learning techniques produced in the neural network literature to fuzzy modeling or a fuzzy inference system (FIS) [23].This is done by fuzzification of the input through membership functions (MFs), where a curved relationship maps the input value within the interval of [01].The parameters associated with input as well as output membership functions are trained using a technique like backpropagation and/or least squares.Therefore, unlike the multilayer perceptron (MLP), where weights are tuned, in ANFIS, fuzzy language rules or conditional (if-then) statements are determined in order to Consequent part train the model [24].The ANFIS is a universal approximator and as such is capable of approximating any real continuous function on a compact set to any degree of accuracy.The ANFIS is functionally equivalent to fuzzy inference systems [21].Specifically the ANFIS system of interest here is functionally equivalent to the Sugeno first-order fuzzy model [21].The general construction of the ANFIS is presented in Figure 5.According to this figure, it is assumed that the FIS has two inputs  and  and one output .For the first-order Sugeno fuzzy model, atypical rule set with two fuzzy if-then rules can be expressed as [25] rule (1 where  1 , where {  ,   ,   } are adaptable variable  known as premise parameters.
Layer 2. Every node in this layer multiplies the incoming signals.Consider Layer 3. The th node of this layer calculates the normalized firing strengths as Layer 4. Node  in this layer calculates the contribution of the th rule towards the model output, with the following node function [26]: where  is the output of layer 3 and { 1 ,  1 ,  1 } is the parameter set.
Layer 5.The single node in this layer calculates the overall output of the ANFIS as [26]  The learning algorithm for ANFIS is a hybrid algorithm, which is a combination of the gradient descent and leastsquares method [25].The parameters for optimization are   the premise parameters {  ,   ,   } and the consequent parameters { 1 ,  1 ,  1 }.In the forward pass of the hybrid learning approach, node outputs go forward until layer (4) and the consequent parameters are identified by the least-squares technique.In the backward pass, the error signals propagate backward and the premise parameters are updated by gradient descent.More information for ANFIS can be found in related literatures [21,26].ANFIS uses system of learning algorithms, neural network and fuzzy logic in order to design a nonlinear mapping between the input and output.Also due to capability in combining of linguistic power fuzzy systems with a numerical strength of a neural network, the modeling of processes such as hydrology reservoir management and estimating suspended sediment load is very powerful [27,28].Adaptive neurofuzzy is based on changes in the amount and range of functions belonging to different iterations to achieve the appropriate network based on the minimum error functions.Takagi Sugeno inference method is used in the ANFIS model.The number and type of inputs and the membership functions shape are affected by neurofuzzy model [21].

Results and Discussion
The different models were examined.Thus, using different wavelets, subseries at different levels were studied for different mother's wavelet.Tables 1 and 2 show the results.To do this, the momentum learning rule and Tan Axon transfer function with 1000 epoch and three runs of network in different hidden layers are used.In Table 2, the mother wavelet is shown using various levels for each structure in a hybrid model of waveletneural network.According to Table 2, the best model is wavelet-neural network with D4 structure with level 5 and the wavelet mother Haar. Figure 6 shows computed precipitation time series and observed precipitation.In Figure 7, precipitation output against observational precipitation was showed.In Table 3, evaluation of D4 structure performance has been examined.Sensitivity analysis showed that the subseries 1 (1) has highest sensitivity for predicting precipitation than the other subseries (Figure 8).Table 4 shows Sensitivity analysis of structure D4. Figure 9 showed precipitation time series and Figure 10 showed wavelet analysis.
Different structures in adaptive neurofuzzy inference system, comparing with different membership functions and epochs, were examined.To find the best model, parameters were determined in accordance with Table 6.And the best model was the D21 structure.Membership function of Psigmf and epochs 20 is selected.The results of this study are presented in Table 5. Figure 11 shows the residual values against the observed precipitation data.The results are consistent with observed changes in precipitation and residual values are very high.
WANN model was compared with ANFIS model by parameters which are available in Table 6.Based on this comparison WANN model has less error than ANFIS model (i.e., 0.021), correlation coefficient is higher than ANFIS (i.e., 0.95), Nash-Sutcliffe coefficient is higher than ANFIS (i.e., 0.743), and AIC coefficient is smaller than ANFIS (i.e., 18.22).Thus, WANN model is belter.

Conclusions
In this study, the wavelet transform, which can capture the multiscale features of signals, was used to decompose the Verayneh precipitation time series.Then the subsignals were used as input to the ANN model to predict the precipitation.Furthermore, the effect of wavelet transform type on the model performance was investigated using three different kinds of wavelet transforms.The model results show the high merit of Haar wavelet in comparison with the others (i.e., db4 and Sym3).As a final result, it was deduced that although increasing of decomposition level can progress the model ability an optimum level can be chosen on the basis of the signal length.As the reviews of the structures in this study were collected, it can be concluded that the accuracy of the hybrid model of wavelet-neural network is higher than the accuracy of the adaptive fuzzy neural network model.Also Figures 12 and 13 are confirmed above-mentioned.Results showed that the proposed model can predict precipitation in both short and long terms, because of the use of multiscale time series as entering data to neural network.The obtained results show that the proposed model can predict both short-and long-term precipitation events because of using multiscale time series as the ANN input layer.

Figure 2 :
Figure 2: Comparison of Fourier and wavelet transforms.

Figure 5 (
a) shows the fuzzy reasoning mechanism for the Sugeno model to derive an output function  from a given input vector [, ].The corresponding equivalent ANFIS construction is shown in Figure 5(b).

Figure 10 :
Figure 10: Approximation and details subsignals of precipitation time series by Haar wavelet (level 5).
In this equation,  is the data,  is the average data,  max is the maximum data,  min is the minimal data, and  data is normalized.Then, 70% of data as training data, 15% as cross validation data, and 15% as test data were considered.Using artificial neural network and building different models that in each model the type of input is different and by comparing different training methods such as Multilayers Perceptron, GFF, and so forth.Best Education Act, number of neurons and hidden layers and the number of run, number of iterations of each epoch was determined.Then the best model using genetic algorithm and neural network was optimized to obtain the best estimates.Adaptive neurofuzzy system is investigated for two models.In model one, the previous day's precipitation data and tomorrow precipitation were used to predict rain tomorrow.And, on the second model, day precipitation data were used to predict rain tomorrow.Twothirds of the data are as training data, and the remaining onethird are as the test data (test) network model systems by adaptive fuzzy introduced.
2 and  1 ,  2 are the MFs for inputs  and , respectively;  1 ,  1 , and  1 and  2 ,  2 , and  2 are the parameters of the output function.The functioning of the ANFIS is as follows.
[26]r 1.Each node in this layer produces membership grades of an input variable.The output of th node inlayer  is denoted by    .Assuming a generalized bell function (gbellmf) as the membership function (MF), the output   1 can be computed as[26]

Table 1 :
Details and structures of WANN model.

Table 2 :
Results and structures of WANN model.

Table 4 :
Sensitivity analysis of structure D4.

Table 5 :
Results and structures of ANFIS model.
P Figure 8: Sensitivity analysis of structure D4.

Table 6 :
Computed precipitation of ANFIS and WANN models.