Indian Journal of Agricultural Research

  • Chief EditorV. Geethalakshmi

  • Print ISSN 0367-8245

  • Online ISSN 0976-058X

  • NAAS Rating 5.60

  • SJR 0.293

Frequency :
Bi-monthly (February, April, June, August, October and December)
Indexing Services :
BIOSIS Preview, ISI Citation Index, Biological Abstracts, Elsevier (Scopus and Embase), AGRICOLA, Google Scholar, CrossRef, CAB Abstracting Journals, Chemical Abstracts, Indian Science Abstracts, EBSCO Indexing Services, Index Copernicus
Indian Journal of Agricultural Research, volume 54 issue 1 (february 2020) : 58-64

Development of an Interface in MATLAB for Trend Analysis of Hydro-Meteorological Data

J.P. Patil1,*, A. Sarangi2, D.K. Singh2
1National Institute of Hydrology, Roorkee-247 667, Uttarakhand, India.
2Water Technology Centre, IARI, New Delhi-110 012, India.
Cite article:- Patil J.P., Sarangi A., Singh D.K. (2019). Development of an Interface in MATLAB for Trend Analysis of Hydro-Meteorological Data . Indian Journal of Agricultural Research. 54(1): 58-64. doi: 10.18805/IJARe.A-5236.
This study presents an interface, ‘Climate Change Trend Analysis (CCTA)’, developed in MATLAB® environment to analyze the trends using non-parametric statistical methods, Mann-Kendall (MK) test and modified Mann-Kendall (MMK) test with Sen’s slope estimator. The interface was used to determine trend in annual and seasonal (kharif) rainfall depths in Pune district acquired from 13 observatories. The developed interface automates the trend analysis process, which can further use for detecting variability and trends in the meteorological as well as other hydrological and agricultural parameters. The observed rainfall trends during monsoon would play a significant role for rainfed agriculture in Pune district. 
The changing pattern of rainfall deserves urgent attention, as it will affect the availability of water for agricultural production. Therefore, it is imperative to investigate the climate change impact on spatial and temporal rainfall characteristics to facilitate agricultural water management practices and strategies. One of the commonly used tools for detecting changes in climatic and hydrologic time series is trend analysis. Detecting the trend and periodicity of observed data is a meaningful method in the study of climatic and hydrological changes.
       
A number of parametric and non-parametric tests have been applied for trend detection. Both parametric and non-parametric tests are commonly used. Parametric tests are more powerful than non-parametric ones, but they require data to be independent and normally distributed, on the other hand, non-parametric trend tests overcome the limitation of normality of distribution, data independence, and presence of outliers in the data set (Yue et al., 2002). Hydro-meterological data sets are not generally normally distributed and outliers are present in the data series. Therefore, the non-parametric statistical approaches can suitably analyse the data and could generate the trends. Some of the non-parametric statistical methods such as Mann- Whitney-Pettit (MWP) and Mann Kendall (MK) rank correlation methods are widely used to test the existence of trends in annual rainfall, annual 1-day maximum rainfall, seasonal rainfalls, annual no-rain days and annual maximum of consecutive no-rainfall days (Kumar and Jain, 2010; Basistha et al., 2009). The rank-based non-parametric MK statistical tests (Mann, 1945; Kendall, 1975) have been widely used to assess the significance of trends in hydro-meteorological time series such as water quality, stream flow, temperature, and precipitation. Many previous  studies have used the  MK  test  for  detecting trends in hydrological and hydro-meteorological time series, including Thapliyal and Kulshrestha (1991), Kothyari et al., (1997), Kripalani et al., (2003), Sahai et al., (2003), Hall et al., (2006), Kampata et al., (2008), Yu et al., (2006), Dash et al., (2011); Mondal et al., (2012), Dash et al., (2009).
       
Hamed and Rao (1998) modified the MK trend test by studying the effect of autocorrelation on the variance of the test statistic that is often ignored in the original MK test. Based on the modified value of the variance of the MK trend test statistic, a modified non-parametric trend test, which is suitable for auto correlated data was proposed. The modified test was applied to annual average rainfall time series of Indiana of 98 years (1895-1992) and to the stream flow data of Ohio of 90 years (1903-1992). It was apparent that the existence of either positive or negative autocorrelation in time series would interfere with proper identification of significant trends. The proposed trend test offers a simple and easy way to calculate modification to account for autocorrelation in the data and the modification does not affect the power of the test while offering more accurate significance levels.
       
There have been many interfaces developed in various programming languages such as VBA, Matlab, dotnet framework for automation of certain task and handling hydro-meteorological database. Some of the developed interfaces are, Watershed Morphology Estimation Tool (WMET) for estimation of the watershed morphological parameters (Sarangi et al., 2004), SPATSIM for estimation and analysis of drought characteristics (Smakthin and Hughes, 2007), Interface for Surface Runoff Estimation using Curve Number method (ISRE-CN) (Patil et al., 2008). Analyzing the trends in meteorological data is tedious and computationally hard task. Therefore, an attempt was made in this study to develop an interface in Matlab® programming language for estimation of trends in hydro-meteorological variables using non-parametric statistical tests. The developed interface was used for detection of trend in annual and seasonal (kharif) rainfall using long term rainfall record of 47 years from 1958 to 2004.
Study area and data acquisition
 
Pune district, situated in the western part of the Maharashtra State of India. It covers an area of about 15642 km2 having 5.1% of total geographical area of the State. The exact geographical location lies between 17°54’N to 19°24’N latitude and 73°29’E to 75°10’E longitude. For administrative convenience, it is divided into 14 tehsils namely Pune City, Haveli, Khed, Ambegaon, Junnar, Shirur, Daund, Indapur, Baramati, Purandhar, Bhor, Welhe, Mulsi and Maval (Vadgaon) (CGWB, 2009).
       
Pune district experiences tropical monsoon and therefore, shows a significant seasonal variation in temperature as well as rainfall behaviour. Most of this rainfall is due to the South-West monsoon and about 87% of rain occurs during the monsoon months. The monsoon arrives in the month of June, with the maximum intensity of rainfall during the month of July, followed by August. The average annual rainfall of Pune district is 115 cm. Tehsils falling in the highest rainfall intensity zone are Welhe, Mulshi and Maval (Vadgaon). Tehsils falling in the moderate rainfall intensity zone are Bhor, Ambegaon, Junnar, Khed, Haveli, Pune city and Purandhar. Tehsils with lowest rainfall intensity, the dry and semi-arid zone are Shirur, Daund, Indapur and Baramati (MPCB, 2006).
       
For this study, data of daily rainfall depth (mm) from 1958 to 2004 (i.e. 47 years) of 13 meteorological stations of Pune district and temperature data (1969-2008) of Pune was acquired from India Meteorological Department, Pune. The average annual rainfall depths (i.e. from 1958 to 2004) of the 13 meteorological stations along with their geographical locations are given in Table 1.
 

Table 1: Average annual rainfall depths (from 1958-2004) and geogr -phic locations of 13 meteorological stations of Pune District.


 
Development of an interface for Climate Change Trend Analysis (CCTA)
 
MATLAB is a high level languages and interactive environment for numerical computation, visualization and programming. The language, tools and built-in math function enables to explore multiple approaches for faster solutions than spreadsheet and traditional programming languages.
               
Climate Change Trend Analysis (CCTA) Interface was developed in MATLAB® environment to analyze the trends in various meteorological variables e.g. rainfall, temperature, solar radiation etc. using trend tests. The CCTA interface incorporates two trend tests viz. MK test and MMK test besides Sen’s slope estimator. It also gives the statistical summary (i.e. Maximum, Minimum, Mean, Standard deviation and variance) of the input data along with the histogram which shows the distribution of data.
       
CCTA Interface has input and output panels i.e. ‘Basic Information’ and ‘Results and Inference’. In the basic information panel, user interactive input such as station name, longitude and latitude in radians, altitude in meter unit is provided. User can select one of the four trend tests for trend analysis by using ‘select trend test’ button besides the option for inputting the level of significance. For providing the meteorological data to the interface, there are two options, user can generate input file or load input file. The MS-Excel (*.xls) data input file is generated by clicking on ‘generate input file’ button. An input file named “Input.xls” will be generated in ‘My Documents’ folder. User has to insert data below the appropriate header column in appropriate units. After loading the data successfully to the interface, basic information panel gives the statistical summary and histogram of the data as shown in Fig 1.
 

Fig 1: Screenshot of CCTA interface showing basic information and results.


       
The selected trend test can be run using the ‘RUN’ button, and the outputs of the test such as scatter plot of the data with trend line, probability value at which null hypothesis is accepted/rejected and Sen’s slope estimator will be displayed in ‘Results and Inference’ panel (Fig 1). After trend analysis, the outputs will be saved to “Output.xls” file in ‘My Documents’ folder of the computer.
 
Non-parametric methods used in interface
 
The Mann Kendall and Modified Mann Kendall tests besides the Sen’s slope estimator for determination of trend and slope magnitude of the meteorological variables were incorporate in the developed interface for trend detection of meteorological variables.
 
Mann Kendall test
 
The Mann-Kendall test is a non-parametric test for detecting trend in time series data. The Mann-Kendall test is simple and robust and can cope with missing values and values below a detection limit. The test was first created by Mann (1945) and Kendall (1975) and covariances between Mann-Kendall statistics were developed by Dietz and Kileen (1981). The test can be used to analyse trends of rainfall, streamûow and water quality data (Yue et al., 2002; Burns et al., 2007; De Luis et al., 2000; Ndiritu, 2005; Mazvimavi and Wolski, 2006). The Mann–Kendall-statistic S is given as:
                                                               
                     (1)

where
 
 
 The variance of S denoted by (   𝛔s2  ) is computed as:
                                                                               
                                                                                                   (2)
 
Where n is the number of data points, q is the number of tied groups in the data set and tj is the number of data points in jth tied group.
 
Then S and   𝛔s2   were used to compute the test statistics Zs as:
 
 
                                                                                                  
A positive value of S indicates that there is an increasing trend and a negative value indicates a decreasing trend. The null hypothesis H0 that there is no trend in the data is either accepted or rejected depending if the computed ZS statistics is less than or more than the critical value of Z-statistics obtained from the normal distribution table at 5% significance level.
 
Modified Mann Kendall (MMK) test
 
The basic assumption of the original Mann-Kendall test is that the data need to be independent and randomly ordered. However, in many real situations the observed data are auto-correlated. The existence of positive autocorrelation in the data increases the probability of detecting trends when actually none exist and vice versa. Although this is a well-known fact that autocorrelation in the data is often ignored. Hamed and Rao (1998) have discussed the effect of autocorrelation on the variance of the Mann-Kendall trend test statistic. A theoretical relationship was derived to calculate the variance of the Mann-Kendall test statistic for auto-correlated data. Based on the modified value of the variance of the Mann Kendall trend test statistic, a modified non-parametric trend test which is suitable for auto-correlated data was incorporated. The empirical formula for calculating the variance of S in the case of auto-correlated data is given by equation (4).
                                               
                                                                                                   (4)
 
where,       represented a correction due to the autocorrelation
 
in the data. The correction of autocorrelation is given by equation (5).
 
                                                                                                 
                                                                                                   (5)
        
Where n is the number of observations and rs(i) is the autocorrelation function of the ranks of the observations. The advantage of the approximation in equation (5) is that by using the ranks of the observations, the variance of S can be evaluated by equations (4) and (5) without the need for either the normalized data or their autocorrelation function.
 
Sen’s slope estimator
 
If a linear trend is present in a time series, then the true slope (i.e. change in data per unit time) can be estimated by using a simple nonparametric procedure developed by Sen (1968). Though Mann-Kendall statistics is effective and used to evaluate a significant increase or decrease in parameter under consideration, it does not estimate a trend slope. Therefore, the nonparametric Sen’s method was used to estimate the slope of an existing trend. The Sen’s slope estimator is widely used due to its simplicity in computation, analytical estimates of confidence intervals and robustness to outliers which are the advantages over the general slope estimation. This approach involves computing slopes for all the pairs of time points and then using the median of these slopes as an estimate of the overall slope. Sen’s method proceeds by calculating the slope of the line using all data pairs, as shown in the following equation:
 
                                                                                                                                                                                                 (6)
 
       
where,  j> k. If there are n values xj in the time series, we get as many as  N = ((n + 1)/2) slope estimate Qi. Sen’s estimator of slope is simply given by the median of these N values of Qis.
                                                                                                                                           if N is odd                 (7)

                                                                                                                                 if N is even.                   (8)

Sen’s  estimator  is  computed  as  Qmed=Q(N+1)/2  if  N appears  odd  and  it  is  considered  as Qmed=[QN/2+Q(N+2)/2]/2 if N appears even. At the end, Qmed is computed by a two sided test at 100 (1-α) % confidence interval and then a true slope can be obtained by the non-parametric test. Positive value of Q indicates an upward or increasing trend and a negative value of Q shows a downward or decreasing trend in the time series.
Validation of developed interface
 
The developed interface ‘CCTA’ was used for trend analysis of rainfall depths of 13 meteorological stations of Pune district and temperature data of Pune meteorological station using MK test and MMK test with Sen’s slope.
 
Trend analysis using Mann-Kendall (MK) test
 
The results of annual and seasonal (kharif) rainfall (from 1958 to 2004) trend analysis using MK test showed decreasing trend in the rainfall depth at confidence levels of 90, 95 and 99%.
       
The annual rainfall of 9 out of 13 meteorological stations showed decreasing trend in the rainfall depth over the period Fig 2(a). Welhe station, which receives highest rainfall in the district showed the decreasing trend with 99% confidence level. Annual rainfall at Khed meteorological station also showed decreasing trend at 95% confidence level. The meteorological stations viz. Ambegaon, Pune, Daund and Baramati showed increasing trend in the annual rainfall and other meteorological stations showed decreasing trend with poor confidence level.
 

Fig 2: Rainfall Trend Analysis from 1958 to 2004 of Pune District using Mann-Kendall test.


       
During kharif season, decreasing trends were observed at Welhe and Khed with confidence level at 99 and 95%, respectively. Whereas, rainfall depths at Daund and Baramati meteorological stations exhibited increasing trends with poor confidence level. The rainfall depths at other 9 meteorological stations of district were observed to be decreasing with lower confidence level (Fig 2b).
       
Test statistics of trend analysis in annual and seasonal (kharif) rainfall depths from 1958 to 2004 is shown in Table 2.
 

Table 2: Test statistics of trend analysis in annual and seasonal (kharif) rainfall depths from 1958 to 2004.


 
Trend analysis using MMK test
 
The MMK test, which provides trend of auto-correlated data, was used for trend analysis of annual and seasonal (kharif) rainfall depths (from 1958 to 2004) of 13 meteorological stations of Pune district. The trends observed in annual and seasonal rainfall using MK test and MMK test were same except at Mulshi. At Mulshi the annual trend was observed to be decreasing with 95% confidence level by MMK which was observed decreasing with poor confidence by MK test. Also, for the Seasonal (kharif) trend analysis, at Mulshi, MMK test, which showed decreasing trend at 90% confidence level which was non-significant by MK test.
       
The trend analysis was also carried out for maximum, minimum and average temperature data (from 1969 to 2008) recorded at Pune meteorological station. Fig 3 shows the variation in the maximum temperature (30.9-32.5°C), minimum temperature (16.97-18.64°C) and average temperature (24.11-25.43°C) over the period of analysis. There were no significant trends for the maximum, minimum and average temperature data (from 1969 to 2008) recorded at Pune meteorological station. It can be concluded that the change in temperature of Pune meteorological station cannot be corroborated as an effect of climate change of the region.
 

Fig 3: Variation in maximum, minimum and average temperature of Pune station from 1969 to 2008.


 
Sen’s slope estimator
 
Sen’s slope estimates indicating the magnitude of trend for annual and seasonal (kharif) rainfall depths at 13 meteorological stations during 1958 to 2004 are shown in Table 3. The positive value of slope indicates an increasing trend and a negative value of slope shows decreasing trend in the rainfall depths over the period. For July, overall negative trend was observed with exception at Baramati and Indapur. These Sen’s slope estimates are useful for detecting the magnitude of the trend observed by MK test. At Welhe, high magnitude of negative trend was observed for annual and seasonal (kharif) rainfall depths.
 

Table 3: Estimated Sen’s Slope from 1958 to 2004.

In this study, Climate Change Trend Analysis interface was developed using the Matlab® programming language to estimate the trend in hydro-meteorological variables by adopting most widely used Mann Kendall and Modified Mann Kendall tests. The developed interface was used for trend detection in annual and seasonal (kharif) rainfall depths and temperature of Pune district. The developed interface is simple and easy to use and precludes tedious and computationally hard task of trend estimation. The interface can be used for trend analysis of hydro-meteorological parameter besides rainfall and temperature.

The results of trend analysis for study area showed a shift in rainfall pattern over the Pune district during the period of analysis. Annual and seasonal (kharif) rainfall depths were observed to be decreasing. The temperature data analysed using 39 years record of Pune meteorological station did not exhibit any significant trend. From this analysis, it can be recommended that the sowing date of kharif crops should be ensured during the month having high probability of occurrence of rainfall to assist in germination of seed. Moreover, this study will assist in deciding the need of water conservation measures, deciding the sowing date of crops and selection of crops based on rainfall depths and its availability pertaining to different regions of Pune district, Maharashtra as an adaptation measure to changing climatic scenarios.
First author acknowledge the funding support provided by Indian Agricultural Research Institute, New Delhi during the study period. The work was carried out as part of PhD dissertation of first author.
Quaternary Int. 212(1): 64-69. https://doi.org/10.1016/j.        

  1. Basistha, A., Arya, D. S. and Goel, N. K. (2009). Analysis of historical changes in precipitation in the Indian Himalayas. International Journal of Climatology., 29(4): 555-572. https://doi.org/10.1002/joc.1706.

  2. Burns, D. A., Klaus, J. and McHale, M. R. (2007). Recent climate trends and implications for water resources in the Catskill Mountain region, New York, USA. Journal of Hydrology. 336(1–2): 155–170. https://doi.org/10.1016/j.jhydrol.12.019

  3. CGWB (2009). Ground Water Information of Pune District, Maharashtra-2009. Central Region Nagpur, CGWB, Ministry of Water Resources, 1-2.

  4. Dash, S. K., Kulkarni, M. A., Mohanty, U. C. and Prasad, K. (2009). Changes in the characteristics of rain events in India. Journal of Geophysical Research. 114: D10109. https://doi.org/10.1029/2008JD010572.

  5. Dash, S. K., Nair, A, A., Kulkarni, M. A. and Mohanty, U. C. (2011). Characteristic changes in the long and short spells of different rain intensities in India. Theoretical and Applied Climatology. 105: 563–570. https://doi.org/10.1007/s00704-011-0416-x.

  6. De Luis, M., Raventós, J., González-Hidalgo, J. C., Sánchez, J. R. and Cortina, J. (2000). Spatial analysis of rainfall trends in the region of Valencia (east Spain), Int. Journal of Climatology. 20(12): 1451–1469. https://doi.org/10.1002/1097-0088 (200010)20:12<1451:AID-JOC547>3.0.CO;2-0.

  7. Dietz, E. J. and Killeen, T. J. (1981). A nonparametric multivariate test for monotone trend with pharamacetical applications. J. of the American Stat. Asso., 76: 169-174. https://doi.org/10.1080/01621459.1981.10477624.

  8. Hall, A. W., Whitfield, P. H. and Cannon, A. J. (2006). Recent Variations in Temperature, Precipitation and Streamflow in the Rio Grande and Pecos River Basins of New Mexico and Colorado. Reviews in Fisheries Sci., 14(1-2): 51-78. https://doi.org/10.1080/10641260500340835.

  9. Hamed, K. H. and Rao, A. R. (1998). A modified Mann-Kendall trend test for autocorrelated data. Journal of Hydrology. 204: 182 -    196. https://doi.org/10.1016/S0022-1694 (97)00125-X.

  10. Kampata, J. M., Parida, B. P. and Moalafhi, D. B. (2008). Trend analysis of rainfall in the headstreams of the Zambezi River Basin in Zambia. Phy. and Chem. of the Earth, 33: 621–625. https://doi.org/10.1016/j.pce.2008.06.012.

  11. Kendall, M G. (1975). Rank Correlation Methods . Charles Griffin, London. 1975, 67-100.

  12. Kothyari, U. C., Singh, V. P. and Aravamuthan, V. (1997). An investigation of changes in rainfall and temperature regimes of the Ganga Basin in India. Water Res. Manage., 11(1),17-34. https://doi.org/10.1023/A:1017936123283.

  13. Kripalani, R. H., Kulkarni, A., Sabade, S. S. and Khandekar, M. L. (2003). Indian monsoon variability in a global warming scenario. Natural Hazards. 29:189-206. https://doi.org/10.1023/A:1023695326825.

  14. Kumar, V. and Jain, S. K. (2010). Trends in seasonal and annual rainfall and rainy days in Kashmir Valley in the last century. Quaternary Int., 212(1): 64 –69. https://doi.org/10.1016/j.quaint.2009.08.006.

  15. Mann, H. B. (1945). Nonparametric tests against trend. Econometrica. 13: 245-259.

  16. Mazvimavi, D. and Wolski, P. (2006). Long-term variations of annual flows of the Okavango and Zambezi Rivers. Phy and Chem of the Earth. 31: 951–994. https://doi.org/10.1016/j.pce.2006.08.016.

  17. MPCB (2006). District Environmental Atlas of Pune District. Maharashtra Pollution Control Board, Central Pollution Control Board, 1-10.

  18. Ndiritu, J. G. (2005). Long-term trends of heavy rainfall in South Africa. Regional hydrological Impacts of Climatic Change- Hydroclimatic Variability. In: Proceedings of symposium S6 held during the seventh IAHS Scientific Assembly at Foz do Iguacu, Brazil, April 2005. IAHS Publ.296, pp. 178–183.

  19. Patil, J. P., Sarangi, A., Singh, O. P., Singh, A. K. and Ahmad, T. (2008). Development of a GIS interface for estimation of runoff from watersheds. Water Resources Management. 22 (9): 1221-1239. https://doi.org/10.1007/s11269-007-9222-8

  20. Ramanathan, V., Chung, C., Kim, D., Bettge, T., Buja, L., Kiehl, J. T., (2005). Atmospheric brown clouds: impacts on South Asian climate and hydrological cycle. Proceedings of National Academy of Sciences, USA. 102:5326-5333.

  21. Sahai, A. K., Pattanaik, D. R., Satyan, V. and Grimm, A. M. (2003). Teleconnections in recent time and prediction of Indian summer monsoon rainfall. Met. and Atmp. Physics. 84: 217 -227.

  22. Sarangi, A., Madramootoo, C. A. and Singh, D. K. (2004). Development of ArcGIS assisted user interfaces for estimation of watershed morphologic parameters, J. of Soil and Water Cons., 3(3&4): 139-149.

  23. Sen, P. K. (1968). Estimates of the regression coefficient based on Kendall’s tau. Journal of the American Statistical Association. 63(324): 1379-1389. DOI: 10.1080/01621459.1968.10480934.

  24. Smakhtin, V. U and Hughes, D. U. (2007). Automated estimation and analyses of meteorological drought characteristics from monthly rainfall data. Environmental Modelling & Software. 22(6): 880-890. https://doi.org/10.1016/j.envsoft.2006.05.013.

  25. Thapliyal, V. and Kulshrestha, S. M. (1991). Climate changes and trends over India. Mausam. 42: 333–338. Ref No. CLA-93-050818; EDB-93-079776.

  26. Yu, P., Yang, T. and Kuo, C. (2006). Evaluating long-term trends in annual and seasonal precipitation in Taiwan. Water Resources Management. 20(6): 1007-1023. https://doi.org/10.1007/s11269-006-9020-8.

  27. Yue, S., Pilon P. and Cavadias, G. (2002). Power of the Mann-Kendall and spearman’s rho test for detecting monotonic trends in hydrological series. Journal of Hydrology. 259: 254-271. https://doi.org/10.1016/S0022-1694(01)00594-7. 

Editorial Board

View all (0)