Class DAgostinosKsquaredTest

java.lang.Object
gov.nih.mipav.model.algorithms.DAgostinosKsquaredTest

public class DAgostinosKsquaredTest extends Object

This code calculates the Ksquared statistic of an input array x[]. KSquared = Z1(g1)**2 + Z2(g2)**2 If the null hypothesis of normality is true, then Ksquared is approximately chiSquared distributed with 2 degrees of freedom Expected value Standard deviation 95% quantile n = 20 1.971 2.339 6.373 n = 50 2.017 2.308 6.339 n = 100 2.026 2.267 6.271 n = 250 2.012 2.174 6.129 n = 500 2.009 2.113 6.063 n = 1000 2.000 2.062 6.038 chSquared(2) 2.000 2.000 5.991 distribution

A typical usage would be:

 double result[] = new double[1];
 DAgostinosKsquaredTest dkt = new DAgostinosKsquaredTest(x, result);
 dkt.run();
  • Field Details

    • x

      private double[] x
    • result

      private double[] result
      output result
  • Constructor Details

    • DAgostinosKsquaredTest

      public DAgostinosKsquaredTest()
    • DAgostinosKsquaredTest

      public DAgostinosKsquaredTest(double[] x, double[] result)
      Parameters:
      x - Input argument
      result - outputted Ksquared test value of x
  • Method Details

    • run

      public void run()
    • selfTest

      public void selfTest()