Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/21/13 16:47:39 (11 years ago)
Author:
ascheibe
Message:

#1886 added a view for sample size determination

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/SampleSizeDetermination.cs

    r9329 r9330  
    3838      double result = 0;
    3939
    40       double var = samples.Variance();
    41       double n = alglib.normaldistribution((conf + 1) / 2);
     40      double var = samples.StandardDeviation();
     41      double n = alglib.invnormaldistribution((conf + 1) / 2);
    4242      result = Math.Pow(n, 2) * Math.Pow(var, 2) / Math.Pow(e, 2);
    43       return (int)Math.Ceiling(result);
     43      result = Math.Ceiling(result);
     44      if (result > int.MaxValue)
     45        return int.MaxValue;
     46      else
     47        return (int)result;
    4448    }
    4549
Note: See TracChangeset for help on using the changeset viewer.