Index: /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/BonferroniHolm.cs
===================================================================
--- /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/BonferroniHolm.cs	(revision 10016)
+++ /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/BonferroniHolm.cs	(revision 10017)
@@ -26,4 +26,9 @@
 namespace HeuristicLab.Analysis.Statistics {
   public static class BonferroniHolm {
+    /// <summary>
+    /// Based on David Groppe's MATLAB implementation 
+    /// (BSD Licensed, see 
+    /// http://www.mathworks.com/matlabcentral/fileexchange/28303-bonferroni-holm-correction-for-multiple-comparisons)
+    /// </summary>
     public static double[] Calculate(double globalAlpha, double[] pValues, out bool[] h) {
       int k = pValues.Length;
Index: /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/EnumerableStatisticsExtension.cs
===================================================================
--- /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/EnumerableStatisticsExtension.cs	(revision 10016)
+++ /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/EnumerableStatisticsExtension.cs	(revision 10017)
@@ -29,4 +29,6 @@
   public static class EnumerableStatisticExtensions {
     public static Tuple<double, double> ConfidenceIntervals(this IEnumerable<double> values, double alpha) {
+      if (values.Count() <= 1) return new Tuple<double, double>(double.NaN, double.NaN);
+
       double lower, upper;
       double s = values.StandardDeviation();
@@ -40,4 +42,16 @@
       return new Tuple<double, double>(lower, upper);
     }
+
+    // Bessel corrected variance
+    public static double EstimatedVariance(this IEnumerable<double> values) {
+      double n = values.Count();
+      return values.Variance() * n / (n - 1);
+    }
+
+    // Bessel corrected standard deviation
+    public static double EstimatedStandardDeviation(this IEnumerable<double> values) {
+      double n = values.Count();
+      return values.StandardDeviation() * n / (n - 1);
+    }
   }
 }
Index: /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/KruskalWallis.cs
===================================================================
--- /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/KruskalWallis.cs	(revision 10016)
+++ /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/KruskalWallis.cs	(revision 10017)
@@ -27,5 +27,5 @@
     /// <summary>
     /// Performs the Kruskal-Wallis test and returns the p-Value. 
-    /// (source based on R's kruskal.test())
+    /// (source based on R's kruskal.test(), GNU GPL)
     /// </summary>
     public static double Test(double[][] data) {
Index: /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/LinearLeastSquaresFitting.cs
===================================================================
--- /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/LinearLeastSquaresFitting.cs	(revision 10016)
+++ /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/LinearLeastSquaresFitting.cs	(revision 10017)
@@ -39,5 +39,5 @@
       int n = y.Count();
       double sy = y.Sum();
-      double sx = ((n - 1) * n) / 2;
+      double sx = ((n - 1) * n) / 2.0;
       double avgy = sy / n;
       double avgx = sx / n;
Index: /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/SampleSizeDetermination.cs
===================================================================
--- /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/SampleSizeDetermination.cs	(revision 10016)
+++ /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/SampleSizeDetermination.cs	(revision 10017)
@@ -32,15 +32,33 @@
     /// <param name="samples">The pilot sample.</param>
     /// <param name="conf">Confidence Interval.</param>
-    /// <returns>Number of required samples for the given confidence interval and precision. </returns>
+    /// <returns>Number of required samples for the given confidence interval. </returns>
     public static int DetermineSampleSizeByEstimatingMean(double[] samples, double conf = 0.95) {
-      if (conf < 0 || conf > 1) throw new ArgumentException("The confidence Interval must be between zero and one.");
+      if (conf < 0.0 || conf > 1.0) throw new ArgumentException("The confidence interval must be between zero and one.");
 
       var confInterval = samples.ConfidenceIntervals(0.95);
       double e = (confInterval.Item2 - confInterval.Item1) / 2;
-      double s = samples.StandardDeviation();
+      double s = samples.EstimatedStandardDeviation();
       double z = alglib.invnormaldistribution((conf + 1) / 2);
       double n = samples.Count();
 
       double result = Math.Pow(s, 2) / ((Math.Pow(e, 2) / Math.Pow(z, 2)) + (Math.Pow(s, 2) / n));
+
+      result = Math.Ceiling(result);
+      if (result > int.MaxValue)
+        return int.MaxValue;
+      else
+        return (int)result;
+    }
+
+    public static int DetermineSampleSizeByEstimatingMeanForLargeSampleSizes(double[] samples, double conf = 0.95) {
+      if (conf < 0.0 || conf > 1.0) throw new ArgumentException("The confidence interval must be between zero and one.");
+
+      var confInterval = samples.ConfidenceIntervals(0.95);
+      double e = (confInterval.Item2 - confInterval.Item1) / 2;
+      double s = samples.EstimatedStandardDeviation();
+      double z = alglib.invnormaldistribution((conf + 1) / 2);
+      double n = samples.Count();
+
+      double result = Math.Pow(z, 2) * (Math.Pow(s, 2) / Math.Pow(e, 2));
 
       result = Math.Ceiling(result);
Index: /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/SampleSizeInfluenceView.Designer.cs
===================================================================
--- /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/SampleSizeInfluenceView.Designer.cs	(revision 10016)
+++ /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/SampleSizeInfluenceView.Designer.cs	(revision 10017)
@@ -163,8 +163,8 @@
       this.sampleSizeTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-      this.sampleSizeTextBox.Location = new System.Drawing.Point(401, 3);
+      this.sampleSizeTextBox.Location = new System.Drawing.Point(400, 3);
       this.sampleSizeTextBox.Name = "sampleSizeTextBox";
       this.sampleSizeTextBox.ReadOnly = true;
-      this.sampleSizeTextBox.Size = new System.Drawing.Size(139, 20);
+      this.sampleSizeTextBox.Size = new System.Drawing.Size(140, 20);
       this.sampleSizeTextBox.TabIndex = 26;
       // 
Index: /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/SampleSizeInfluenceView.cs
===================================================================
--- /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/SampleSizeInfluenceView.cs	(revision 10016)
+++ /branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/SampleSizeInfluenceView.cs	(revision 10017)
@@ -256,5 +256,5 @@
       if (yValue.Any(x => !x.HasValue)) return;
 
-      double y = SampleSizeDetermination.DetermineSampleSizeByEstimatingMean(yValue.Select(x => x.Value).ToArray());
+      double y = SampleSizeDetermination.DetermineSampleSizeByEstimatingMeanForLargeSampleSizes(yValue.Select(x => x.Value).ToArray());
       sampleSizeTextBox.Text = y.ToString();
     }
@@ -315,12 +315,10 @@
       }
       matrix.ColumnNames = columnNames;
-      matrix.RowNames = new string[] { "Count", "Minimum", "Maximum", "Average", "Median", "Standard Deviation", "Variance", "25th Percentile", "75th Percentile", "Lower Confidence", "Upper Confidence" };
+      matrix.RowNames = new string[] { "Count", "Minimum", "Maximum", "Average", "Median", "Standard Deviation", "Variance", "25th Percentile", "75th Percentile", "Lower Confidence Int.", "Upper Confidence Int." };
 
       for (int i = 0; i < seriesCache.Count; i++) {
         Series series = seriesCache.ElementAt(i).Value;
         double[] seriesValues = series.Points.Select(p => p.YValues[0]).OrderBy(d => d).ToArray();
-        Tuple<double, double> confIntervals = new Tuple<double, double>(double.NaN, double.NaN);
-        if (seriesValues.Count() > 1)
-          confIntervals = seriesValues.ConfidenceIntervals(0.95);
+        Tuple<double, double> confIntervals = seriesValues.ConfidenceIntervals(0.95);
         matrix[0, i] = seriesValues.Length;
         matrix[1, i] = seriesValues.Min();
Index: /branches/StatisticalTesting/Statistics.UnitTests/BonferroniHolmUnitTest.cs
===================================================================
--- /branches/StatisticalTesting/Statistics.UnitTests/BonferroniHolmUnitTest.cs	(revision 10016)
+++ /branches/StatisticalTesting/Statistics.UnitTests/BonferroniHolmUnitTest.cs	(revision 10017)
