Changeset 11919 for stable/HeuristicLab.Analysis/3.3
- Timestamp:
- 02/05/15 17:29:35 (9 years ago)
- Location:
- stable
- Files:
-
- 4 edited
- 6 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 11703-11705,11715,11717,11725,11757,11837,11914
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Analysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Analysis merged: 11703,11914
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Analysis/3.3/DataVisualization/DataRow.cs
r11170 r11919 76 76 this.values = new ObservableList<double>(original.values); 77 77 } 78 public DataRow() : this("DataRow") { } 78 79 public DataRow(string name) 79 80 : base(name) { … … 116 117 OnVisualPropertiesChanged(); 117 118 } 119 protected override void OnNameChanged() { 120 base.OnNameChanged(); 121 VisualProperties.DisplayName = Name; 122 } 118 123 } 119 124 } -
stable/HeuristicLab.Analysis/3.3/HeuristicLab.Analysis-3.3.csproj
r11859 r11919 153 153 <Compile Include="QualityAnalysis\QualityDistributionAnalyzer.cs" /> 154 154 <Compile Include="QualityAnalysis\ScaledQualityDifferenceAnalyzer.cs" /> 155 <Compile Include="Statistics\BonferroniHolm.cs" /> 156 <Compile Include="Statistics\EnumerableStatisticsExtension.cs" /> 157 <Compile Include="Statistics\Fitting\ExpFitting.cs" /> 158 <Compile Include="Statistics\Fitting\IFitting.cs" /> 159 <Compile Include="Statistics\KruskalWallisTest.cs" /> 160 <Compile Include="Statistics\Fitting\LinearLeastSquaresFitting.cs" /> 161 <Compile Include="Statistics\Fitting\LogFitting.cs" /> 155 162 <Compile Include="Statistics\NormalDistribution.cs" /> 163 <Compile Include="Statistics\PairwiseTest.cs" /> 164 <Compile Include="Statistics\SampleSizeDetermination.cs" /> 156 165 <Compile Include="ValueAnalysis\SingleValueAnalyzer.cs" /> 157 166 <Compile Include="ValueAnalysis\MinAverageMaxValueAnalyzer.cs" /> -
stable/HeuristicLab.Analysis/3.3/Statistics/BonferroniHolm.cs
r11706 r11919 41 41 pValuesIndizes.Add(i, pValues[i]); 42 42 } 43 var sortedPValues = pValuesIndizes.OrderBy(x => x.Value) ;43 var sortedPValues = pValuesIndizes.OrderBy(x => x.Value).ToArray(); 44 44 45 45 for (int i = 1; i < k + 1; i++) { 46 46 alphaNiveau[i - 1] = globalAlpha / (k - i + 1); 47 int idx = sortedPValues .ElementAt(i - 1).Key;47 int idx = sortedPValues[i - 1].Key; 48 48 49 49 if (i == 1) { 50 50 //true means reject 51 decision[idx] = sortedPValues .ElementAt(i - 1).Value < alphaNiveau[i - 1];52 adjustedPValues[idx] = sortedPValues .ElementAt(i - 1).Value * (k - i + 1);51 decision[idx] = sortedPValues[i - 1].Value < alphaNiveau[i - 1]; 52 adjustedPValues[idx] = sortedPValues[i - 1].Value * (k - i + 1); 53 53 } else { 54 decision[idx] = decision[sortedPValues .ElementAt(i - 2).Key] ? (sortedPValues.ElementAt(i - 1).Value < alphaNiveau[i - 1]) : false;55 adjustedPValues[idx] = Math.Max(adjustedPValues[sortedPValues .ElementAt(i - 2).Key], sortedPValues.ElementAt(i - 1).Value * (k - i + 1));54 decision[idx] = decision[sortedPValues[i - 2].Key] && (sortedPValues[i - 1].Value < alphaNiveau[i - 1]); 55 adjustedPValues[idx] = Math.Max(adjustedPValues[sortedPValues[i - 2].Key], sortedPValues[i - 1].Value * (k - i + 1)); 56 56 } 57 57 if (adjustedPValues[idx] > 1.0) { -
stable/HeuristicLab.Analysis/3.3/Statistics/EnumerableStatisticsExtension.cs
r11706 r11919 28 28 public static class EnumerableStatisticExtensions { 29 29 public static Tuple<double, double> ConfidenceIntervals(this IEnumerable<double> values, double alpha) { 30 if (values.Count() <= 1) return new Tuple<double, double>(double.NaN, double.NaN); 30 return ConfidenceIntervals(values.ToArray(), alpha); 31 } 31 32 33 public static Tuple<double, double> ConfidenceIntervals(this double[] values, double alpha) { 32 34 double lower, upper; 35 int n = values.Length; 36 if (n <= 1) return new Tuple<double, double>(double.NaN, double.NaN); 37 33 38 double s = values.StandardDeviation(); 34 39 double x = values.Average(); 35 int n = values.Count();36 40 double t = alglib.invstudenttdistribution(n - 1, (1.0 - alpha) / 2.0); 37 41 -
stable/HeuristicLab.Analysis/3.3/Statistics/SampleSizeDetermination.cs
r11706 r11919 36 36 if (conf < 0.0 || conf > 1.0) throw new ArgumentException("The confidence interval must be between zero and one."); 37 37 38 var confInterval = samples.ConfidenceIntervals( 0.95);38 var confInterval = samples.ConfidenceIntervals(conf); 39 39 double e = (confInterval.Item2 - confInterval.Item1) / 2; 40 40 double s = samples.StandardDeviation(); … … 43 43 44 44 double result = Math.Pow(s, 2) / ((Math.Pow(e, 2) / Math.Pow(z, 2)) + (Math.Pow(s, 2) / n)); 45 46 result = Math.Ceiling(result);47 if (result > int.MaxValue)48 return int.MaxValue;49 else50 return (int)result;51 }52 53 public static int DetermineSampleSizeByEstimatingMeanForLargeSampleSizes(double[] samples, double conf = 0.95) {54 if (conf < 0.0 || conf > 1.0) throw new ArgumentException("The confidence interval must be between zero and one.");55 56 var confInterval = samples.ConfidenceIntervals(0.95);57 double e = (confInterval.Item2 - confInterval.Item1) / 2;58 double s = samples.StandardDeviation();59 double z = alglib.invnormaldistribution((conf + 1) / 2);60 61 double result = Math.Pow(z, 2) * (Math.Pow(s, 2) / Math.Pow(e, 2));62 45 63 46 result = Math.Ceiling(result);
Note: See TracChangeset
for help on using the changeset viewer.