Index: branches/HeuristicLab.OSGAEvaluator/HeuristicLab.OSGAEvaluator/SymbolicRegressionSingleObjectiveOSGAEvaluator.cs
===================================================================
--- branches/HeuristicLab.OSGAEvaluator/HeuristicLab.OSGAEvaluator/SymbolicRegressionSingleObjectiveOSGAEvaluator.cs	(revision 14585)
+++ branches/HeuristicLab.OSGAEvaluator/HeuristicLab.OSGAEvaluator/SymbolicRegressionSingleObjectiveOSGAEvaluator.cs	(revision 14608)
@@ -231,4 +231,5 @@
       if (UseFixedEvaluationIntervals) {
         double threshold = parentQuality * RelativeParentChildQualityThreshold;
+
         if (UseAdaptiveQualityThreshold) {
           var actualSelectionPressure = ActualSelectionPressureParameter.ActualValue;
@@ -248,54 +249,48 @@
         if (AggregateStatistics) {
           var trainingEnd = problemData.TrainingPartition.End;
-          var qualityPerInterval = new List<double>();
+
+          double quality = -1;
+          int intervalCount = 0, rejectionInterval = 0;
+          bool predictedRejected = false;
+
           while (estimatedEnumerator.MoveNext() & targetEnumerator.MoveNext()) {
             var estimated = estimatedEnumerator.Current;
             var target = targetEnumerator.Current;
-            rcalc.Add(estimated, target);
+            rcalc.Add(target, estimated);
             ++calculatedRows;
             if (calculatedRows % interval == 0 || calculatedRows == trainingPartitionSize) {
+              intervalCount++;
+              if (predictedRejected) continue;
               var r = rcalc.ErrorState == OnlineCalculatorError.None ? rcalc.R : 0d;
-              qualityPerInterval.Add(r * r);
-            }
-          }
-          double quality;
-          {
-            var r = rcalc.ErrorState != OnlineCalculatorError.None ? 0d : rcalc.R;
-            var actualQuality = r * r;
-            quality = actualQuality;
-            bool predictedRejected = false;
-
-            int i;
-
-            for (i = 0; i < qualityPerInterval.Count; ++i) {
-              var q = qualityPerInterval[i];
-              if (double.IsNaN(q) || !(q > threshold)) {
+              quality = r * r;
+              if (!(quality > threshold)) {
+                rejectionInterval = intervalCount - 1;
                 predictedRejected = true;
-                quality = q;
-                break;
               }
             }
-
-            var actuallyRejected = !(actualQuality > parentQuality);
-
-            if (RejectedStats.Rows == 0 || TotalStats.Rows == 0) {
-              RejectedStats = new IntMatrix(2, qualityPerInterval.Count + 1);
-              RejectedStats.RowNames = new[] { "Predicted", "Actual" };
-              RejectedStats.ColumnNames = Enumerable.Range(1, RejectedStats.Columns).Select(x => string.Format("0-{0}", Math.Min(trainingEnd, x * interval)));
-              TotalStats = new IntMatrix(2, 1);
-              TotalStats.RowNames = new[] { "Predicted", "Actual" };
-              TotalStats.ColumnNames = new[] { "Rejected" };
-            }
-
-            if (actuallyRejected) {
-              TotalStats[0, 0]++; // prediction true
-              TotalStats[1, 0]++;
-              RejectedStats[0, i]++;
-              RejectedStats[1, i]++;
-            } else {
-              if (predictedRejected) {
-                RejectedStats[0, i]++;
-                TotalStats[0, 0]++;
-              }
+          }
+          var actualQuality = rcalc.ErrorState == OnlineCalculatorError.None ? rcalc.R : 0d;
+          actualQuality *= actualQuality;
+
+          var actuallyRejected = !(actualQuality > parentQuality);
+
+          if (RejectedStats.Rows == 0 || TotalStats.Rows == 0) {
+            RejectedStats = new IntMatrix(2, intervalCount + 1);
+            RejectedStats.RowNames = new[] { "Predicted", "Actual" };
+            RejectedStats.ColumnNames = Enumerable.Range(1, RejectedStats.Columns).Select(x => string.Format("0-{0}", Math.Min(trainingEnd, x * interval)));
+            TotalStats = new IntMatrix(2, 1);
+            TotalStats.RowNames = new[] { "Predicted", "Actual" };
+            TotalStats.ColumnNames = new[] { "Rejected" };
+          }
+
+          if (actuallyRejected) {
+            TotalStats[0, 0]++; // prediction true
+            TotalStats[1, 0]++;
+            RejectedStats[0, rejectionInterval]++;
+            RejectedStats[1, rejectionInterval]++;
+          } else {
+            if (predictedRejected) {
+              RejectedStats[0, rejectionInterval]++;
+              TotalStats[0, 0]++;
             }
           }
