Skip to content

Commit 1a38175

Browse files
author
Alex Peck
committed
fix measurementstats
1 parent ae3c592 commit 1a38175

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

BitFaster.Caching.ThroughputAnalysis/MeasurementsStatistics.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ public static MeasurementsStatistics Calculate(List<double> measurements, Outlie
4242
double variance = Variance(measurements, n, mean);
4343
double standardDeviation = Math.Sqrt(variance);
4444
double standardError = standardDeviation / Math.Sqrt(n);
45-
var confidenceInterval = new ConfidenceInterval(mean, standardError, n);
45+
var confidenceIntervalEstimator = new ConfidenceIntervalEstimator(n, mean, standardError);
46+
var confidenceInterval = confidenceIntervalEstimator.ConfidenceInterval(ConfidenceLevel.L999);
4647

4748
if (outlierMode == OutlierMode.DontRemove) // most simple scenario is done without allocations! but this is not the default case
4849
return new MeasurementsStatistics(standardError, mean, confidenceInterval);
@@ -69,7 +70,8 @@ public static MeasurementsStatistics Calculate(List<double> measurements, Outlie
6970
variance = VarianceWithoutOutliers(outlierMode, measurements, n, mean, lowerFence, upperFence);
7071
standardDeviation = Math.Sqrt(variance);
7172
standardError = standardDeviation / Math.Sqrt(n);
72-
confidenceInterval = new ConfidenceInterval(mean, standardError, n);
73+
confidenceIntervalEstimator = new ConfidenceIntervalEstimator(n, mean, standardError);
74+
confidenceInterval = confidenceIntervalEstimator.ConfidenceInterval(ConfidenceLevel.L999);
7375

7476
return new MeasurementsStatistics(standardError, mean, confidenceInterval);
7577
}

0 commit comments

Comments
 (0)