komanawa.kendall_stats.mann_kendall#
created matt_dumont on: 14/09/23
Classes#
an object to hold and calculate kendall trends assumes a pandas dataframe or series with a time index |
|
an object to hold and calculate seasonal kendall trends |
Module Contents#
- class MannKendall(data, alpha=0.05, data_col=None, rm_na=True)[source]#
Bases:
object
an object to hold and calculate kendall trends assumes a pandas dataframe or series with a time index
- Parameters:
trend – the trend of the data, -1 decreasing, 0 no trend, 1 increasing
h – boolean, True if the trend is significant
p – the p value of the trend
z – the z value of the trend
s – the s value of the trend
var_s – the variance of the s value
alpha – the alpha value used to calculate the trend
data – the data used to calculate the trend
data_col – the column of the data used to calculate the trend
- calc_senslope()[source]#
calculate the senslope of the data
- Returns:
senslope, senintercept, lo_slope, up_slope
- class SeasonalKendall(df, data_col, season_col, alpha=0.05, rm_na=True, freq_limit=0.05)[source]#
Bases:
MannKendall
an object to hold and calculate seasonal kendall trends
- Parameters:
trend – the trend of the data, -1 decreasing, 0 no trend, 1 increasing
h – boolean, True if the trend is significant
p – the p value of the trend
z – the z value of the trend
s – the s value of the trend
var_s – the variance of the s value
alpha – the alpha value used to calculate the trend
data – the data used to calculate the trend
data_col – the column of the data used to calculate the trend
season_col – the column of the season data used to calculate the trend
freq_limit – the maximum difference in frequency between seasons (as a fraction), if greater than this will raise a warning
- calc_senslope()[source]#
calculate the senslope of the data :return: senslope, senintercept, lo_slope, lo_intercept