0

Here are the errors of my proposed algorithm and the benchmark algorithm:

>> [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

Here are the results when I run the Wilcoxon signed rank test:

>> [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

But I think the result is contradictory, as the number of losses is so much P should have been very small. Yet here P is 1.

Dang Manh Truong
  • 795
  • 2
  • 10
  • 35
  • 1
    I suggested the above duplicate because it seems to me that you have many equal elements, yet your `Equal` computation yields 0. This is because of floating-point error, as described in the linked Q&A. – Cris Luengo Oct 13 '18 at 14:20

1 Answers1

1

signrank(x,y) tests for the hypothesis that x-y has zero mean. p=1 means that with certainity 1 (=100%) you cannot accept the test hypothesis, meanning that x an y differ (regardless if x>y or x less than y).

if you want to test whether x>y, you should use

signrank(x,y,'tail','right')

otherwise (for x less than y)

signrank(x,y,'tail','left')