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

Authors: Abazar Solgi; Vahid Nourani; Amir Pourhaghi
Journal: Advances in Civil Engineering
 (2014)

---

## Abstract

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 short- and long-term precipitations.


---

## Body

## 1. 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 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 (R2), Root Mean Square Error (RMSE) concluded that the hybrid model of wavelet-neural 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 SARIMAX1-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 neural-fuzzy 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.


## 2. Materials and Methods

### 2.1. Study Area

Verayneh Rain gauge station in the Nahavand city is in geographical position 48 degrees, 24 minutes, and 15 seconds East longitude and 34 degrees, 04 minutes, and 32 seconds North latitude. Figure1 shows Location of the Nahavand in Hamedan, Iran. The station was established in 1348 and has a height of 1795 meters above sea level; code stations are 21–534 with long-term average annual precipitation of 521 mm. Precipitation data is presented as average of 1.43, maximum of 96, minimum of 0, standard deviation of 5.31, and variance of 28.29.Figure 1
Location of the Nahavand in Hamedan and Iran.


### 2.2. 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. Figure2 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, x(t), is defined as follows:
(1)T(a,b)=1a∫-∞+∞g*(t-ba)x(t)dt,
where g* corresponds to the complex conjugate and g(t) is called wavelet function or mother wavelet. The parameter a acts as a dilation factor, while b corresponds to a temporal translation of the function g(t), which allows for the study of the signal around b [17].Figure 2
Comparison of Fourier and wavelet transforms.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 ofa and locally around the time of b. The result is a wavelet coefficient (T(a,b)) 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]:
(2)∫-∞+∞g(t)dt=0,Cg=∫-∞+∞|g^(ω)|2|ω|dω<∞,
where g^(ω) is Fourier transform of g(t); 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
(3)∫-∞+∞rkg(t)dt=0,wherek=1,2,…,n-1.
So the original signal may be reconstructed using the inverse wavelet transform as follows:
(4)x(t)=1Cg∫-∞+∞∫0∞1ag(t-ba)T(a,b)da·dba2.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 N2 coefficients from a data set of length N; 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 thea scale discretization with correspondingly coarser resolution of the b locations, which allows for N transform coefficients to completely describe a signal of length N. Such a discrete wavelet has the form [15]
(5)gm·n(t)=1a0mg(t-nb0a0ma0m),
where m and n are integers that control the wavelet dilation and translation, respectively, a0 is a specified fined dilation step greater than 1, and b0 is the location parameter and must be greater than zero. The most common and simplest choices for parameters are a0=2 and b0=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]
(6)gm,n=2-m/2g(2-mi-n).
Discrete dyadic wavelets of this form are commonly chosen to be orthonormal; that is, [15]
(7)∫-∞+∞gm,n(t)gm′,n′(t)dt=δm,m′δn,n′,
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, xi, the dyadic wavelet transform becomes
(8)Tm,n=2-m/2∑i=0N-1g(2-mi-n)xi,
where Tm,n is wavelet coefficient for the discrete wavelet of scale a=2m and location b=2mn.Equation (9) considers a finite time series xi,   i=0,1,2,…,N-1; N is an integer power of 2:  N=2M. This gives the ranges of m and n as, respectively, 0<n<2M-m-1 and 1<m<M. At the largest wavelet scale (i.e., 2m, where m=M) only one wavelet is required to cover the time interval, and only one coefficient is produced. At the next scale (2m-1), two wavelets cover the time interval; hence, two coefficients are produced and so on down to m=1. At m=1, the a scale is 21; that is, 2M-1 or N/2 coefficients are required to describe the signal at this scale. The total number of wavelet coefficients for a discrete-time series of length N=2M is then 1+2+4+8+⋯+2M-1=N-1. In addition to this, a signal smoothed component T- is left, which is the signal mean. Thus, a time series of length N is broken into N components, that is, with zero redundancy. The inverse discrete transform is given by [15]
(9)xi=T-+∑m=1M∑n=02M-n-1Tm,n2-m/2g(2-mi-n)
or in a simple format as [15]
(10)xi=T-(t)+∑m=1MWm(t),
where T-(t) is called approximation subsignal at level M and Wm(t) are details subsignals, at levels m=1,2,…,M.The wavelet coefficients,Wm(t) (m=1,2,…,M), provide the details signals, which can capture small features of interpretational value in the data; the residual term, T-(t), represents the background information of data.Because of simplicity ofW1(t),W2(t),…,WM(t),T-(t), some interesting characteristics, such as period, hidden period, dependence, and jump, can be diagnosed easily through wavelet components [8].


#### 2.2.1. 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:
(11)y=0.5+(0.5×(x-x-xmax⁡-xmin⁡)).
In this equation, x is the data,  x- is the average data, xmax⁡ is the maximum data, xmin⁡ is the minimal data, and y 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. Two-thirds of the data are as training data, and the remaining one-third are as the test data (test) network model systems by adaptive fuzzy introduced.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]
(12)CE=1-∑(pobs-pPre)2∑(pobs-p-)2,RMSE=∑(pobs-ppre)2n,R2=1-∑i=1N(pobs-pPre)2∑i=1N(pPre-p-)2,
where pobs is the observed precipitation rate, ppre is the simulated flow rate, and p 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 (Npar) which was also utilized as [11]
(13)AIC=m×ln⁡⁡(RMSE)+2(Npar),
where m is number of inputs and smaller value of AIC indicates a better model.The following formula determines the maximum decomposition level [17]:
(14)L=int⁡[log⁡⁡(N)],
where L and N are decomposition level (i and j) and number of time series data, respectively. For the study at hand N=15705, so L=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.(a) Harr wavlet, (b) db2 wavlet, and (c) sym3 wavelet.
(a)
(b)
(c)Figure4 shows schematic structures of WANN model.Figure 4
Schematic presentation of WANN model.


### 2.3. 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 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. Figure 5(a) shows the fuzzy reasoning mechanism for the Sugeno model to derive an output function f from a given input vector [x,y]. The corresponding equivalent ANFIS construction is shown in Figure 5(b). According to this figure, it is assumed that the FIS has two inputs x and y and one output f. For the first-order Sugeno fuzzy model, atypical rule set with two fuzzy if-then rules can be expressed as [25]rule (1): ifμ(x) is A1 and μ(y) is B1, then f1=P1x+q1y+r1;rule (2): ifμ(x) is A2 and μ(y) is B2, then f2=P2x+q2y+r2,where A1, A2 and B1, B2 are the MFs for inputs x and y, respectively; P1, q1, and r1 and P2, q2, and r2 are the parameters of the output function. The functioning of the ANFIS is as follows.(a) Sugeno’s fuzzy if-then rule and fuzzy reasoning mechanism and (b) equivalent ANFIS structure.
(a)
(b)Layer 1. Each node in this layer produces membership grades of an input variable. The output of ith node inlayer k is denoted by Qik. Assuming a generalized bell function (gbellmf) as the membership function (MF), the output Qi1 can be computed as [26]
(15)Qi1=μAi(x)=11+((x-ci)/ai)2bi,
where {ai, bi, ci}a are adaptable variable s known as premise parameters.Layer 2. Every node in this layer multiplies the incoming signals. Consider
(16)Qi2=wi=μAi(x)·μAi(x)i=1,2.Layer 3. The ith node of this layer calculates the normalized firing strengths as
(17)Qi3=w-ı=wiw1+w2i=1,2.Layer 4. Node i in this layer calculates the contribution of the ith rule towards the model output, with the following node function [26]:
(18)Qi4=w-ı(pix+qiy+ri)=w-ıfi,
where w- is the output of layer 3 and {P1,q1,r1} is the parameter set.Layer 5. The single node in this layer calculates the overall output of the ANFIS as [26]
(19)Qi5=∑iw-ıfi=∑iwifi∑iwi.
The learning algorithm for ANFIS is a hybrid algorithm, which is a combination of the gradient descent and least-squares method [25]. The parameters for optimization are the premise parameters {ai,bi,ci} and the consequent parameters {P1,q1,r1}. 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].


## 2.1. Study Area

Verayneh Rain gauge station in the Nahavand city is in geographical position 48 degrees, 24 minutes, and 15 seconds East longitude and 34 degrees, 04 minutes, and 32 seconds North latitude. Figure1 shows Location of the Nahavand in Hamedan, Iran. The station was established in 1348 and has a height of 1795 meters above sea level; code stations are 21–534 with long-term average annual precipitation of 521 mm. Precipitation data is presented as average of 1.43, maximum of 96, minimum of 0, standard deviation of 5.31, and variance of 28.29.Figure 1
Location of the Nahavand in Hamedan and Iran.


## 2.2. 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. Figure2 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, x(t), is defined as follows:
(1)T(a,b)=1a∫-∞+∞g*(t-ba)x(t)dt,
where g* corresponds to the complex conjugate and g(t) is called wavelet function or mother wavelet. The parameter a acts as a dilation factor, while b corresponds to a temporal translation of the function g(t), which allows for the study of the signal around b [17].Figure 2
Comparison of Fourier and wavelet transforms.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 ofa and locally around the time of b. The result is a wavelet coefficient (T(a,b)) 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]:
(2)∫-∞+∞g(t)dt=0,Cg=∫-∞+∞|g^(ω)|2|ω|dω<∞,
where g^(ω) is Fourier transform of g(t); 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
(3)∫-∞+∞rkg(t)dt=0,wherek=1,2,…,n-1.
So the original signal may be reconstructed using the inverse wavelet transform as follows:
(4)x(t)=1Cg∫-∞+∞∫0∞1ag(t-ba)T(a,b)da·dba2.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 N2 coefficients from a data set of length N; 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 thea scale discretization with correspondingly coarser resolution of the b locations, which allows for N transform coefficients to completely describe a signal of length N. Such a discrete wavelet has the form [15]
(5)gm·n(t)=1a0mg(t-nb0a0ma0m),
where m and n are integers that control the wavelet dilation and translation, respectively, a0 is a specified fined dilation step greater than 1, and b0 is the location parameter and must be greater than zero. The most common and simplest choices for parameters are a0=2 and b0=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]
(6)gm,n=2-m/2g(2-mi-n).
Discrete dyadic wavelets of this form are commonly chosen to be orthonormal; that is, [15]
(7)∫-∞+∞gm,n(t)gm′,n′(t)dt=δm,m′δn,n′,
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, xi, the dyadic wavelet transform becomes
(8)Tm,n=2-m/2∑i=0N-1g(2-mi-n)xi,
where Tm,n is wavelet coefficient for the discrete wavelet of scale a=2m and location b=2mn.Equation (9) considers a finite time series xi,   i=0,1,2,…,N-1; N is an integer power of 2:  N=2M. This gives the ranges of m and n as, respectively, 0<n<2M-m-1 and 1<m<M. At the largest wavelet scale (i.e., 2m, where m=M) only one wavelet is required to cover the time interval, and only one coefficient is produced. At the next scale (2m-1), two wavelets cover the time interval; hence, two coefficients are produced and so on down to m=1. At m=1, the a scale is 21; that is, 2M-1 or N/2 coefficients are required to describe the signal at this scale. The total number of wavelet coefficients for a discrete-time series of length N=2M is then 1+2+4+8+⋯+2M-1=N-1. In addition to this, a signal smoothed component T- is left, which is the signal mean. Thus, a time series of length N is broken into N components, that is, with zero redundancy. The inverse discrete transform is given by [15]
(9)xi=T-+∑m=1M∑n=02M-n-1Tm,n2-m/2g(2-mi-n)
or in a simple format as [15]
(10)xi=T-(t)+∑m=1MWm(t),
where T-(t) is called approximation subsignal at level M and Wm(t) are details subsignals, at levels m=1,2,…,M.The wavelet coefficients,Wm(t) (m=1,2,…,M), provide the details signals, which can capture small features of interpretational value in the data; the residual term, T-(t), represents the background information of data.Because of simplicity ofW1(t),W2(t),…,WM(t),T-(t), some interesting characteristics, such as period, hidden period, dependence, and jump, can be diagnosed easily through wavelet components [8].


### 2.2.1. 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:
(11)y=0.5+(0.5×(x-x-xmax⁡-xmin⁡)).
In this equation, x is the data,  x- is the average data, xmax⁡ is the maximum data, xmin⁡ is the minimal data, and y 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. Two-thirds of the data are as training data, and the remaining one-third are as the test data (test) network model systems by adaptive fuzzy introduced.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]
(12)CE=1-∑(pobs-pPre)2∑(pobs-p-)2,RMSE=∑(pobs-ppre)2n,R2=1-∑i=1N(pobs-pPre)2∑i=1N(pPre-p-)2,
where pobs is the observed precipitation rate, ppre is the simulated flow rate, and p 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 (Npar) which was also utilized as [11]
(13)AIC=m×ln⁡⁡(RMSE)+2(Npar),
where m is number of inputs and smaller value of AIC indicates a better model.The following formula determines the maximum decomposition level [17]:
(14)L=int⁡[log⁡⁡(N)],
where L and N are decomposition level (i and j) and number of time series data, respectively. For the study at hand N=15705, so L=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.(a) Harr wavlet, (b) db2 wavlet, and (c) sym3 wavelet.
(a)
(b)
(c)Figure4 shows schematic structures of WANN model.Figure 4
Schematic presentation of WANN model.


## 2.2.1. 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:
(11)y=0.5+(0.5×(x-x-xmax⁡-xmin⁡)).
In this equation, x is the data,  x- is the average data, xmax⁡ is the maximum data, xmin⁡ is the minimal data, and y 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. Two-thirds of the data are as training data, and the remaining one-third are as the test data (test) network model systems by adaptive fuzzy introduced.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]
(12)CE=1-∑(pobs-pPre)2∑(pobs-p-)2,RMSE=∑(pobs-ppre)2n,R2=1-∑i=1N(pobs-pPre)2∑i=1N(pPre-p-)2,
where pobs is the observed precipitation rate, ppre is the simulated flow rate, and p 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 (Npar) which was also utilized as [11]
(13)AIC=m×ln⁡⁡(RMSE)+2(Npar),
where m is number of inputs and smaller value of AIC indicates a better model.The following formula determines the maximum decomposition level [17]:
(14)L=int⁡[log⁡⁡(N)],
where L and N are decomposition level (i and j) and number of time series data, respectively. For the study at hand N=15705, so L=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.(a) Harr wavlet, (b) db2 wavlet, and (c) sym3 wavelet.
(a)
(b)
(c)Figure4 shows schematic structures of WANN model.Figure 4
Schematic presentation of WANN model.


## 2.3. 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 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. Figure 5(a) shows the fuzzy reasoning mechanism for the Sugeno model to derive an output function f from a given input vector [x,y]. The corresponding equivalent ANFIS construction is shown in Figure 5(b). According to this figure, it is assumed that the FIS has two inputs x and y and one output f. For the first-order Sugeno fuzzy model, atypical rule set with two fuzzy if-then rules can be expressed as [25]rule (1): ifμ(x) is A1 and μ(y) is B1, then f1=P1x+q1y+r1;rule (2): ifμ(x) is A2 and μ(y) is B2, then f2=P2x+q2y+r2,where A1, A2 and B1, B2 are the MFs for inputs x and y, respectively; P1, q1, and r1 and P2, q2, and r2 are the parameters of the output function. The functioning of the ANFIS is as follows.(a) Sugeno’s fuzzy if-then rule and fuzzy reasoning mechanism and (b) equivalent ANFIS structure.
(a)
(b)Layer 1. Each node in this layer produces membership grades of an input variable. The output of ith node inlayer k is denoted by Qik. Assuming a generalized bell function (gbellmf) as the membership function (MF), the output Qi1 can be computed as [26]
(15)Qi1=μAi(x)=11+((x-ci)/ai)2bi,
where {ai, bi, ci}a are adaptable variable s known as premise parameters.Layer 2. Every node in this layer multiplies the incoming signals. Consider
(16)Qi2=wi=μAi(x)·μAi(x)i=1,2.Layer 3. The ith node of this layer calculates the normalized firing strengths as
(17)Qi3=w-ı=wiw1+w2i=1,2.Layer 4. Node i in this layer calculates the contribution of the ith rule towards the model output, with the following node function [26]:
(18)Qi4=w-ı(pix+qiy+ri)=w-ıfi,
where w- is the output of layer 3 and {P1,q1,r1} is the parameter set.Layer 5. The single node in this layer calculates the overall output of the ANFIS as [26]
(19)Qi5=∑iw-ıfi=∑iwifi∑iwi.
The learning algorithm for ANFIS is a hybrid algorithm, which is a combination of the gradient descent and least-squares method [25]. The parameters for optimization are the premise parameters {ai,bi,ci} and the consequent parameters {P1,q1,r1}. 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].


## 3. Results and Discussion

The different models were examined. Thus, using different wavelets, subseries at different levels were studied for different mother’s wavelet. Tables1 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 wavelet-neural network.Table 1
Details and structures of WANN model.
Structure
Model
Learning rule
Transfer function
Momentum
Maximum epochs
Runs
Processing elements
Hidden layers
D1
MLP
momentum
Tan Axon
0.7
1000
3
50
1
D2
MLP
momentum
Tan Axon
0.7
1000
3
50
1
D3
MLP
momentum
Tan Axon
0.8
1000
3
50
1
D4
MLP
momentum
Tan Axon
0.6
1000
3
50
1
D5
MLP
momentum
Tan Axon
0.7
1000
3
50
1
D6
MLP
momentum
Tan Axon
0.7
1000
3
50
1
D7
MLP
momentum
Tan Axon
0.8
1000
3
50
1
D8
MLP
momentum
Tan Axon
0.7
1000
3
50
1
D9
MLP
momentum
Tan Axon
0.7
1000
3
50
1
D10
MLP
momentum
Tan Axon
0.9
1000
3
50
1
D11
MLP
momentum
Tan Axon
0.7
1000
3
50
1
D12
MLP
momentum
Tan Axon
0.7
1000
3
50
1
D13
MLP
momentum
Tan Axon
0.7
1000
3
50
1
D14
MLP
momentum
Tan Axon
0.6
1000
3
50
1
D15
MLP
momentum
Tan Axon
0.7
1000
3
50
1
D16
MLP
momentum
Tan Axon
0.7
1000
3
50
1
D17
MLP
momentum
Tan Axon
0.7
1000
3
50
1
D18
MLP
momentum
Tan Axon
0.7
1000
3
50
1Table 2
Results and structures of WANN model.
Structure
Mother wavelet
Levels
MAE
MSE
R
D1
Haar
2
0.0037
0.00003
0.8863
D2
Haar
3
0.0034
0.00026
0.9392
D3
Haar
4
0.0034
0.00036
0.9321
D4
Haar
5
0.0031
0.00002
0.9502
D5
Haar
6
0.0035
0.00067
0.9001
D6
Haar
7
0.0032
0.00032
0.9404
D7
Db4
2
0.0032
0.00022
0.9482
D8
Db4
3
0.0033
0.00026
0.9343
D9
Db4
4
0.0035
0.00029
0.9016
D10
Db4
5
0.0033
0.00031
0.9333
D11
Db4
6
0.0036
0.00037
0.8915
D12
Db4
7
0.0031
0.00049
0.9413
D13
Sym3
2
0.0039
0.00041
0.8704
D14
Sym3
3
0.0043
0.00045
0.8516
D15
Sym3
4
0.0039
0.00036
0.8711
D16
Sym3
5
0.0035
0.0003
0.8993
D17
Sym3
6
0.0035
0.0004
0.9031
D18
Sym3
7
0.0036
0.00034
0.8918According to Table2, 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 (d1) 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.Table 3
Evaluation of model performance (structure D4).
Performance
P
MSE
0.0002
NMSE
0.032
MAE
0.003
Min Abs Error
0.001
Max Abs Error
0.037
r
0.950Table 4
Sensitivity analysis of structure D4.
Sensitivity
P
A
0.0157
d
1
0.0917
d
2
0.0546
d
3
0.0263
d
4
0.0232
d
5
0.0114Figure 6
Computed and observed precipitation time series (structure D4).Figure 7
Output precipitation against observational precipitation.Figure 8
Sensitivity analysis of structure D4.Figure 9
Precipitation time series.Figure 10
Approximation and details subsignals of precipitation time series by Haar wavelet (level 5).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 Table6. 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.Table 5
Results and structures of ANFIS model.
Model
Structure
Membership function
EPOCH
RMSE
Test error
R
1
D19
Trimf
20
0.0271
0.0264
0.6464
D20
Trapmf
20
0.0271
0.0265
0.6326
D21
Gbellmf
50
0.0268
0.0256
0.7835
D22
Gaussmf
40
0.0269
0.0257
0.7757
D23
Gauss2mf
40
0.0289
0.0265
0.6265
D24
Pimf
40
0.0269
0.0257
0.7757
D25
Dsigmf
40
0.0270
0.0259
0.7559
D26
Psigmf
40
0.0270
0.0259
0.7559
2
D27
Trimf
20
0.0271
0.0263
0.6563
D28
Trapmf
20
0.0272
0.0264
0.6453
D29
Gbellmf
30
0.0269
0.0256
0.7806
D30
Gaussmf
30
0.0269
0.0256
0.7826
D31
Gauss2mf
40
0.0269
0.0257
0.7757
D32
Pimf
40
0.0269
0.0256
0.7786
D33
Dsigmf
40
0.0270
0.0256
0.7786
D34
Psigmf
30
0.0270
0.0259
0.7759Table 6
Computed precipitation of ANFIS and WANN models.
Model
Validation step
Calibration step
RMSE
R
2
CE
AIC
RMSE
R
2
CE
AIC
WANN
0.021
0.903
0.743
18.22
0.028
0.774
0.525
20.17
ANFIS
0.027
0.613
0.562
19.84
0.033
0.599
0.632
20.62Figure 11
Actual fluctuations precipitation against the residuals.WANN model was compared with ANFIS model by parameters which are available in Table6. 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.


## 4. 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 Figures12 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 12
Computed and observed precipitation time series (structure D4).Figure 13
Computed and observed precipitation time series (structure D21).



---

*Source: 279368-2014-07-03.xml*