MannKendall, works
for repeat values of time. Used in function mannkendall, which also calculates the p-value by simulation.
mannkendall.stat(time, Y)j and considering the subset of observations that have time greater than time[j]. The Mann Kendall
statistic is the number of observations in this subset for which Y > Y[j] minus the number for
which Y < Y[j].
The statistic is summed over all j. The p-value is calculated by nreps random permutations of the Y values.
mannkendall, power.trend, MannKendall