Class DAgostinosKsquaredTest


  • public class DAgostinosKsquaredTest
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      private double[] result
      output result
      private double[] x  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void run()  
      void selfTest()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • x

        private double[] x
      • result

        private double[] result
        output result
    • Constructor Detail

      • DAgostinosKsquaredTest

        public DAgostinosKsquaredTest()
      • DAgostinosKsquaredTest

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

      • run

        public void run()
      • selfTest

        public void selfTest()