Index: /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views-3.3.csproj
===================================================================
--- /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views-3.3.csproj	(revision 9327)
+++ /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views-3.3.csproj	(revision 9328)
@@ -119,4 +119,5 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="SampleSizeDetermination.cs" />
     <Compile Include="StatisticalTestingView.cs">
       <SubType>UserControl</SubType>
Index: /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/ResultCorrelationView.cs
===================================================================
--- /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/ResultCorrelationView.cs	(revision 9327)
+++ /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/ResultCorrelationView.cs	(revision 9328)
@@ -162,5 +162,10 @@
         var resultVals = runs.Where(x => x.Results.ContainsKey(resultName)).Where(x => x.Results[resultName] is DoubleValue).Select(x => ((DoubleValue)x.Results[resultName]).Value);
 
-        if (resultVals.Contains(double.NaN) || resultRowVals.Contains(double.NaN)) {
+        if (resultVals.Contains(double.NaN)
+          || resultRowVals.Contains(double.NaN)
+          || resultVals.Contains(double.NegativeInfinity)
+          || resultVals.Contains(double.PositiveInfinity)
+          || resultRowVals.Contains(double.NegativeInfinity)
+          || resultRowVals.Contains(double.PositiveInfinity)) {
           dt[j, 0] = "X";
           dt[j++, 1] = "X";
Index: /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/SampleSizeDetermination.cs
===================================================================
--- /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/SampleSizeDetermination.cs	(revision 9328)
+++ /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/SampleSizeDetermination.cs	(revision 9328)
@@ -0,0 +1,87 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Linq;
+using HeuristicLab.Common;
+
+namespace HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views {
+  public class SampleSizeDetermination {
+    /// <summary>
+    /// Determines for a given sample the sample size by estimating the means. 
+    /// </summary>
+    /// <param name="samples">The pilot sample.</param>
+    /// <param name="e">Precision. Default precision is 1%. </param>
+    /// <param name="conf">Confidence Interval.</param>
+    /// <returns>Number of required samples for the given confidence interval and precision. </returns>
+    public static int DetermineSampleSizeByEstimatingMean(double[] samples, double e = 0.01, double conf = 0.95) {
+      if (e < 0) throw new ArgumentException("e needs to be a positive number.");
+      if (conf < 0 || conf > 1) throw new ArgumentException("The confidence Interval must be between zero and one.");
+      double result = 0;
+
+      double var = samples.Variance();
+      double n = alglib.normaldistribution((conf + 1) / 2);
+      result = Math.Pow(n, 2) * Math.Pow(var, 2) / Math.Pow(e, 2);
+      return (int)Math.Ceiling(result);
+    }
+
+    /// <summary>
+    /// Calculates Cohen's d.
+    /// </summary>
+    /// <returns>Cohen's d. 
+    /// d = 0.2 means small effect
+    /// d = 0.5 means average effect
+    /// d = 0.8 means big effect
+    /// According to Wikipedia this means: "A lower Cohen's d indicates a necessity of larger sample sizes, and vice versa."
+    /// </returns>
+    public static double CohensD(double[] d1, double[] d2) {
+      double x1, x2, s1, s2;
+
+      x1 = d1.Average();
+      x2 = d2.Average();
+      s1 = d1.Variance();
+      s2 = d2.Variance();
+
+      return (x1 - x2) / Math.Sqrt((s1 + s2) / 2);
+    }
+
+    /// <summary>
+    /// Calculates Hedges' g.
+    /// </summary>
+    /// <returns>Hedges' g</returns>
+    public static double HedgesG(double[] d1, double[] d2) {
+      double x1, x2, s1, s2, n1, n2, s, g, c;
+
+      x1 = d1.Average();
+      x2 = d2.Average();
+      s1 = d1.Variance();
+      s2 = d2.Variance();
+      n1 = d1.Count();
+      n2 = d2.Count();
+
+      s = Math.Sqrt(((n1 - 1) * s1 + (n2 - 1) * s2) / (n1 + n2 - 2));
+      g = (x1 - x2) / s;
+      c = (1 - (3 / (4 * (n1 + n2) - 9))) * g;
+
+      return c;
+    }
+  }
+}
