[37] | 1 | function [y,z,w] = analyze(a,fo) |
---|
| 2 | % a is a matrix with experimental results. Each row indicates the results for |
---|
| 3 | % one matrix. The first five columns are the iterative algorithm with random |
---|
| 4 | % starting points. The sixth column is my algorithm. The seventh, mine |
---|
| 5 | % followed by the iterative, the 8th is ground truth, the ninth is ground truth |
---|
| 6 | % followed by the iterative one. |
---|
| 7 | % fo is the fraction of elements that are expected to be missing. |
---|
| 8 | % |
---|
| 9 | % y is (weighted) average, z is percentage achieving min_val, |
---|
| 10 | % w is standard dev. |
---|
| 11 | % |
---|
| 12 | a = round(10000.*a)./10000; |
---|
| 13 | ab = abs(a); |
---|
| 14 | fp = 1 - fo; |
---|
| 15 | numexps = size(ab,1); |
---|
| 16 | rank3 = sum(ab(:,6))/(numexps *fp); |
---|
| 17 | rank3_it = sum(ab(:,7))/(numexps *fp); |
---|
| 18 | gt = sum(ab(:,8))/(numexps *fp); |
---|
| 19 | gt_it = sum(ab(:,9))/(numexps *fp); |
---|
| 20 | |
---|
| 21 | randmat = ab(:,1:5); |
---|
| 22 | rand1 = manyrands(randmat, 1)/fp; |
---|
| 23 | rand3 = manyrands(randmat, 3)/fp; |
---|
| 24 | rand5 = manyrands(randmat, 5)/fp; |
---|
| 25 | |
---|
| 26 | y = [rand1, rand3, rand5, rank3, rank3_it, gt, gt_it]; |
---|
| 27 | w = [manyrands_dev(randmat,1)/fp, ... |
---|
| 28 | manyrands_dev(randmat,3)/fp, ... |
---|
| 29 | manyrands_dev(randmat,5)/fp, ... |
---|
| 30 | std(ab(:,6))/fp, ... |
---|
| 31 | std(ab(:,7))/fp, ... |
---|
| 32 | std(ab(:,8))/fp, ... |
---|
| 33 | std(ab(:,9))/fp]; |
---|
| 34 | % manyrands_dev(ab(:,6),1)/fp, ... |
---|
| 35 | % manyrands_dev(ab(:,7),1)/fp, ... |
---|
| 36 | % manyrands_dev(ab(:,8),1)/fp, ... |
---|
| 37 | % manyrands_dev(ab(:,9),1)/fp]; |
---|
| 38 | |
---|
| 39 | min_vals = (min(ab'))'; |
---|
| 40 | z = [manyrands_min(randmat,1,min_vals), manyrands_min(randmat,3,min_vals), ... |
---|
| 41 | manyrands_min(randmat,5,min_vals), manyrands_min(ab(:,7),1,min_vals), ... |
---|
| 42 | manyrands_min(ab(:,9),1,min_vals)]; |
---|
| 43 | |
---|