Пример #1
0
 /// @return double	t-test confidence level with data accumulated
 ///											in the supplied moments.
 /// The variance of both sets is assumed to be the same.
 /// @param m DhbStatistics.StatisticalMoments
 public double TConfidenceLevel(StatisticalMoments m)
 {
     int dof = (int)(Count + m.Count - 2);
     double sbar = System.Math.Sqrt((UnnormalizedVariance
                                 + m.UnnormalizedVariance) / dof);
     var tDistr = new StudentDistribution(dof);
     return tDistr.ConfidenceLevel((Average - m.Average)
                                     / (sbar * System.Math.Sqrt(1.0 / Count
                                                     + 1.0 / m.Count)));
 }
Пример #2
0
 /// @return double	t-test confidence level with data accumulated
 ///											in the supplied moments.
 /// Approximation for the case where the variance of both sets may
 ///															differ.
 /// @param m DhbStatistics.StatisticalMoments
 public double TApproximateConfidenceLevel(StatisticalMoments m)
 {
     var tDistr = new StudentDistribution(
                                         (int)(Count + m.Count - 2));
     return tDistr.ConfidenceLevel((Average / StandardDeviation
                                         - m.Average
                                         / m.StandardDeviation)
                                         / System.Math.Sqrt(1 / Count
                                                     + 1 / m.Count));
 }