My current method allows me to determine the most accurate array but I cannot figure out a good way to display informative results.
Here’s my situation …
I compare X amount of integer arrays to a static integer array. For each position in the array I calculate the position’s accuracy result by comparing to the equivalent position in the static array. After the array’s last position accuracy result has been determined I store the sum of all accuracy results for that array for comparison at a later time.
Once each array’s sum of all accuracy results has been saved they are compared to one another. The array with the lowest sum is deemed the most accurate.
Pseudo code …
foreach (ComparableArray as SingleArray) {
for (i = 0; i < count(SingleArray); i++) {
AccuracyResults[SingleArray] += |StaticArray[i] - SingleArray[i]| / CONSTANT;
}
}
BestArray = AscendingSort(AccuracyResults)[0];
Accuracy is determined by taking the absolute value of the difference of the SingleArray value from the StaticArray and dividing by some constant. If accuracy result is < 1, then the result is deemed accurate. If result > 1, then it is inaccurate and results = 0 are perfect.
Here's a scenario ... let's use two arrays for simplicity
S = [ 56, 53, 50, 64 ]
A = [ 56, 54, 52, 64 ]
B = [ 54, 52, 51, 63 ]
Looping through each array starting with A.
Compare position [1] of A(56) and S(56) for accuracy. Determine accuracy (I'll use two for my constant) |56-56|=0, 0 / 2 = 0; Perfect accuracy
Continue to compare each position and compute accuracy |53-54|=1, 1 / 2 = 0.5; Accuracte because <= 1
|50-52|=2, 2 / 2 = 1; Accurate
|64-64| = 0; Perfect
Now compute the sum of all accuray results for array A 0 + 0.5 + 1 + 0 = 1.5
If we do the same operations for array B the final result will be 1 + 0.5 + 0.5 + 0.5 = 2.5
Now if we compare array A to B we can see that array A is more accurate than B because the sum is lower.
The problem is 1.5 and 2.5 are not very meaningful when trying to display how much more accurate A is to B.
What would be the best method to display these results? I thought about displaying percentages … such as A is 17% better than B. Or the BestArray is 6% better than average.
How would I compute those results?
Do you see any logic problems in my way of computing accuracy or know of a better way?
Thanks for any insight you can provide!