Skip to contents

Calculates the Sen-Theil estimator (α) of trend magnitude from the Generalized Mann-Kendall test, representing the median slope between all pairs of points.

Usage

get_MKalpha(X, level = 0.1, time_dependency_option = "AR1")

Arguments

X

Numeric vector of values to analyze

level

numeric in (0,1), level of the test.

time_dependency_option

string, option for handling temporal dependence. Available :

  1. 'INDE', assume independence (i.e. the standard MK test)

  2. 'AR1', assumes AR1 short-term dependence structure (i.e. Hamed and Rao's version of the MK test)

  3. 'LTP', assume long-term persistence (i.e. Hamed's version of the MK test)

Value

Numeric value representing the Sen-Theil slope estimate (α) in units of X/time.

  • Positive value indicates increasing trend

  • Negative value indicates decreasing trend

  • Zero indicates no trend

Details

The Sen-Theil estimator:

  • Non-parametric median of all pairwise slopes: \(\alpha = median\left(\frac{X_j - X_i}{j-i}\right)\) for all i < j

  • Robust to outliers and missing values

  • Measures trend magnitude in original units/time

See also

GeneralMannKendall for the full test implementation

Examples

data(streamflow)
#> Warning: data set ‘streamflow’ not found
# Get trend slope in m³/s per time unit
trend_slope <- get_MKalpha(streamflow$Q)
#> Error: object 'streamflow' not found
print(paste("Trend slope:", round(trend_slope, 4), "m³/s per time unit"))
#> Error: object 'trend_slope' not found