Mann Kendall Test - Sen's Slope

Hello,
Here is the non parametric Mann-Kendall Test and Sen’s slope for Julia:
https://github.com/mixstam1821/Mann_Kendall.jl/blob/main/Mann_Kendall.jl

As you can see input/output is sth like this:
julia> mk(x,y)
(reject_null_hypothesis = false, p_value = 0.4369827573849885, Tau = -0.02374739039665971, slope = -7.613151196044908e-5, intercept = 0.5150870782436969)

BUT, the issue now is that when my dataset is too large this function is too slow or give OutOfMemory Error. Too large i mean the length is ~10,000 in 1GB RAM, or 200,000 for 32 GB.

However, with the same length, the GLM.jl [ lm = fit(LinearModel, @formula(y ~ x),df) ] works fine !
So, i think that with some way, someone, can modify this function in order to win these memory issues.
I would greatly appreciate if anyone could find a solution to this.

Cheers, Michael

3 Likes