pyMannKendall
pyMannKendall copied to clipboard
Variance in correlated seasonal MK test
Hi,
I've been using your library to perform several MK tests and may have found a missing term in the function correlated_multivariate_test(). According to Hipel & McLeod (1994) for a correlated seasonal MK test the variance is computed as follows (Eq. 23.3.12):
Where the 2nd summation term of the equation is zero when no correlation is present in the time series. In the function correlated_multivariate_test() this 2nd summation is represented by the variable Gamma and computed as follows (Eq. 23.3.21):
But after that, the variance (var_s) for the correlated seasonal MK test is obtained with np.sum(Gamma) and the 1st summation term (which is included in the seasonal MK test without correlation) is not accounted for. Thus, shouldn't the variance in correlated_multivariate_test() include both terms (assuming no ties nor missing values):
Thank you in advance!
Aleks