Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/01/13 21:42:07 (11 years ago)
Author:
ascheibe
Message:

#2031 added recommended sample size to sample size influence view

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/SampleSizeInfluenceView.cs

    r9998 r10016  
    238238
    239239        UpdateAxisLabels();
     240        if (groupSizes.Any())
     241          AddSampleSizeText();
     242      } else {
     243        sampleSizeTextBox.Text = string.Empty;
    240244      }
    241245      UpdateNoRunsVisibleLabel();
     246    }
     247
     248    private void AddSampleSizeText() {
     249      sampleSizeTextBox.Text = string.Empty;
     250      var usableRuns = Content.Where(r => r.Visible).ToList();
     251
     252      if (!yAxisComboBox.DroppedDown)
     253        this.yAxisValue = (string)yAxisComboBox.SelectedItem;
     254
     255      List<double?> yValue = usableRuns.Select(x => GetValue(x, this.yAxisValue)).ToList();
     256      if (yValue.Any(x => !x.HasValue)) return;
     257
     258      double y = SampleSizeDetermination.DetermineSampleSizeByEstimatingMean(yValue.Select(x => x.Value).ToArray());
     259      sampleSizeTextBox.Text = y.ToString();
    242260    }
    243261
     
    302320        Series series = seriesCache.ElementAt(i).Value;
    303321        double[] seriesValues = series.Points.Select(p => p.YValues[0]).OrderBy(d => d).ToArray();
     322        Tuple<double, double> confIntervals = new Tuple<double, double>(double.NaN, double.NaN);
     323        if (seriesValues.Count() > 1)
     324          confIntervals = seriesValues.ConfidenceIntervals(0.95);
    304325        matrix[0, i] = seriesValues.Length;
    305326        matrix[1, i] = seriesValues.Min();
     
    311332        matrix[7, i] = seriesValues.Percentile(0.25);
    312333        matrix[8, i] = seriesValues.Percentile(0.75);
    313         matrix[9, i] = seriesValues.ConfidenceIntervals(0.95).Item1;
    314         matrix[10, i] = seriesValues.ConfidenceIntervals(0.95).Item2;
     334        matrix[9, i] = confIntervals.Item1;
     335        matrix[10, i] = confIntervals.Item2;
    315336      }
    316337      statisticsMatrixView.Content = matrix;
Note: See TracChangeset for help on using the changeset viewer.