Introduction

The reliability of hydro-meteorological studies depends upon the accuracy and availability of long-term climate data. Due to the occurrence of extreme events such as droughts, floods, and extreme temperatures around the world, climate change studies have received increasing attention. A homogeneous climate series is only affected by natural factors of weather and climate. Often, non-climatic factors such as instrument replacement, change in position of the instrument, changes in observational procedures can seriously affect the accuracy of results. A homogeneous climate record is thus a prerequisite for climate change studies (Caloiero et al. 2020).

Two types of approaches have been used for checking the reliability of hydro-meteorological data series. The first approach is to compare the station data under consideration with the surrounding stations, which is known as relative homogeneity. An example of this approach is the double mass curve analysis (DMCA) method (Alexandersson 1986). In the second approach, statistical methods have been applied to the single station data series for the detection of inhomogeneities which are termed absolute homogeneity tests. Commonly used statistical tests include the standard normal homogeneity test (SNHT) (Alexandersson 1986), the Pettitt test (Pettitt 1979), the Buishand range test (Buishand 1982), and the von Neumann ratio test (von Neumann 1941). Since the relative homogeneity test considers the spatial pattern with the neighboring stations, they are considered more reliable. However, if the stations are widely located and have significant differences in their topography, then an acceptable good correlation may not exist between them. Consequently, statistical methods are preferred (Ahmed et al. 2020).

Both the relative and absolute methods of assessing inhomogeneities in hydro-meteorological data have been used by many researchers. Arikan and Kahya (2019) conducted a homogeneity analysis of monthly precipitation records for 160 meteorological stations in Turkey for the period 1974–2014 using absolute homogeneity tests. Results indicated 44 stations to be inhomogeneous. Double mass curve analysis (DMCA) was used to correct the inhomogeneity in the precipitation records. Ahmed et al. (2020) studied inhomogeneity detection in the precipitation series for Balochistan Province in Pakistan. The absolute homogeneity tests were applied at a 5% significance level to 14 climate stations for the period 1961–2009. Overall, greater portion of the time series data passed the SNHT but rejected the null hypothesis of homogeneous data for the von Neumann tests. Ay (2020) studied trends and homogeneity in temperature and rainfall series in the western Black Sea region, Turkey. The Runs test was used for homogeneity analysis of climate records. The monthly mean temperature for all stations showed no homogeneity. Kocsis et al. (2020) studied homogeneity and trends of precipitation time series in Keszthely, Western Hungary. The Pettitt test was employed for inhomogeneity detection in the annual, monthly, and seasonal precipitation records. Results indicated the importance of homogeneity tests which could help prevent the detection of false trends in the time series data. Suhaila et al. (2008) studied homogeneity analysis of daily rainfall series for 50 stations for the period 1975–2004 for peninsular Malaysia. Absolute homogeneity tests were applied due to sparse distribution of climate stations. Results showed that 10% of the stations had inhomogeneous data. Mair and Fares (2010) studied the homogeneity of the long-term rain gauges in Mākaha Valley, O‘ahu, Hawai‘i. Double mass analysis was used to investigate the data homogeneity. Pirnia et al. (2019) explored changes in streamflow due to climate and human activities in the Tajan River Basin in Iran using the Mann–Kendall test and double mass curve method. Gao et al. (2017) derived and used a double mass curve for hydrologic evaluation in the middle reaches of the Yellow River in China. The slope break was determined using the Pettitt test.

The Mae Klong River Basin is one of the 25 main river basins in Thailand. It has an abundance of water supplies, which are critical to Thailand's economy. Administratively, the Mae Klong River Basin is composed of 25 districts belonging to eight provinces. Three provinces namely Ratchaburi, Samut Songkhram, and Kanchanaburi contribute around 70% of the basin area. The Electricity Generating Authority of Thailand (EGAT) has been given authority to manage all systems of three major dams as well as operate water supply from reservoirs. The Royal Irrigation Department (RID) is in charge of allocating water in the main irrigation system and meeting downstream water needs at Mae Klong Dam. The main aim of this study was to assess the presence of inhomogeneities in the rainfall series for the Mae Klong River Basin using relative and absolute homogeneity methods which can help provide reliable data for hydro-meteorological modeling of water resources in the basin.

Study area

The Mae Klong River Basin lies between 13°8′ and 16°23′ N in latitude and 98°11′–100°13′ E in longitude in the west of Thailand as shown in Fig. 1. The total area of the basin is 30,167 km2. There are two main storage dams and two diversion dams. The two storage dams, Srinagarind (SNR) and Vajiralongkorn (VJK), are located on Khwae Yai and Khwae Noi Rivers, respectively. The two diversion dams, Tha Thung Na (TN) and Mae Klong (MK), are located on the Khwae Yai and Mae Klong Rivers, respectively. Two small tributaries Lam Taphoen River discharges to Khwae Yai River and Lampachi River drains to Khwae Noi River. The water inside the basin is supplied for domestic and industrial demands, hydel-power, and salinity control. Outside the basin, water is supplied to Bangkok Metropolitan Waterworks Authority (MWA) and to the neighboring Tha Chin Basin in the dry season. The most intensive water demand comes from the Greater Mae Klong Irrigation Project (GMKIP), which is located in the lower region of the basin (Khalil et al. 2018).

Fig. 1
figure 1

The Mae Klong River Basin

Materials and methods

Data

The monthly rainfall data of eight stations (Stn130013, 130042, 130053, 130211, 130221, 130571, 376401, and 470161) were obtained from the Royal Irrigation Department (RID) and the Thai Meteorological Department (TMD) for the period 1971–2015. The spatial distribution of rainfall stations is shown in Fig. 2a. The percentage of missing rainfall data varied from 0.19% (Stn130053) to 9.81% (Stn376401) as given in Table 1. As the rainfall data were not available for the consecutive months and some full years, the missing data were filled using two approaches. The rainfall data were obtained for 18 stations in the basin, but due to a large number of missing data, only eight stations were considered in this study. Firstly, the missing data for these stations were filled based on strong correlation with the nearby stations (Xia et al. 1999; Garcia et al. 2006). In the second approach, a long-term mean was used to fill the missing data for the corresponding stations. The spatial distribution of mean annual rainfall in the basin is shown in Fig. 2b. The mean annual rainfall of the stations was interpolated using the inverse distance weighting (IDW) technique.

Fig. 2
figure 2

adapted from Khalil 2020a; Khalil 2020b)

Spatial distribution of a rainfall stations and b mean annual rainfall in millimeter for the period 1971–2015 in the Mae Klong River Basin (

Table 1 Rainfall stations with percentage of missing rainfall data during 1971–2015

Methodology

Double mass curve analysis (DMCA)

It is a graphical technique used to check the consistency of hydro-meteorological data. The inconsistency in rainfall data can be attributed to many reasons such as replacement of a rain gauge, shifting of the instrument to a new location, rainfall observation errors, calamities due to forest fires or landslides, etc. Inconsistency can be corrected using DMCA technique. The double mass curve is plotted by taking summation of a rainfall series for the rain gauge station whose consistency is to be checked against the summation of the average rainfall of the remaining rainfall gauge stations in the area under consideration. If the rainfall data are consistent, then the double mass curve should follow a straight line. A break in the slope of the line would indicate that conditions have changed at one location but not at another as this technique is based on the hypothesis that when each recoded data comes from the same parent population, they are consistent. The inconsistent rainfall data for a station can be adjusted as follows (Arikan and Kahya 2019)

$$R_{a} = \frac{b}{a}R_{o}$$
(1)

where

\(R_{a}\) = Adjusted rainfall.

\(R_{o}\) = Observed rainfall.

b: Slope of graph to which records are adjusted.

a: Slope of graph at time \(R_{o}\) was observed.

Rainfall data homogeneity tests

Homogeneity tests are used to assess the effect of non-climatic factors such as changes in instruments, observation practices, station relocations, and station environments on climate time series data (Toreti et al., 2011). The absolute homogeneity of the rainfall data for the eight stations was assessed by four commonly used tests: the Pettitt test, the standard normal homogeneity test (SNHT), the Buishand test, and the von Neumann test. These tests were conducted at a 5% significance level using XLSTAT software version 2020.5.1 (Addinsoft, 2021). By \(X_{i} \left( {i = 1,2, \ldots .,T} \right)\), we refer to a series of T variables for which we observe \(x_{i} \left( {i = 1,2, \ldots .,T} \right)\) at T successive times. Let \(\widehat{\mu }\) be the mean of the T observed values and let \(\widehat{\sigma }\) be the biased estimator of their standard deviation (we divide by T) (XLSTAT_help 2020).

Pettitt test

Pettitt test (Pettitt 1979) is a nonparametric test and is independent of the distribution of data. It is based on the ranked-based Mann–Whitney test which is used to detect the shift in the time series. In this test, the null hypothesis is Ho: The T variables follow one or more distributions that have the same location parameter. For a two-tailed test, the alternative hypothesis is Ha: There exists a time t from which the variables change of location parameter.

The statistic used for the Pettitt test is computed as follows: Let

$$\begin{gathered} D_{ij} = - 1 \space\space\space\space\space\space if \left( {x_{i} - x_{j} } \right) < 0 \hfill \\ D_{ij} = 0 \space\space\space\space\space\space\space\space if \left( {x_{i} - x_{j} } \right) = 0 \hfill \\ D_{ij} = 1 \space\space\space\space\space\space\space\space\space if \left( {x_{i} - x_{j} } \right) > 0 \hfill \\ \end{gathered}$$
(2)

We then define

$$U_{t,T} = \mathop \sum \limits_{i = 1}^{t} \mathop \sum \limits_{j = i + 1}^{T} D_{ij} $$
(3)

The Pettitt statistic for the alternative hypothesis is

$$K_{T} = {\text{max}}_{1 \le t < T} \left| {U_{t,T} } \right|$$
(4)

The p value can be calculated by \(p = 2\;{\text{exp}}\left( {\frac{{ - 6K_{T}^{2} }}{{T^{3} + T^{2} }}} \right)\) when the value of p is smaller than the significance level \(\left( \propto \right)\), then the null hypothesis is rejected. The time t when \(K_{T}\) occurs is the change point.

Standard Normal Homogeneity Test (SNHT)

The SNHT (standard normal homogeneity test) was developed by Alexandersson (1986) to detect a change in a series of rainfall data. The test is applied to a series of ratios that compare the observations of a measuring station with the average of several stations. The ratios are then standardized. The series of \({X}_{i}\) corresponds here to the standardized ratios. The null and alternative hypotheses are determined by:

Ho: The T variables \({X}_{i}\) follow an N (0, 1) distribution.

Ha: Between times 1 and \(\nu\), the variables follow an \(N(\mu_{1} , 1)\) distribution, and between \(\nu + 1\) and T, they follow an \(N(\mu_{2} , 1)\) distribution.

The Alexandersson statistic is defined by:

$$T_{0} = {\text{max}}_{1 \le t < T} \left[ {\nu \overline{z}_{1}^{2} + \left( {n - \nu } \right)\overline{z}_{2}^{2} } \right]$$
(5)
$${\text{With}}\;\space\space\space \overline{z}_{1} = \frac{1}{\nu }\mathop \sum \limits_{t = 1}^{\nu } x_{t}$$
(6)
$$\overline{z}_{2} = \frac{1}{n - \nu }\mathop \sum \limits_{t = \nu + 1}^{T} x_{i} $$
(7)

The statistic \({T}_{0}\) derives from a calculation comparing the likelihood of the two alternative models. The model corresponding to Ha implies that \({\mu }_{1}\) and \({\mu }_{2}\) are estimated while determining the \(\nu\) parameter maximizing the likelihood.

Buishand test

The Buishand test (1982) can be used on variables following any type of distribution. But its properties have been particularly studied for the normal case. In his study, Buishand focuses on the case of the two-tailed test. In the case of the Q statistic, the null and alternative hypotheses are given by:

Ho: The T variables follow one or more distributions that have the same mean.

Two-tailed test: Ha: There exists a time \(\tau\) from which the variables change of mean.

$${\text{We define}}\;S_{o}^{*} = 0$$
(8)
$$S_{k}^{*} = \mathop \sum \limits_{i = 1}^{k} \left( {x_{i} - \hat{\mu }} \right), k = 1,2, \ldots ., T$$
(9)
$${\text{and}}\;S_{k}^{**} = \frac{{S_{k}^{*} }}{{\hat{\sigma }}}$$
(10)

The Buishand’s Q statistics are computed as follows:

$$Q = {\text{max}}_{1 \le k < T} \left| {S_{k}^{**} } \right| ,{\text{for the two - tailed test case}}{.}$$
(11)

In the case of the R statistic (R stands for range), the null and alternative hypotheses are given by:

Ho: The T variables follow one or more distributions that have the same mean.

Two-sided test: Ha: The T variables are not homogeneous for what concerns their mean.

The Buishand’s R statistic is computed as:

$$R = {\text{max}}_{1 \le k < T} \left( {S_{k}^{**} } \right) - {\text{min}}_{1 \le k < T} \left( {S_{k}^{**} } \right)$$
(12)
von Neumann test

The von Neumann ratio is defined by:

$$N = \frac{1}{{T\hat{\sigma }}}\mathop \sum \limits_{i = 1}^{T - 1} \left( {x_{i} - x_{i + 1} } \right)^{2}$$
(13)

where the expectation of N is 2 when the \({X}_{i}\) have the same mean.

This test does not allow for the detection of time at which change occurs.

For the four tests, XLSTAT evaluates the p value and an interval around the p value by using a Monte Carlo method.

Qualitative Interpretation of the homogeneity tests

The results of the homogeneity tests were interpreted following the approach suggested by Wijngaard et al. (2003). Based on the results of the four tests for inhomogeneity assessment, the data series of rainfall stations were divided into three classes (Wijngaard et al. 2003).

Class U: ‘useful’—one or zero tests reject the null hypothesis at the 5% significance level.

Class D: ‘doubtful’—two tests reject the null hypothesis at the 5% significance level.

Class S: ‘suspect’—three or four tests reject the null hypothesis at the 5% significance level.

Results and discussion

Consistency check of Rainfall data

The double mass curve analysis (DMCA) technique was used to check the consistency of rainfall series for the Mae Klong River Basin before the application of the statistical tests used for absolute homogeneity analysis. The double mass plots for the eight stations are shown in Fig. 3. It can be seen that for the six stations (Stn130013, 130053, 130211, 130221, 130571, and 470161) the data follow a straight line which indicates the consistency of rainfall data for these stations. For station 130042, there are slight deviations about the straight line, while for the stn376401, there is a clear break in the slope of the double mass curve in the year 2000 (determined by visual observation of time series) which clearly indicates inconsistency of rainfall data.

Fig. 3
figure 3

Double mass curve plots of rainfall stations for the Mae Klong River Basin

Absolute Homogeneity tests

Inhomogeneity detection in each calendar month

The monthly time series of eight stations were grouped into each calendar month (January to December) which resulted in 45 values for each rainfall station based on available data for the period 1971–2015. The four tests (Pettitt test, SNHT, Buishand test, and von Neumann test) were applied to each month for each station. These tests were applied at a 5% significance level.

Pettitt Test

The results of p values for the Pettitt test are given in Table 2. Any p value less than the significance level of \(\alpha\)= 0.05 will indicate inhomogeneity in the corresponding time series. For five stations (Stn130013, 130042, 130211, 130221, and 470161), the null hypothesis was satisfied for all the months. Three stations (Stn130053, 130571, and 376401) were found to be inhomogeneous as the p values were less than 0.05. The data for Stn130053 were inhomogeneous for the month of April. Stn130571 had p values less than the threshold for 2 months (April and December). The data of Stn376401 were found to be inhomogeneous for 4 months (March, April, July, and September). The results varied between different months. For the month of April, three stations’ rainfall data were found to be inhomogeneous.

Table 2 The p values obtained from Pettitt test for each calendar month and station
Standard Normal Homogeneity Test (SNHT)

Table 3 shows the p values obtained from SNHT. The null hypothesis of homogeneous data was rejected for p values less than 0.05. Five stations showed homogeneous data for all months. The data of Stn130221 were inhomogeneous in the months of January and March. Stn376401 showed inhomogeneous data for 5 months (March, July, August, September, and December). The months of February, April, May, June, October, and November satisfied the null hypothesis of homogeneous data for all stations.

Table 3 The p values obtained from SNHT for each calendar month and station
Buishand test

Results of p values obtained for the Buishand test are given in Table 4. The data for the three stations (Stn130013, 130053, and 470161) were found to be homogeneous for all months. The months of April and July could not pass the test for three stations each. Stn376401 indicated inhomogeneous data for 4 months (March, April, July, and September) with p values less than the threshold of 0.05.

Table 4 The p values obtained from Buishand test for each calendar month and station
Von Neumann test

Table 5 shows the results of p values obtained for the von Neumann test. The month of October showed inhomogeneous data for two stations (Stn130053 and Stn130221) with p values less than 0.05. Stn376401 showed inhomogeneous data for the month of September. For the case of Stn130042, the null hypothesis was rejected in the month of May, while at Stn130571, the null hypothesis was rejected for the month of April. Overall, in this test, all stations indicated homogeneous data for the majority of the months.

Table 5 The p values obtained from von Neumann test for each calendar month and station

For qualitative interpretation of the four tests, the results were evaluated qualitatively using the approach of (Wijngaard et al. 2003) and are shown in Table 6. It can be seen that the rainfall data for five stations can be classified into class U (useful) for all the months. The data at Stn130571 can be classified into class S (suspect) in the month of April. Stn130221 data were classified into class D (doubtful) in October. The data at Stn376401 showed D in April while indicated S for 3 months (March, July, and September).

Table 6 Qualitative classification of each calendar month and station based on the four homogeneity tests

Inhomogeneity detection in annual rainfall series

For detection of inhomogeneity in the rainfall data on an annual scale, the monthly data were aggregated into total annual rainfall for all stations during the period 1971–2015. The results of the four tests are given in Table 7. It is observed that the results of seven stations can be classified in class U (useful) as these stations pass three or more tests by satisfying the null hypothesis. Stn376401 could not pass any of the four tests and was classified into class S (suspect). This result is consistent with the double mass curve analysis (Fig. 3) which indicated a clear break in slope in the year 2000.

Table 7 The p values obtained from the homogeneity tests for the annual rainfall

Inhomogeneity detection in monthly rainfall series during 1971–2015

The absolute homogeneity tests were applied to the monthly rainfall series of all stations for the period 1971–2015. The results obtained from these tests are given in Table 8. Six stations data were classified into class U (useful) as they satisfied the null hypothesis of homogeneous data for three out of four tests. The monthly data for Stn130221 were classified into D (doubtful) as it could not pass two of the four tests with p values less than the threshold of 0.05. Stn376401 was classified into class S (suspect) as it failed to satisfy the null hypothesis of homogeneous data in three tests. Results also showed that all the stations failed the null hypothesis for the von Neumann test.

Table 8 The p values obtained from the homogeneity tests for the monthly rainfall series during 1971–2015

The DMCA technique was applied to adjust the rainfall data for the Stn376401. As shown in the DMCA plot in Fig. 4, there is a clear break in the slope of the line during the year 2000. This is also confirmed by SNHT and Buishand range tests (March 2000). However, the Pettitt test indicated the point of change in March 1999. The slope of the line before the break was calculated to be 0.139 and the slope of the line after the break was found to be 0.179. The correction was calculated as 0.179/0.139 = 1.29. This factor was multiplied with the rainfall data before the break (the year 2000) to reflect the new conditions (after the year 2000) (Arikan and Kahya 2019). The author did not have access to the metadata for the Stn376401 which could help determine the reasons for inhomogeneity in the rainfall series. After adjustment of the rainfall data, the four homogeneity tests were applied and the results are given in Table 9. It can be seen that the rainfall series has passed the three tests at a 5% significance level with p values above the threshold of 0.05. The graphical representation of SNHT before and after the rainfall data homogenization along with the double mass curve is shown in Fig. 4. Since the data have passed three tests, it can be classified as ‘useful’. Overall, the data for the eight stations can be considered useful for hydro-meteorological studies in the Mae Klong River Basin.

Fig. 4
figure 4

Double mass curve plots and SNHT results for the Stn376401 before and after homogenization of the rainfall series during 1971–2015

Table 9 The p values obtained from the homogeneity tests for the monthly rainfall series during 1971–2015 for the Stn376401 after rainfall adjustment

Conclusions

This study examined the homogeneity of the rainfall series for each calendar month, monthly time series, and annual rainfall data for eight stations in the Mae Klong River Basin for the period 1971–2015. Both the relative and absolute homogeneity tests were used. The relative homogeneity of the rainfall data was assessed through double mass curve analysis (DMCA), whereas the absolute homogeneity was investigated through the four commonly used statistical methods (the Pettitt test, SNHT, Buishand test, and von Neumann test) at a 5% significance level. Results showed that for each calendar month, rainfall data of five stations (Stn130013, 130042, 130053, 130211, and 470161) were found to be ‘useful’ in all months. The rainfall data for Stn130221 were found to be ‘doubtful’ in the month of October. The data of Stn130571 were found to be ‘suspect’ in April. Stn376401 were classified into ‘doubtful’ for the month of April, while ‘suspect’ for the months of March, July, and September. For annual rainfall, all the stations data were classified as ‘useful’ except for Stn376401 which were classified as ‘suspect.’ For the monthly time series, the data for Stn130221 were classified as ‘doubtful’ and for Stn376401 as ‘suspect’, while for the remaining stations, the rainfall data were classified as ‘useful’. The double mass curve analysis method was used to adjust the monthly rainfall data of Stn376401. After adjustment, the data of Stn376401 passed the null hypothesis of homogeneous data for three out of four homogeneity tests and were classified as ‘useful.’ Overall, the rainfall time series data can be considered useful for hydro-meteorological studies of water resources in the basin.