Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.Designer.cs	(revision 12492)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.Designer.cs	(revision 12493)
@@ -46,9 +46,10 @@
     private void InitializeComponent() {
       this.components = new System.ComponentModel.Container();
-      System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
-      System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
+      System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+      System.Windows.Forms.DataVisualization.Charting.Legend legend2 = new System.Windows.Forms.DataVisualization.Charting.Legend();
       this.chart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart();
       this.label1 = new System.Windows.Forms.Label();
       this.cmbSamples = new System.Windows.Forms.ComboBox();
+      this.residualComboBox = new System.Windows.Forms.ComboBox();
       ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
       this.SuspendLayout();
@@ -56,13 +57,13 @@
       // chart
       // 
-      this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-                  | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
-      chartArea1.Name = "ChartArea1";
-      this.chart.ChartAreas.Add(chartArea1);
-      legend1.Alignment = System.Drawing.StringAlignment.Center;
-      legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
-      legend1.Name = "Legend1";
-      this.chart.Legends.Add(legend1);
+      this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      chartArea2.Name = "ChartArea1";
+      this.chart.ChartAreas.Add(chartArea2);
+      legend2.Alignment = System.Drawing.StringAlignment.Center;
+      legend2.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
+      legend2.Name = "Legend1";
+      this.chart.Legends.Add(legend2);
       this.chart.Location = new System.Drawing.Point(6, 28);
       this.chart.Name = "chart";
@@ -92,7 +93,22 @@
       this.cmbSamples.SelectedIndexChanged += new System.EventHandler(this.cmbSamples_SelectedIndexChanged);
       // 
+      // residualComboBox
+      // 
+      this.residualComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+      this.residualComboBox.FormattingEnabled = true;
+      this.residualComboBox.Items.AddRange(new object[] {
+            "Absolute error",
+            "Squared error",
+            "Relative error"});
+      this.residualComboBox.Location = new System.Drawing.Point(183, 3);
+      this.residualComboBox.Name = "residualComboBox";
+      this.residualComboBox.Size = new System.Drawing.Size(121, 21);
+      this.residualComboBox.TabIndex = 5;
+      this.residualComboBox.SelectedIndexChanged += new System.EventHandler(this.residualComboBox_SelectedIndexChanged);
+      // 
       // RegressionSolutionErrorCharacteristicsCurveView
       // 
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.residualComboBox);
       this.Controls.Add(this.label1);
       this.Controls.Add(this.cmbSamples);
@@ -111,4 +127,5 @@
     protected System.Windows.Forms.Label label1;
     protected System.Windows.Forms.ComboBox cmbSamples;
+    protected System.Windows.Forms.ComboBox residualComboBox;
   }
 }
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs	(revision 12492)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs	(revision 12493)
@@ -25,4 +25,5 @@
 using System.Windows.Forms;
 using System.Windows.Forms.DataVisualization.Charting;
+using HeuristicLab.Common;
 using HeuristicLab.MainForm;
 
@@ -45,6 +46,8 @@
       cmbSamples.SelectedIndex = 0;
 
+      residualComboBox.SelectedIndex = 0;
+
       chart.CustomizeAllChartAreas();
-      chart.ChartAreas[0].AxisX.Title = "Absolute Error";
+      chart.ChartAreas[0].AxisX.Title = residualComboBox.SelectedItem.ToString();
       chart.ChartAreas[0].AxisX.Minimum = 0.0;
       chart.ChartAreas[0].AxisX.Maximum = 0.0;
@@ -109,4 +112,6 @@
 
       AddRegressionSolution(Content);
+
+      chart.ChartAreas[0].AxisX.Title = residualComboBox.SelectedItem.ToString();
     }
 
@@ -119,11 +124,8 @@
       var residuals = GetResiduals(GetOriginalValues(), GetEstimatedValues(solution));
 
-
       var maxValue = residuals.Max();
-      if (maxValue >= chart.ChartAreas[0].AxisX.Maximum) {
-        double scale = Math.Pow(10, Math.Floor(Math.Log10(maxValue)));
-        var maximum = scale * (1 + (int)(maxValue / scale));
-        chart.ChartAreas[0].AxisX.Maximum = maximum;
-      }
+      double scale = Math.Pow(10, Math.Floor(Math.Log10(maxValue)));
+      var maximum = scale * (1 + (int)(maxValue / scale));
+      chart.ChartAreas[0].AxisX.Maximum = maximum;
       chart.ChartAreas[0].CursorX.Interval = residuals.Min() / 100;
 
@@ -203,5 +205,13 @@
 
     protected virtual List<double> GetResiduals(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues) {
-      return originalValues.Zip(estimatedValues, (x, y) => Math.Abs(x - y)).ToList();
+      switch (residualComboBox.SelectedItem.ToString()) {
+        case "Absolute error": return originalValues.Zip(estimatedValues, (x, y) => Math.Abs(x - y)).ToList();
+        case "Squared error": return originalValues.Zip(estimatedValues, (x, y) => (x - y) * (x - y)).ToList();
+        case "Relative error": return originalValues.Zip(estimatedValues, (x, y) => x.IsAlmost(0.0) ? -1 : Math.Abs((x - y) / x))
+          .Where(x => x > 0) // remove entries where the original value is 0
+          .ToList();
+      }
+      // should never happen
+      return new List<double>();
     }
 
@@ -251,4 +261,8 @@
       }
     }
+
+    private void residualComboBox_SelectedIndexChanged(object sender, EventArgs e) {
+      UpdateChart();
+    }
   }
 }
