时间序列趋势判断(三)——Mann-Kendall趋势检验

为了便于理解,可以参考B站的一个视频:https://www.bilibili.com/video/BV1tr4y1y7it

示例代码

为了简便,我们这里使用第三方库:

安装方法:

pip install pymannkendall

pyMannKendall github地址:https://github.com/mmhs013/pyMannKendall

使用的代码如下:

import numpy as np


def mk_test(data):
    """MK检验
    """
    import pymannkendall

    result = pymannkendall.original_test(data)
    return result.trend


if __name__ == '__main__':
    data = np.array([1, 2, 3, 4, 3, 5, 5, 7, 4, 7, ])
    print(mk_test(data))

参考文章

时间序列分析之趋势判断:https://www.biaodianfu.com/detect-trend-increasing-or-decreasing-in-time-series.html#%E6%96%B9%E6%A1%88%E5%9B%9B%EF%BC%9AMannKendall%E8%B6%8B%E5%8A%BF%E6%A3%80%E9%AA%8C%E6%B3%95

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

呆萌的代Ma

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值