- Timestamp:
- 12/19/14 12:46:06 (10 years ago)
- Location:
- branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/EnumerableStatisticsExtension.cs
r11375 r11699 35 35 double x = values.Average(); 36 36 int n = values.Count(); 37 double t = alglib. studenttdistribution(n - 1, 1 - (alpha / 2));37 double t = alglib.invstudenttdistribution(n - 1, (1.0 - alpha) / 2.0); 38 38 39 lower = x -t * (s / Math.Sqrt(n));40 upper = x +t * (s / Math.Sqrt(n));39 lower = x + t * (s / Math.Sqrt(n)); 40 upper = x - t * (s / Math.Sqrt(n)); 41 41 42 42 return new Tuple<double, double>(lower, upper); 43 43 } 44 45 // Bessel corrected variance46 public static double EstimatedVariance(this IEnumerable<double> values) {47 double n = values.Count();48 return values.Variance() * n / (n - 1);49 }50 51 // Bessel corrected standard deviation52 public static double EstimatedStandardDeviation(this IEnumerable<double> values) {53 double n = values.Count();54 return values.StandardDeviation() * n / (n - 1);55 }56 44 } 57 45 } -
branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/KruskalWallisTest.cs
r11692 r11699 22 22 using System; 23 23 using System.Collections.Generic; 24 using HeuristicLab.Common; 24 25 25 26 namespace HeuristicLab.Analysis.Statistics { … … 51 52 int cnt = 0; 52 53 for (int i = 0; i < r.Length; i++) { 53 if (lastG == g[i]) {54 if (lastG.IsAlmost(g[i])) { 54 55 curSum += r[i]; 55 56 cnt++; … … 116 117 117 118 for (int i = 1; i < x.Length; i++) { 118 if ( last != x[i]) {119 if (!last.IsAlmost(x[i])) { 119 120 number.Add(x[i]); 120 121 last = x[i]; -
branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/LinearLeastSquaresFitting.cs
r11375 r11699 53 53 54 54 public double CalculateError(double[] dataPoints, double p0, double p1) { 55 double r = 0.0;55 double r; 56 56 double avgy = dataPoints.Average(); 57 57 double sstot = 0.0; -
branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/LogFitting.cs
r11375 r11699 26 26 public class LogFitting : IFitting { 27 27 private void LogFunc(double[] c, double[] x, ref double func, object obj) { 28 func = c[0] * System.Math.Exp(c[1] / x[0]);28 func = c[0] * Math.Exp(c[1] / x[0]); 29 29 } 30 30 … … 74 74 75 75 for (int i = 0; i < stdX.Count(); i++) { 76 newRow.Values.Add(c0 * System.Math.Exp(c1 / stdX[i]));76 newRow.Values.Add(c0 * Math.Exp(c1 / stdX[i])); 77 77 } 78 78 … … 86 86 87 87 for (int i = 0; i < x.Count(); i++) { 88 newRow.Values.Add(c0 * System.Math.Exp(c1 / x[i]));88 newRow.Values.Add(c0 * Math.Exp(c1 / x[i])); 89 89 } 90 90 -
branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/SampleSizeDetermination.cs
r11692 r11699 38 38 var confInterval = samples.ConfidenceIntervals(0.95); 39 39 double e = (confInterval.Item2 - confInterval.Item1) / 2; 40 double s = samples. EstimatedStandardDeviation();40 double s = samples.StandardDeviation(); 41 41 double z = alglib.invnormaldistribution((conf + 1) / 2); 42 42 double n = samples.Count(); … … 56 56 var confInterval = samples.ConfidenceIntervals(0.95); 57 57 double e = (confInterval.Item2 - confInterval.Item1) / 2; 58 double s = samples. EstimatedStandardDeviation();58 double s = samples.StandardDeviation(); 59 59 double z = alglib.invnormaldistribution((conf + 1) / 2); 60 60
Note: See TracChangeset
for help on using the changeset viewer.