/** * Computes the significance level by approximate randomization, using a * default value of 1000 iterations. See documentation for other version * of method. */ public static double sigLevelByApproxRand(double[] A, double[] B) { return sigLevelByApproxRand(A, B, 1000); }
public static double sigLevelByApproxRand(boolean[] A, boolean[] B) { return sigLevelByApproxRand(A, B, 1000); }
public static double sigLevelByApproxRand(int[] A, int[] B) { return sigLevelByApproxRand(A, B, 1000); }
public static double sigLevelByApproxRand(int[] A, int[] B, int iterations) { if (A.length == 0) throw new IllegalArgumentException("Input arrays must not be empty!"); if (A.length != B.length) throw new IllegalArgumentException("Input arrays must have equal length!"); if (iterations <= 0) throw new IllegalArgumentException("Number of iterations must be positive!"); double[] X = new double[A.length]; double[] Y = new double[B.length]; for (int i = 0; i < A.length; i++) { X[i] = A[i]; Y[i] = B[i]; } return sigLevelByApproxRand(X, Y, iterations); }
public static double sigLevelByApproxRand(boolean[] A, boolean[] B, int iterations) { if (A.length == 0) throw new IllegalArgumentException("Input arrays must not be empty!"); if (A.length != B.length) throw new IllegalArgumentException("Input arrays must have equal length!"); if (iterations <= 0) throw new IllegalArgumentException("Number of iterations must be positive!"); double[] X = new double[A.length]; double[] Y = new double[B.length]; for (int i = 0; i < A.length; i++) { X[i] = (A[i] ? 1.0 : 0.0); Y[i] = (B[i] ? 1.0 : 0.0); } return sigLevelByApproxRand(X, Y, iterations); }
/** * For testing only. * @param args Ignored */ public static void main(String[] args) { Random random = new Random(); int length = 100; double[] A = new double[length]; double[] B = new double[length]; double aAvg = 70.0; double bAvg = 70.5; for (int i = 0; i < length; i++) { A[i] = aAvg + random.nextGaussian(); B[i] = bAvg + random.nextGaussian(); } System.out.println("A has length " + A.length + " and mean " + mean(A)); System.out.println("B has length " + B.length + " and mean " + mean(B)); for (int t = 0; t < 10; t++) { System.out.println("p-value: " + sigLevelByApproxRand(A, B)); } }
/** * Computes the significance level by approximate randomization, using a * default value of 1000 iterations. See documentation for other version * of method. */ public static double sigLevelByApproxRand(double[] A, double[] B) { return sigLevelByApproxRand(A, B, 1000); }
/** * Computes the significance level by approximate randomization, using a * default value of 1000 iterations. See documentation for other version * of method. */ public static double sigLevelByApproxRand(double[] A, double[] B) { return sigLevelByApproxRand(A, B, 1000); }
public static double sigLevelByApproxRand(boolean[] A, boolean[] B) { return sigLevelByApproxRand(A, B, 1000); }
/** * Computes the significance level by approximate randomization, using a * default value of 1000 iterations. See documentation for other version * of method. */ public static double sigLevelByApproxRand(double[] A, double[] B) { return sigLevelByApproxRand(A, B, 1000); }
public static double sigLevelByApproxRand(boolean[] A, boolean[] B) { return sigLevelByApproxRand(A, B, 1000); }
public static double sigLevelByApproxRand(int[] A, int[] B) { return sigLevelByApproxRand(A, B, 1000); }
public static double sigLevelByApproxRand(int[] A, int[] B) { return sigLevelByApproxRand(A, B, 1000); }
/** * Computes the significance level by approximate randomization, using a * default value of 1000 iterations. See documentation for other version * of method. */ public static double sigLevelByApproxRand(double[] A, double[] B) { return sigLevelByApproxRand(A, B, 1000); }
public static double sigLevelByApproxRand(int[] A, int[] B) { return sigLevelByApproxRand(A, B, 1000); }
public static double sigLevelByApproxRand(boolean[] A, boolean[] B) { return sigLevelByApproxRand(A, B, 1000); }
public static double sigLevelByApproxRand(int[] A, int[] B, int iterations) { if (A.length == 0) throw new IllegalArgumentException("Input arrays must not be empty!"); if (A.length != B.length) throw new IllegalArgumentException("Input arrays must have equal length!"); if (iterations <= 0) throw new IllegalArgumentException("Number of iterations must be positive!"); double[] X = new double[A.length]; double[] Y = new double[B.length]; for (int i = 0; i < A.length; i++) { X[i] = A[i]; Y[i] = B[i]; } return sigLevelByApproxRand(X, Y, iterations); }
public static double sigLevelByApproxRand(int[] A, int[] B, int iterations) { if (A.length == 0) throw new IllegalArgumentException("Input arrays must not be empty!"); if (A.length != B.length) throw new IllegalArgumentException("Input arrays must have equal length!"); if (iterations <= 0) throw new IllegalArgumentException("Number of iterations must be positive!"); double[] X = new double[A.length]; double[] Y = new double[B.length]; for (int i = 0; i < A.length; i++) { X[i] = A[i]; Y[i] = B[i]; } return sigLevelByApproxRand(X, Y, iterations); }
public static double sigLevelByApproxRand(boolean[] A, boolean[] B, int iterations) { if (A.length == 0) throw new IllegalArgumentException("Input arrays must not be empty!"); if (A.length != B.length) throw new IllegalArgumentException("Input arrays must have equal length!"); if (iterations <= 0) throw new IllegalArgumentException("Number of iterations must be positive!"); double[] X = new double[A.length]; double[] Y = new double[B.length]; for (int i = 0; i < A.length; i++) { X[i] = (A[i] ? 1.0 : 0.0); Y[i] = (B[i] ? 1.0 : 0.0); } return sigLevelByApproxRand(X, Y, iterations); }
public static double sigLevelByApproxRand(boolean[] A, boolean[] B, int iterations) { if (A.length == 0) throw new IllegalArgumentException("Input arrays must not be empty!"); if (A.length != B.length) throw new IllegalArgumentException("Input arrays must have equal length!"); if (iterations <= 0) throw new IllegalArgumentException("Number of iterations must be positive!"); double[] X = new double[A.length]; double[] Y = new double[B.length]; for (int i = 0; i < A.length; i++) { X[i] = (A[i] ? 1.0 : 0.0); Y[i] = (B[i] ? 1.0 : 0.0); } return sigLevelByApproxRand(X, Y, iterations); }