Skip to main content

Diebold Mariano test

Project description

Diebold Mariano Test 工具包

Python package PyPI version Python

特点

通过DM检验的结果,可以判别任意两类算法的预测结果是否存在差异性。

安装

pip install diebold-mariano-test

更新

pip install --upgrade diebold-mariano-test

使用说明

>>> # 导入包
>>> from diebold_mariano_test import *

>>> ori_list = [3, 5, 4, 1]  # 原始时间序列数据
>>> a1_list = [2, 3, 4, 2]  # 预测算法一得到的时间序列数据
>>> a2_list = [3, 2, 2, 4]  # 预测算法二得到的时间序列数据

>>> # 使用MSE方法计算 Diebold-Mariano Test.
>>> d_t_list = cul_d_t(MSE, ori_list, a1_list, a2_list)
>>> print(d_t_list)  # 输出中间变量d_t的数值。 
[1, -4, -8, -16]
>>> cul_DM(d_t_list)  # 输出结果
-2.254898764780173
>>> cul_P(d_t_list) # 输出伴随的P值
0.024139683878213303

>>> # 使用MAE方法计算 Diebold-Mariano Test.
>>> d_t_list = cul_d_t(MAE, ori_list, a1_list, a2_list)
>>> print(d_t_list)  # 输出中间变量d_t的数值。 
[1, 0, -2, -4]
>>> cul_DM(d_t_list)  # 输出结果
-1.4213381090374029
>>> cul_P(d_t_list) # 输出伴随的P值
0.155218489684684

说明

项目发布于PyPI:单击访问

本模块尚不完善,有任何相关问题或建议,欢迎在本项目的github页面中提交issue: 单击访问

License

GNU General Public License v3.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diebold-mariano-test-0.0.8.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

diebold_mariano_test-0.0.8-py3-none-any.whl (16.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page