Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9330


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

#1886 added a view for sample size determination

Location:
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views-3.3.csproj

    r9328 r9330  
    119119  </ItemGroup>
    120120  <ItemGroup>
     121    <Compile Include="SampleSizeChecker.cs">
     122      <SubType>UserControl</SubType>
     123    </Compile>
     124    <Compile Include="SampleSizeChecker.designer.cs">
     125      <DependentUpon>SampleSizeChecker.cs</DependentUpon>
     126    </Compile>
    121127    <Compile Include="SampleSizeDetermination.cs" />
    122128    <Compile Include="StatisticalTestingView.cs">
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/KruskalWallis.cs

    r9316 r9330  
    2424
    2525namespace HeuristicLab.Analysis.AlgorithmBehavior.Analyzers {
    26   // Kruskal Wallis test based on R's kruskal.test()
    2726  public class KruskalWallis {
     27    /// <summary>
     28    /// Performs the Kruskal-Wallis test and returns the p-Value.
     29    /// (source based on R's kruskal.test())
     30    /// </summary>
    2831    public static double Test(double[][] data) {
    2932      double[] g;
     
    7881    }
    7982
    80     public static double[] FlattenArray(double[][] x, out double[] indizes) {
     83    private static double[] FlattenArray(double[][] x, out double[] indizes) {
    8184      int compLenght = 0;
    8285      for (int i = 0; i < x.Length; i++) {
     
    100103    }
    101104
    102     public static double[][] CountDuplicates(double[] x) {
     105    private static double[][] CountDuplicates(double[] x) {
    103106      List<double> number = new List<double>();
    104107      List<double> cnt = new List<double>();
     
    129132    }
    130133
    131     public static int[] Rank(double[] x) {
     134    private static int[] Rank(double[] x) {
    132135      double[] keys = new double[x.Length];
    133136      int[] items = new int[x.Length];
  • 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.