Scientia Iranica A (2017) 24(3), 993{999 Sharif University of Technology Scientia Iranica Transactions A: Civil Engineering www.scientiairanica.com Application of trend analysis and arti cial neural networks methods: The case of Sakarya River G. Ceribasia;, E. Doganb, U. Akkayac and U.E. Kocamazd a. Sakarya University, Technology Faculty, Department of Civil Engineering, Sakarya, Turkey. b. Sakarya University, Faculty of Engineering, Department of Civil Engineering, Sakarya, Turkey. c. Sakarya University, Science Institute, Department of Civil Engineering, Bolu, Turkey. d. Uludag University, Vocational School of Karacabey, Department of Computer Technology, Bursa, Turkey. Received 7 November 2015; received in revised form 1 February 2016; accepted 5 September 2016 KEYWORDS Abstract. Various arti cial intelligence techniques are used in order to make prospective Trend analysis; estimations with available data. The most common and applied method among these Arti cial neural arti cial intelligence techniques is Arti cial Neural Networks (ANN). On the other hand, networks; another method which is used in order to make prospective estimations with available Sakarya river; data is Trend Analysis. When the relation of these two methods is analyzed, Arti cial Rainfall; Neural Networks method can present the prospective estimation numerically, while there Stream ow; is no such a case in Trend Analysis. Trend Analysis method presents result of prospective Suspended load. estimation as a decrease or increase in data. Therefore, it is quite important to make acomparison between these methods which brings about prospective estimation with the available data, because these two methods are used in most of these studies. In this study, annual average stream ow and suspended load measured in Sakarya River along with average annual rainfall trend were analyzed with trend analysis method. Daily, weekly, and monthly average stream ows and suspended loads measured in Sakarya River and average daily, weekly, and monthly rainfall data of Sakarya were all analyzed by ANN Model. Results of trend analysis method and ANN model were compared. © 2017 Sharif University of Technology. All rights reserved. 1. Introduction fore, this study aims to make a prospective estimation of suspended load transported by the river. Due to recent climate changes, hydraulic structures are In recent years, Arti cial Neural Networks (ANN) being built in order to e ectively use water resources, have been used in various disciplines e ectively and which are in danger of being consumed totally. Some commonly since they can form an easy, fast and more important parameters are estimated properly in order accurate model with low error margin on the basis of to complete economic life of hydraulic structures in the nonlinear relations among parameters which in uence planned time schedule. The most important parameter cases [1]. is the amount of solid material carried by the river On the other hand, since hydrological sizes throughout the planned life of the structure [1]. There- (rainfall, stream ow, suspended load, etc.) have a randomly changing characteristic in time, special methods are required to analyze a continuous decrease *. Corresponding author. Tel.: +902642956510; or increase trend [2-6]. Basic assumptions, such as Fax: +902642956424 E-mail addresses: gceribasi@sakarya.edu.tr (G. Ceribasi); normality, linearity, and independence, about classical emrahd@sakarya.edu.tr (E. Dogan); ugurakkaya@ibu.edu.tr parametric tests are not practicalized yet in typical sur- (U. Akkaya); ugurkocamaz@gmail.com (U. Erkin Kocamaz) face water quality. Therefore, it is suitable to use non- 994 G. Ceribasi et al./Scientia Iranica, Transactions A: Civil Engineering 24 (2017) 993{999 parametric tests rather than parametric ones. These increasing or decreasing order. Spearman's Rho test non-parametric tests are: Mann-Kendall, Spearman's statistics (rs) was calculated according to the following Rho, and Mann-Kendall Rank-Correlations tests. The equation [3,14]: method which includes all these tests is Trend Analysis Pn 2 method [4-6]. rs = 1 6 i=1(Rxi i) : (1) It is quite important to make a comparison (n3 n) between these methods since both of them make Since rs distribution was close to normal for n > 30, prospective estimation with available data due to the normal distribution tables were used. So, test statistics fact that these two methods are being used in most (Z) of rs is as follows: of the studies that have been carried out in recent p years. Therefore, it is one of the most important Z = rs n 1: (2) issues to analyze whether these two methods contradict or correspond to each other. Therefore, this study It is concluded that if normal distribution correspond- aims to apply Trend Analysis Method and Arti cial ing to signi cance level, which is chosen as absolute Neural Networks Method to rainfall, stream ow, and value of Z, is smaller than Z =2, then null hypothesis is suspended load of Sakarya river and Sakarya city. accepted. In addition, there is no trend in time series observed if it is bigger. Consequently, there is a trend, and if Z value is positive, then there is an increase 2. Materials and methods trend; if it is negative, then there is a decrease trend. In order to apply Arti cial Neural Networks Method, 2.2.2. Mann-Kendall test this paper considered daily, weekly, and monthly av- Since the Mann-Kendall test is a non-parametric test, erage stream ows and suspended loads of Stream it is independent from random variable distribution. Flow Observation Station no. 1257 of Sakarya River With this test, the presence of a trend in a time series as well as daily, weekly, and monthly average rainfall is checked with null hypothesis \H : no trend" [15-20]. of State Meteorological Station no. 17069 of Sakarya 0In x ; x ; :::; x city [7,8]. In order to apply trend analysis method, 1 2 n time series to which the test will be applied, x , x pairs are divided into two groups. For annual average stream ow and suspended load of i ji < j, if P represents the number of pairs x < x and Stream Flow Observation Station no. 1257 of Sakarya i jnumber of pairs x > x , test statistics (S) is calculated city and annual average rainfall of State Meteorological i jby the following relation: station no. 17069 of Sakarya city were used. 2.1. Arti cial neural networks method S = P M: (3) MATLAB program was used while implementing Ar- Kendall correlation coecient is calculated as follows: ti cial Neural Networks Method. ANN method was applied as three years of training, one year of valida- S = : (4) tion, and one year of testing. Data of daily stream ow, [n(n 1)=2] suspended load and rainfall of 33 years in total (1979- For n  10: 2011) were used which constituted 65% training, 18% p validation, and 17% test, respectively. s = n(n 1)(2n+ 5)=18; (5) One of the issues deserving attention in ANN 8 studies is the determination of number and charac- <>(S 1)=s S > 0 teristics of input. Determination of suitable input Z = 0 S = 0 (6) can be e ective in problem-solving [9-13]. In this :>(S + 1)=s S < 0 study, various tests were made in order to determine correct input parameters. As a result of these tests, It is concluded that if normal distribution corre- ANN model composed of 4 inputs and 1 output was sponding to signi cance level, chosen as the absolute determined. value of Z, is smaller than Z =2, then null hypothesis In ANN model: Day no, Water year, Rainfall is accepted. Moreover, there is no trend in time series (mm), and Stream ow (m3/s), were used as inputs, observed if it is bigger; there is a trend and if Z value is and the suspended load values (ton/day) were used as positive, then there is an increase trend; if it is negative, output. then there is a decrease trend [4-6,21-24]. 2.2. Trend analysis method 2.2.3. Mann-Kendall rank correlation test 2.2.1. Spearman's Rho test This nonparametric test is used to determine whether This is a quick and simple test to determine if there an increase or decrease trend is present in the applied is a correlation between two observation series. Rxi, series in time. The test graphically expresses the results i.e. rank statistic, was determined by ordering data in and also determines starting point of the trend [3-5]. In G. Ceribasi et al./Scientia Iranica, Transactions A: Civil Engineering 24 (2017) 993{999 995 Figure 1. u(t) u0(t) graph of the annual ow of Sakarya River. the hydro-meteorology time series, starting from the When Trend Analysis results were analyzed, it left-hand side, the data xi are considered to be the was seen that there is a decrease trend in stream ow, larger ones in the data that comes before itself instead suspended load, and rainfall for both tests (Spearman's of the data. If this number is called ni, then xi data Rho and Mann-Kendall tests). values are replaced with them and a whole number Graphic results of Mann-Kendall Rank Correla- sample function is obtained. If ti represents sequential tion test of the stream ow and suspended load data of sums of these whole numbers, t, which is required by Sakarya River and rainfall data of Sakarya are given in the maXgnitude to test the method, becomes: Figures 1, 2 and 3.n According to Mann-Kendall rank correlation test, t = ni: (7) the starting years of a decrease trends are the year 1983 i=1 for stream ow, 1983 for suspended load, and 1985 for Mean E(t) follows: rainfall. Therefore, these results were obtained when n(n 1) accuracy of the results of trend analysis was analyzed. E(t) = ; (8) 4 3.2. Results of arti cial neural networks variance follows: method n(n 1)(2n+ 5) ANN model was applied as three years of training, var(t) = : (9) 72 one year of validation, and one year of testing. 65% and u(t) function follows: of the whole 33 years of data was for training, 18%p for validation, and 17% for testing. Daily testing[t E(t)]u(t) = : (10) performance, weekly testing performance, and monthly var(t) testing performance are given in In Figures 4, 5 and 6, Considering the assumption that there is no change respectively. over time expressed by the near-zero values of u(t), the When graphics of Figures 4-6 are analyzed, the bigger values of u(t), surprisingly, show that a change best test performance is the graph of test performance occurs. On the other hand, graphical intersection point of suspended load predicted by ANN with the aid of of u(t) and u0(t) shows the starting time of the trend. average daily data. But, in order to be certain of this, the decision can be made after analyzing validation 3. Results and discussion performances. On the other hand, results of daily, weekly, and monthly test scatter of real values and 3.1. Results of the trend analysis method predicted values are given in Figure 7. Results of Spearman's Rho and Mann-Kendall tests of R2 is close to the value of 1 as given in Figure 7, the stream ow, suspended load, and rainfall data of and so, we can discuss such a successful ANN. More- Sakarya River and Sakarya are given in Table 1. over, if an ANN model is trained with much data, Table 1. Results of Spearman's Rho and Mann-Kendall tests of the stream ow, suspended load, and rainfall data. The station Spearman's Rho test Spearman's Rho Mann-Kendall Mann-Kendall (rs) test (Z) test () test (Z) Stream ow (m3/s) -0,39 -2,18 -0,27 -2,15 Suspended load (tons/day) -0,50 -2,83 -0,36 -2,96 Rainfall (mm) -0,55 -3,15 -0,40 -3,29 996 G. Ceribasi et al./Scientia Iranica, Transactions A: Civil Engineering 24 (2017) 993{999 Figure 2. u(t) u0(t) graph of the annual suspended load of Sakarya River. Figure 3. u(t) u0(t) graph of the annual rainfall of Sakarya. a much more successful ANN model will be formed. Therefore, when the graphics in Figure 7 are observed, the value of daily test determination coecient is the closest to that of R2. The reason is that while 365 data are used in daily data, 52 data are used in weekly data and 12 data in annual data. Again, validation performance should be considered in order to make a Figure 4. Test performances of predicting suspended decision on daily data. load levels with ANNs using average daily data. Real average stream ow and real average rainfall values were used while calculating validation perfor- mances. When Figures 8 to 10 are analyzed, it is seen that the best test performance is the graphs of validation performance of suspended load predicted by ANN with the aid of average daily data. On the other hand, results of daily, weekly, and monthly test scatter of real and predicted values are given in Figure 11. When the graphics in Figure 11 are analyzed, Figure 5. Test performances of predicting suspended daily validation determination coecient value is the load levels with ANNs using average weekly data. closest to R2 value. Afterwards, graphics of validation performances of suspended load with ANN are analyzed by using average monthly values in Figures 8 to 10. Graph- ics of average daily, weekly, and monthly validation correlations of real and predicted values are presented in Figure 11. It is seen that the best validation performance is the validation performance of average daily data. Therefore, the best test performance is the Figure 6. Test performances of predicting suspended performance of average daily data. load levels with ANNs using average monthly data. According to these statistics, prospective (be- G. Ceribasi et al./Scientia Iranica, Transactions A: Civil Engineering 24 (2017) 993{999 997 Figure 7. Comparison between observed and daily (a), weekly (b), monthly (c) simulated sediment level with ANNs for test data. Figure 8. Validation performances of predicting suspended load levels with ANNs using average daily data. Figure 12. Forecasting suspended load levels with ANNs using daily data. 4. Conclusion The factors causing decrease for hydraulic parameters were analyzed. When the year 1972 is considered which is the time Gokcekaya Dam on Sakarya River began Figure 9. Validation performances of predicting storing water with storage volume of 910  106 m3, suspended load levels with ANNs using average weekly it is seen that the starting point of trends starts after data. this time. Therefore, since Gokcekaya Dam arranged stream ows respectively and kept suspended load in dead storage, it caused decrease both in stream ow and suspended load. Moreover, when starting and completion dates of Saryar Dam building in the region are considered and when the year 1956, which is the Figure 10. Validation performances of predicting completion date of Saryar Dam building, is regarded suspended load levels with ANNs using average monthly as the year it began to store water, Sariyar Dam can data. be seen as a factor in the decrease of stream ow and suspended load [4,25-28]. tween 2012-2023) suspended load prediction of ANN With respect to climate, considering that water method was done, trained with average daily rainfall, resources can be a ected by global warming, it is stream ow, and suspended load data (Figure 12). estimated that water resources in speci c regions of Sakarya River suspended load, which was pre- the world will run out and be insucient in 50 years. dicted by ANN model, has a decrease trend compared As a result of this in uence, it is estimated that the to every passing year. amount of water per people would be nearly 40% in Figure 11. Comparison between observed and daily (a), weekly (b), monthly (c) simulated sediment level with ANNs for validation data. 998 G. Ceribasi et al./Scientia Iranica, Transactions A: Civil Engineering 24 (2017) 993{999 Turkey, which is a high value. Since Turkey is in 7. State Hydraulic Works (DSI), Stream Flow and Sed- semi-arid climate zone, it is clear that climate change iment Station Data of West Black Sea Basin, East would surely be in uential. As it is understood from Black Sea Basin and Sakarya Basin (2010). these results, it is seen that results of Trend Analysis 8. State Meteorological Service (DMI), Rainfall Station correspond to the study that was carried out. Data of West Black Sea Basin, East Black Sea Basin On the other hand, according to the results of and Sakarya Basin (2013). test analyses obtained after daily, weekly, and monthly 9. Ocal, O., Determination of Rainfall - Runo - Sed- training analyses, it is seen that the best result is iment Transport Relationship in Watersheds by Us- obtained at daily test results. As a result of validation ing Arti cial Neural Network Algorithm, Institute of test analysis carried out in order to assure the accuracy Science, Department of Civil Engineering, Pamukkale of test analysis result, it was again observed that University, Denizli, Turkey (2007). daily validation test results present the best results. 10. Partal, T. Estimation of Turkish Precipitation Data Therefore, Arti cial Neural Networks, trained in this Using Arti cial Neural Networks and Wavelet Trans- way, would give more accurate results for the future formation Methods, Institute of Science, Department predictions to be carried out for Sakarya River sus- of Civil Engineering, Istanbul Technical University, pended load. As a result of ANN method applied in Istanbul, Turkey (2007). this way, it is observed in Figure 12 as well that the 11. Sahin, M., Rainfall-Runo Model Using an Arti cial suspended load predicted between 2012-2023 continues Neural Network Approach for Black Sea Catchments, by decreasing every year. In other words, based on Institute of Science, Department of Civil Engineering, Arti cial Neural Network method, it is observed that Istanbul Technical University, Istanbul, Turkey (2007). there is a decrease trend in suspended load transported 12. Oguz, V., Monitoring Suspended Sediment Transport by Sakarya River. of Korubasi-Arak Stream by Analytical Methods, Insti- Therefore, it is observed that trend analysis and tute of Science, Department of Soil Science, Graduate arti cial neural network methods applied to the sus- School of Natural and Applied Sciences, Ankara Uni- pended load data of Sakarya River correspond, which versity, Ankara, Turkey (2010). means that the results of both methods are similar in 13. Yildirim, E., Classi cation of Soil Properties Using the comparison. Absorptive Characteristics of Seismic Waves, Institute of Science, Department of Civil Engineering, Sakarya University, Sakarya, Turkey (2013). References 14. Buyukkaracigan, N. and Kahya, E. \The dependency 1. Kayaalp, N. \Determination of monthly suspended- analysis of annual peak ows of streams in Konya sediment load transported in dicle river with arti cial Basin", In: Proc. of the International Conference neural networks", XVII. Technical Congress and Ex- on Water Problems in the Mediterranean Countries, hibition of Turkey Construction Engineering, Istanbul, Ankara, Turkey (1997). Turkey (2004). 15. Mann, H.B. \Non-parametric tests against trend", The 2. Helsel, D.R. and Hirsch, R.M. \Statistical methods in Econometric Society, 3, pp. 245-259 (1945). water resources. Techniques of water-resources investi- 16. Kendall, M.G., Rank Correlation Methods, 4th Ed. gations of the united states geological survey", Book Charles Grin, London (1975). 4, Hydrologic Analysis and Interpretation, Chapter A3, 17. Van Belle, G. and Hughes, J.P. \Nonparametric tests Amsterdam (1992). for trend in water quality", Water Resources Research, 3. Gumus, V., Evaluation of Firat River Basin Stream- 1, pp. 127-136 (1984). ow by Trend Analysis, Institute of Science, Depart- 18. Partal, T. and Kucuk, M. \Long-term trend analysis ment of Civil Engineering, Harran University, Sanli- using discrete wavelet components of annual precip- urfa, Turkey (2006). itations measurements in Marmara region (Turkey)", 4. Ceribasi, G., Estimation of Sediment Discharge Trans- Physics and Chemistry of the Earth, 18, pp. 1189-1200 ported in Sakarya River by Using Trend Analysis (2006). Method, Institute of Science, Department of Construc- 19. Gumus, V. and Yenigun, K. \Evaluation of lower Frat tion, Sakarya University, Sakarya, Turkey (2010). basin stream ow by trend analysis", 7th International 5. Ceribasi, G., Dogan, E. and Sonmez, O. \Evaluation of Advances in Civil Eng. Conf., YTU, Istanbul, Turkey Sakarya river stream ow and sediment transport with (2006). rainfall using trend analysis", Journal of Fresenius 20. Kalayci, S. and Kahya, E. \Assessment of stream ow Environmental Bulletin, 3A, pp. 846-852 (2013). variability modes in Turkey 1964-1994", Journal of 6. Ceribasi, G., Dogan, E. and Sonmez, O. \Evaluation of Hydrology, 1-4, pp. 163-177 (2006). meteorological and hydrological data of Sapanca basin 21. Yu, S., Zou, S. and Whittemore, D. \Non-parametric by trend analysis method", Journal of Environmental trend analysis of water quality data of rivers in Protection and Ecology, 2, pp. 705-714 (2014). Kansas", Journal of Hydrology, 1, pp. 61-80 (1993). G. Ceribasi et al./Scientia Iranica, Transactions A: Civil Engineering 24 (2017) 993{999 999 22. Cengiz, T., Kahya, E. and Karaca, M. \Trends and Biographies annual cycles in Turkish lake levels", In: Proc. of the International Association of Hydraulic Engineering Gokmen Ceribasi is an Assistant Professor in the De- and Research Congress, Thessaloniki, Greece (2003). partment of Technology Faculty at Sakarya University. 23. Aris, P., Sophia, M. and Antonios, P. \Simulation He graduated with PhD from the University of Sakarya and trend analysis of the water quality monitoring in 2014. He has published many works in di erent elds daily data in Nestos river delta", Contribution to the of civil engineering. Sustainable Management and Results for the Years 2000-2002, Environ Monit Assess, 3, pp. 543-562 Emrah Dogan is an Associate Professor in the De- (2006). partment of Civil Engineering in Sakarya University. 24. Hong, W., Leen-Kiat, S., Ashok, S. and Xun-Hong, He received a BS degree in Civil Engineering in 2001. C. \Trend analysis of stream ow drought events in He graduated with PhD from the University of Sakarya Nebraska", Water Resources Management, 2, pp. 145- in 2008. He has published many works in di erent elds 164 (2008). of civil engineering. 25. Atalay, I., Applied Hydrography-I, Ege University, Faculty of Arts, Izmir, Turkey (1986). Ugur Akkaya is a Lecturer in the Department of Architecture and urban planning in Abant Izzet Baysal 26. Bakir, H. Determination of Erzurum Ilica Sinirbasi University. He is a PhD student in Sakarya University. Stream Basin Rainfall and Stream Flow Characteris- His areas of expertise are ood risk management, tics, Ataturk University, Erzurum, Turkey (2003). hydraulic, uid mechanics, hydrology and meteorol- 27. Atalay, A. and Ikiel, C. \Trend analysis of monthly ogy. and annual ow values of Sakarya river", International Symposium on Geography, Environment and Culture Ugur Erkin Kocamaz is a Lecturer in the Depart- in the Mediterranean Region, Balikesir, Turkey (2007). ment of Computer Programming at Uludag University. 28. Ikiel, C. and Kacmaz, M., Global Evolution; Involving He is a PhD student at Sakarya University. His areas Change of Climate. Natural Resources and Human of expertise are arti cial neural networks and computer Politics, Italy (2007). and information systems.