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