Changeset 13051
- Timestamp:
- 10/22/15 19:12:29 (9 years ago)
- Location:
- trunk/sources
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Analysis.Statistics.Views/3.3/ChartAnalysisView.cs
r12631 r13051 313 313 double stdDev = values.StandardDeviation(); 314 314 double variance = values.Variance(); 315 double percentile25 = values. Percentile(0.25);316 double percentile75 = values. Percentile(0.75);315 double percentile25 = values.Quantile(0.25); 316 double percentile75 = values.Quantile(0.75); 317 317 double lowerAvg = values.Count() > 4 ? values.OrderBy(x => x).Take((int)(values.Count() * 0.25)).Average() : double.NaN; 318 318 double upperAvg = values.Count() > 4 ? values.OrderByDescending(x => x).Take((int)(values.Count() * 0.25)).Average() : double.NaN; -
trunk/sources/HeuristicLab.Analysis.Statistics.Views/3.3/SampleSizeInfluenceView.cs
r12690 r13051 389 389 matrix[5, i] = seriesValues.StandardDeviation(); 390 390 matrix[6, i] = seriesValues.Variance(); 391 matrix[7, i] = seriesValues. Percentile(0.25);392 matrix[8, i] = seriesValues. Percentile(0.75);391 matrix[7, i] = seriesValues.Quantile(0.25); 392 matrix[8, i] = seriesValues.Quantile(0.75); 393 393 matrix[9, i] = confIntervals.Item1; 394 394 matrix[10, i] = confIntervals.Item2; -
trunk/sources/HeuristicLab.Common/3.3/EnumerableStatisticExtensions.cs
r13034 r13051 65 65 66 66 // Numerical Recipes in C++, §8.5 Selecting the Mth Largest, O(n) 67 // Gi ben k in [0..n-1] returns an array value from array arr[0..n-1] such that k array values are67 // Given k in [0..n-1] returns an array value from array arr[0..n-1] such that k array values are 68 68 // lee than or equal to the one returned. The input array will be rearranged to hav this value in 69 69 // location arr[k], with all smaller elements moved to arr[0..k-1] (in arbitrary order) and all 70 70 // larger elements in arr[k+1..n-1] (also in arbitrary order). 71 // 72 // Could be changed to Select<T> where T is IComparable but in this case is significantly slower for double values 71 73 private static double Select(int k, double[] arr) { 72 74 Contract.Assert(arr.GetLowerBound(0) == 0); … … 198 200 } 199 201 200 /// <summary>201 /// Calculates the pth percentile of the values.202 /// </summary>203 public static double Percentile(this IEnumerable<double> values, double p) {204 // percentiles are actually quantiles where alpha is constrained to integer percentage values from 1% to 99%205 return Quantile(values, p);206 }207 208 202 public static IEnumerable<double> LimitToRange(this IEnumerable<double> values, double min, double max) { 209 203 if (min > max) throw new ArgumentException(string.Format("Minimum {0} is larger than maximum {1}.", min, max)); -
trunk/sources/HeuristicLab.DataPreprocessing/3.4/Implementations/StatisticsLogic.cs
r12889 r13051 166 166 double percentile = double.NaN; 167 167 if (preprocessingData.VariableHasType<double>(columnIndex)) { 168 percentile = GetValuesWithoutNaN<double>(columnIndex). Percentile(0.25);169 } else if (preprocessingData.VariableHasType<DateTime>(columnIndex)) { 170 percentile = GetDateTimeAsSeconds(columnIndex). Percentile(0.25);168 percentile = GetValuesWithoutNaN<double>(columnIndex).Quantile(0.25); 169 } else if (preprocessingData.VariableHasType<DateTime>(columnIndex)) { 170 percentile = GetDateTimeAsSeconds(columnIndex).Quantile(0.25); 171 171 } 172 172 return percentile; … … 176 176 double percentile = double.NaN; 177 177 if (preprocessingData.VariableHasType<double>(columnIndex)) { 178 percentile = GetValuesWithoutNaN<double>(columnIndex). Percentile(0.75);179 } else if (preprocessingData.VariableHasType<DateTime>(columnIndex)) { 180 percentile = GetDateTimeAsSeconds(columnIndex). Percentile(0.75);178 percentile = GetValuesWithoutNaN<double>(columnIndex).Quantile(0.75); 179 } else if (preprocessingData.VariableHasType<DateTime>(columnIndex)) { 180 percentile = GetDateTimeAsSeconds(columnIndex).Quantile(0.75); 181 181 } 182 182 return percentile; -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBoxPlotView.cs
r12787 r13051 248 248 matrix[5, i] = seriesValues.StandardDeviation(); 249 249 matrix[6, i] = seriesValues.Variance(); 250 matrix[7, i] = seriesValues. Percentile(0.25);251 matrix[8, i] = seriesValues. Percentile(0.75);250 matrix[7, i] = seriesValues.Quantile(0.25); 251 matrix[8, i] = seriesValues.Quantile(0.75); 252 252 } 253 253 statisticsMatrixView.Content = matrix;
Note: See TracChangeset
for help on using the changeset viewer.