Class RNGTEST


  • public class RNGTEST
    extends java.lang.Object
    This class computes some tests on random numbers
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static double[][] a  
      static double[] b  
    • Constructor Summary

      Constructors 
      Constructor Description
      RNGTEST()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static double approxChiSQValue​(int df, double confidenceLevel)
      Use for large degrees of freedom
      static double chiSquaredTest​(RandU01Ifc rng, long n, int k)
      Performs 1-D chi-squared test
      static double correlationTest​(RandU01Ifc rng, int lag, long n)
      Performs the correlation test
      static double runsUpTest​(RandU01Ifc rng, long n)
      Performs the runs up test
      static double serial2DTest​(RandU01Ifc rng, long n, int k)
      Performs the 2-D chi-squared serial test
      static double serial3DTest​(RandU01Ifc rng, long n, int k)
      Performs the 3-D chi-squared serial test
      • Methods inherited from class java.lang.Object

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

      • a

        public static final double[][] a
      • b

        public static final double[] b
    • Constructor Detail

      • RNGTEST

        public RNGTEST()
    • Method Detail

      • approxChiSQValue

        public static double approxChiSQValue​(int df,
                                              double confidenceLevel)
        Use for large degrees of freedom
        Parameters:
        df - degrees of freedom
        confidenceLevel - the confidence level for the statistical test
        Returns:
        the approximate chi-squared value
      • chiSquaredTest

        public static double chiSquaredTest​(RandU01Ifc rng,
                                            long n,
                                            int k)
        Performs 1-D chi-squared test
        Parameters:
        rng - the thing that produces U(0,1) numbers, must not null
        n - number of random numbers to test
        k - the number of intervals in the test
        Returns:
        the chi-squared test statistic
      • serial2DTest

        public static double serial2DTest​(RandU01Ifc rng,
                                          long n,
                                          int k)
        Performs the 2-D chi-squared serial test
        Parameters:
        rng - the thing that produces U(0,1) numbers, must not null
        n - number of random numbers to test
        k - the number of intervals in the test for each dimension
        Returns:
        the chi-squared test statistic
      • serial3DTest

        public static double serial3DTest​(RandU01Ifc rng,
                                          long n,
                                          int k)
        Performs the 3-D chi-squared serial test
        Parameters:
        rng - the thing that produces U(0,1) numbers, must not null
        n - number of random numbers to test
        k - the number of intervals in the test for each dimension
        Returns:
        the chi-squared test statistic
      • correlationTest

        public static double correlationTest​(RandU01Ifc rng,
                                             int lag,
                                             long n)
        Performs the correlation test
        Parameters:
        rng - the thing that produces U(0,1) numbers, must not null
        lag - the lag to test
        n - the number to sample
        Returns:
        the test statistic
      • runsUpTest

        public static double runsUpTest​(RandU01Ifc rng,
                                        long n)
        Performs the runs up test
        Parameters:
        rng - the thing that produces U(0,1) numbers, must not null
        n - the number to sample
        Returns:
        the test statistic