**3. Methodology**

Streamflow data were collected from the executive engineer office, Ramnagar Irrigation Division, Nainital, Government of Uttarakhand. The 31 years of streamflow data were obtained for Ramnagar station near the outlet of the basin, which represents the entire river basin. The meteorological data were collected from ICAR–VPKAS, experimental farm Hawalbagh observatory (1986–2016). The limitation of this study is only this station has long-term data of rainfall. The watershed was delineated using 90-m-resolution SRTM data set in ArcGIS.

### **3.1 Parameters analyzed**

The following parameters were analyzed from the data:


### **3.2 Trend analysis**

In this study, monthly streamflow trend analysis was evaluated using nonparametric approach namely Mann–Kendall (MK) [25–33] and Sen's slope estimator (magnitude of change) [34, 35]. MK test is a robust and widely accepted method in different hydro-climatic studies. Although the MK test is robust and widely accepted, it does not account for serial autocorrelation that usually occurs in a hydro-climatic variable time series. The presence of serial correlation in a time series may lead to wrong information because it enhances the probability of finding a significance when actually there is an absence of a significant trend. The trend of different hydroclimatic variables was evaluated at 5% and 10% significant levels (p value) as an indicator of trend strength

### **3.3 Mann–Kendall (MK) test**

The MK test [29–30] computes statistics as Eq. (1)

*Trend Analysis of Streamflow and Rainfall in the Kosi River Basin of Mid-Himalaya... DOI: http://dx.doi.org/10.5772/intechopen.107920*

$$S = \sum\_{i=1}^{n-1} \sum\_{j=i+1}^{n} \text{sgn}\left(\mathbf{x}\_{j} - \mathbf{x}\_{k}\right) \tag{1}$$

where S = normal distribution with the mean, n = number of observations (≥ 10), *xj* is the jth observation, and sgn () is the sign function defined as sgn (α) = 1 if α >0; sgn (α) = 0 if α = 0; and sgn (α) = -1 if α<0.

$$Var(\mathbf{S}) = \frac{n(n-1)(2n+5) - \sum\_{i=1}^{m} t\_i(t\_i - 1)(2t\_i + 5)}{18} \tag{2}$$

where n = number of tied groups having similar value for a data group and *ti* = number of data in the ith tied group. The actual MK statistics are given as Eqs. (3–4)

$$Z = \frac{\mathbb{S} + \mathbb{1}}{\sqrt{V(\mathbb{S})}}, \sharp \mathbb{S} < \mathbf{0} \tag{3}$$

$$Z = \mathbf{0}, \mathbf{j}\mathbf{\hat{S}} = \mathbf{0} \tag{4}$$

$$Z = \frac{\mathbb{S} + 1}{\sqrt{V(\mathbb{S})}} \text{,} \sharp \mathbb{S} < 0 \tag{5}$$

Two hypotheses are made, that is, H° (null hypothesis) and H1 (alternative hypothesis). H° indicates no statistically significant trend, while H1 indicates a statistically significant trend.

### **3.4 Sen's slope**

Computation of the magnitude of change in a dataset is done by Sen's slope [36, 38]. This is a simple linear regression method, which can estimate the slope of the median of two different variables (dependent and independent). It can be estimated using Eq. (6)

$$d\_{ijk} = \frac{X\_{ij} - \boldsymbol{\pi}\_{ik}}{j - k} \tag{6}$$

where *Xij* and *xik* are data values and j and k are the time series.

### **3.5 Coefficient of variation**

The coefficient of variation (CV) is defined as the standard deviation divided by the mean. It was used in the study to reveal the interannual variation of an annual average of rainfall. It is calculated using Eq. (7)

$$CV = \frac{\sum\_{i=1}^{n} \left(ARF\_i - \overline{ARF}\right)^2}{\overline{ARF}} \tag{7}$$

where *ARFi* is the annual rainfall in the year i and *ARF* is the average annual rainfall from 1986 to 2016 (n = 31).
