Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Matlab符号秩函数中的矛盾结果(Wilcoxon符号秩检验)_Matlab_Hypothesis Test - Fatal编程技术网

Matlab符号秩函数中的矛盾结果(Wilcoxon符号秩检验)

Matlab符号秩函数中的矛盾结果(Wilcoxon符号秩检验),matlab,hypothesis-test,Matlab,Hypothesis Test,以下是我提出的算法和基准算法的错误: >> [algo_err benchmark_err] ans = 0.3000 0.2000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.2000 0.1000 0.1000 0.1000 0.1000

以下是我提出的算法和基准算法的错误:

>> [algo_err benchmark_err]

ans =

    0.3000    0.2000
    0.1000    0.1000
    0.1000    0.1000
    0.1000    0.1000
    0.1000    0.1000
    0.1000    0.1000
    0.1000    0.2000
    0.1000    0.1000
    0.1000    0.1000
    0.2000    0.2000
    0.2000    0.2000
    0.1000    0.1000
    0.1000    0.1000
    0.1000    0.1000
    0.1000    0.1000
    0.1000    0.1000
    0.1000    0.1000
    0.1000    0.1000
    0.1000    0.1000
    0.2000    0.3000
    0.2000    0.2000
    0.1000    0.1000
    0.1000    0.1000
    0.1000    0.2000
    0.1000    0.1000
    0.2000    0.1000
    0.1000    0.1000
    0.1000    0.1000
    0.2000    0.1000
    0.2000    0.2000
以下是我运行Wilcoxon符号秩检验时的结果:

>> [P,H] = signrank(algo_err,benchmark_err);
>> P

P =

     1

>> Win = sum(algo_err < benchmark_err)

Win =

     3

>> Equal = sum(algo_err == benchmark_err)

Equal =

     0

>> Loss = sum(algo_err > benchmark_err)

Loss =

    27
>[P,H]=signrank(算法错误,基准错误);
>>P
P=
1.
>>Win=总和(算法错误<基准错误)
赢=
3.
>>相等=和(算法错误==基准错误)
相等的=
0
>>损失=总和(算法错误>基准错误)
损失=
27
但我认为结果是矛盾的,因为损失的数量如此之多,p本应该非常小。然而这里P是1。

signrank(x,y)检验x-y具有零均值的假设。 p=1意味着在确定性为1(=100%)的情况下,您无法接受测试 假设,意味着x和y不同(不管x>y还是x小于y)

如果要测试x是否大于y,应该使用

signrank(x,y,'tail','right')
否则(对于x小于y)


我建议使用上面的副本,因为在我看来,您有许多相等的元素,但是您的
equal
计算结果为0。这是因为浮点错误,如链接问答中所述。
signrank(x,y,'tail','left')