APPLICATION OF THE KOLMOGOROV-SMIRNOV TEST TO COMPARE GREENHOUSE GAS EMISSIONS OVER TIME

The national inventories of greenhouse gas (GHG) emissions, which are periodically prepared by countries that signed the Climate Change Convention, compute emissions from anthropogenic sources among them agricultural activities. The protocols established within the scope of the International Panel on Climate Change (IPCC) make it possible to estimate these emissions. These protocols use standard emission factors that vary according to the characteristics of the monitored activities and only scientific research, published in journals of recognized quality, can establish other local factors. Brazilian researchers carry out experiments to measure GHG emissions from agricultural activities, aiming to calculate specific parameters for the national climatic and management conditions. These field experiments are complex, costly, with a limited number of repetitions and, eventually, high natural variability. Often, these limitations result in the inability of the analysis of variance (ANOVA) to identify differences between treatments. The objective of this work is to present the non-parametric Kolmogorov-Smirnov (KS) test as an alternative to compare the effect of flooded irrigation management on methane (CH4) emission throughout the rice crop cycle. We present a case study in which ANOVA produced non-significant results for the adjustment of the model while the KS identified the emission curves as significantly different. The KS test could be adapted, via the SAS NPAR1WAY routine, to compare events with responses over time, such as methane emissions in flooded rice, resulting in test values and graphs that are easy to understand and interpret.


Introduction
The national inventories of greenhouse gas (GHG) emissions, which are periodically prepared by countries that signed the Climate Change Convention, compute emissions from anthropogenic sources among them agricultural activities. The protocols established within the scope of the Intergovernmental Panel on Climate Change (IPCC) estimate these emissions. The cultivation of flooded rice (Oryza sativa L.) is one of the main anthropogenic sources of methane (CH4) emission, an important greenhouse gas (GHG) with much greater global warming potential (28 times in a horizon of 100 years) than carbon dioxide (CO2) (ROSA, 2014;SILVA et al., 2011;MYHRE et al. 2013).
The IPCC protocols employ generic values (default) for the emission factors used in the calculations required in the preparation of inventories. Countries should adopt the factors provided by IPCC guidelines if there is no appropriated specific national values from published research. However, the methane emission factors are quite variable between different environments and ways of handling flooded rice (VO et al., 2018), requiring specific studies to define precisely local emission factors.
In order to define CH4 emission factors adapted to the national conditions of rice production, Brazilian researchers carry out experiments to measure the emissions of this gas and calculate the parameters for specific conditions of climate and management. However, these field experiments are complex and costly, with limited number of repetitions and, eventually, high natural variability. In addition to the interest in defining specific emission factors for local or regional conditions, these surveys aim to improve knowledge about the behavior of methane emissions during the crop cycle and to estimate possible effects of different management practices.
However, the limitations of the adopted experimental designs often result in the inability of the analysis of variance (ANOVA) to identify differences between treatments or make the adjustment of more elaborate models impossible, which ones could help in the interpretation of the phenomena involved.
Kravchenko and Robertson (2015) discuss the statistical challenges in analyses of chamber-based soil emissions data and concludes that the statistical analysis of GHG data requires care to avoid missing significant treatment differences or overstating insignificant differences. They collected emissions data for CO2 and N2O and demonstrated for both gases high spatial and temporal variability. They pointed that increasing the number of replicate plots is the main route of rising statistical power, while increasing the number of subsamples (chambers and gas samples) per replicate plot can also provide substantial gains. Unfortunately, this solution (increasing repetitions) is not always within the reach of researchers, either by limiting the time available for collection, qualified technical staff, collection tools or financial resources in general.
Therefore, the objective of this work is to present the Kolmogorov-Smirnov (KS) nonparametric test as an alternative to compare the effect of flooded irrigation management on methane (CH4) emission throughout the rice crop cycle. We present a case study in which ANOVA generated a non-significant result while our calculation identified that the emission curves were significantly different by KS.
The KS test has several applications, including the evaluation of time series, but even in these cases the comparison is made between the accumulated probability distributions, both between a theoretical and an observed distribution and between two independent data sets, without presumption of theoretical distribution. Machiwal and Jha (2008) for example, used the test to assess the normality of time series of rainfall. However, although the data are observed over time, the accumulated variable under analysis is the probability distribution and not time itself, as suggested in the present study.

Material and methods
In a recent work developed in the South of Brazil, its authors observed that changes in the management of flooded rice crops have resulted in higher increases in GHG emissions than in crop yields (ZSCHORNACK et al., 2018). The authors recommended that in order to avoid growth in GHG emissions associated to increase in rice yield, agricultural practices used to mitigate emissions should be sought; and they listed the intermittent irrigation systems as promising candidates for this aim. In addition, Moterle et al. (2013) came to a similar conclusion, indicating that the intermittent irrigation is effective in mitigating CH4 efflux from rice crops when climatic conditions enable water absence during cultivation.
Given this, an experiment was conducted in an area with irrigated rice, in order to study the effects of flood irrigation management during two crops: 2004 e 2005 (LIMA et al., 2014). Two treatments were employed: maintenance of continuous flooding (CF) and intermittent flooding (IF). For the collection of air samples to be analyzed, the closed chamber method (IAEA, 1992) was adopted. Each treatment received three chambers to collect samples, and taking from these the cumulative amounts of methane (CH4) emissions were estimated.
Air samples were repeatedly collected all along the rice crop cycle, between the months of January and May, totalizing 31 collections in 2004 and 18 collections in 2005. Sample collections in each chamber along the time were used to estimate the total emissions (T) in the period, and the emission factor (f). Therefore, there were for each year six values of T (three for CF, three for IF), and six values for f in the same way. These values were submitted to an analysis of variance (ANOVA) as a 2 x 2 factorial (two years, two treatments) with three repetitions. When a given cause of variation was found to have significance, the Tukey test (5%) for comparison of means was applied.
Even before the results of ANOVA were analyzed, we understand that the integration of emissions obtained from point samples over time in a single accumulated methane emission value for later use in the management comparison, via ANOVA, promotes a great loss of information. This is, a simple comparison between mean values would provide little knowledge about the difference in crop behavior along the time, regarding methane emission. Therefore, authors looked for another method of analysis that could verify a particular behavior in detail and assess whether there were differences between the treatments. The use of the KS test allows that, in addition to a statistical decision in the comparison of the different water management, an interpretation of the behavior is made over time, as it is precisely this knowledge that can guide changes in irrigation management in order to guarantee the minimum emission.
They then applied the Kolmogorov-Smirnov test (also known as KS test), a nonparametric test of the equality of continuous one-dimensional probability distributions that can be used to compare a sample with a reference probability distribution (one-sample KS test), or to compare two samples between them (two-sample KS test). The technique is named after Russian mathematicians Andrei Kolmogorov and Nikolai Smirnov. The Kolmogorov-Smirnov statistic quantifies a distance (D) between the empirical distribution function of the sample and the cumulative distribution function of the reference distribution, or between the empirical distribution functions of two samples. The null distribution of this statistic is calculated under the null hypothesis that the sample is drawn from the reference distribution (in the one-sample case) or that the samples are drawn from the same distribution (in the two-sample case). In each case, distributions considered under the null hypothesis are continuous, but not restricted. The two-sample KS test is one of the most useful and general nonparametric methods for comparing two samples, as it is sensitive to differences in both location and shape of the empirical cumulative distribution functions of the two samples. The Kolmogorov-Smirnov test can be modified to serve as a goodness of fit test (HASSANI and SILVA, 2015).
The empirical distribution function Fn for n independent and identically distributed observations Xi is defined as where I[-∞, x] (Xi) is the indication function, equal to 1 if Xi ≤ x and equal to 0 otherwise. The Kolmogorov-Smirnov statistic for a given cumulative distribution function F(x) is where is the supremum of the set of distances. By the Glivenko-Cantelli theorem, if the sample comes from distribution F(x), then Dn converges to 0 almost surely in the limit when n goes to infinity.
When the Kolmogorov-Smirnov test is used to compare two underlying onedimensional probability distributions, the statistic is where F1,n and F2,m are the empirical distribution functions of the first and second sample respectively, and sup is the supremum function.
The null hypothesis is rejected at level α if , > ( )√ + , where n and m are the sizes of first and second sample respectively. The value of c(α) is given by The two-sample test checks whether the two data samples come from the same distribution, but it is not necessary to specify what that common distribution is.
In the discussed case, there is no distribution of frequency of probability, stricto sensu, to be analyzed. However, if we use the time (number of days) elapsed after the beginning of the experiment as variable X, maintaining chronological order, and we adopt the values of methane emission estimated for that day as frequency values, then we can use the KS test. Since the KS test is non-parametric in nature, no assumptions about the model are necessary (ZHANG and CHEN, 2018). Due to the nature of the experiment and the way the measurements were performed, it is possible to assume that the samples and observations over time were independent, which would be the only assumption required for the use of the KS test (CONOVER, 1998).
Analyses were performed in the SAS software, applying ANOVA and NPAR1WAY routines (SAS, 2011). Emissions along the cycle (mean of the three chambers) were compared by the KS test, two by two within a same year between different treatments, and two by two within a same treatment between different years.
In Figure 1 we see the SAS code used for the KS test between methane emission curves for the two treatments in 2004. The other comparisons followed the same pattern.

Results
We performed the analysis of the residues in the SAS, before the interpretation of the ANOVA results, and there was no evidence that prevented the application of this analysis model. Despite this, the analysis of variance showed absence of significance of the management effect, and also of the management-year interaction effect, both for total emissions and for the emission factor. Only the year effect was significant (Table 1).  Table 2 presents the mean values per treatment and per year, followed by the respective deviations in cases where there was no significance. We can observe that the mean values both of total emissions and of emission factor were significantly higher in 2005 than in 2004. Although the variation in methane emission between years is significant and seems high, it may be due to climate differences between the two crops. As an example, Vo et al. (2018) found even higher variations between emission factors (from 0.31 a 9.14 kg CH4 ha −1 d −1 ) within one same year, but that was in different regions of Vietnam, and they ascribed it to the management and environment (cultivation system, soil, climate).
The assumption that the type of irrigation management adopted, as hypothesized by researchers conducting the experiment, affects methane emission was not confirmed through the analysis of variance. However, the KS test offered a new perspective of analysis for the same data, preserving the chronology of measurements. In 2004 as much as in 2005, the test was able to find a significant difference between the ways how methane emissions occurred along the rice cycle in each of the management types under study (Figure 2). By expressing the accumulated emission of a given management along the time as a proportion of the total emission, the adopted method puts the profiles of each management type on one same basis. This procedure facilitates the application of a quantitative and probabilistic test, plus the perception of the moment when maximum difference is observed, and consequently helping researchers to interpret the phenomenon under study. In both the 2004 and 2005 crops, the D statistic took similar values, of 0.4026 e 0.4062 respectively, both highly significant (Prob < 0.0001). Looking at the graphic representation of the test we can observe that the maximum difference between the two curves of management occurred around day 70 in 2004 and day 50 in 2005, and that emission in the Continuous management is higher in the beginning of the cycle (Figure 2). When comparing methane emissions under one same management in different years, it is interesting to notice that accumulated curves are much more similar to each other than when we compare different managements in one same year; in the first case the curves touch and cross each other, which does not happen when we compare management types. Although the test continues to result highly significant (Prob < 0,0001), values of the D statistic were lower, reaching 0.1385 for the Continuous management around day 80, and reaching 0.2104 under Intermittent management around day 55 (Figure 3). Therefore, while the analysis of variance and the test of means have pointed to significant differences between years, it could be determined through the KS analysis that the effect of year was equivalent upon both types of management, but the type of management is what affects in a very distinct way that methane emissions occur along the time. This is in accordance with the affirmation of Moterle et al. (2013), which also identified irrigation management as a significant cause of variation in GHG emissions.

Conclusions
The Kolmogorov-Smirnov test may be adapted to compare events that produce isolated quantitative answers along time, as is the case of individual measurements of methane emissions in areas of flooded rice crops.
The SAS software provides a routine (NPAR1WAY) that allows for the application of the KS test to such comparisons, with practically no need to prepare data specially, and using a few simple commands.
Test values and graphics produced by the analysis are easy to understand, which facilitates for researchers the interpretation of results.