@Test public void testRootNegativeLLR() { assertTrue(LogLikelihood.rootLogLikelihoodRatio(6, 7567, 1924, 2426487) >= 0.0); }
public static double rootLogLikelihoodRatio(long k11, long k12, long k21, long k22) { double llr = logLikelihoodRatio(k11, k12, k21, k22); double sqrt = Math.sqrt(llr); if ((double) k11 / (k11 + k12) < (double) k21 / (k21 + k22)) { sqrt = -sqrt; } return sqrt; }
LogLikelihood { public static double rootLogLikelihoodRatio(long k11, long k12, long k21, long k22) { double llr = logLikelihoodRatio(k11, k12, k21, k22); double sqrt = Math.sqrt(llr); if ((double) k11 / (k11 + k12) < (double) k21 / (k21 + k22)) { sqrt = -sqrt; } return sqrt; } }
LogLikelihood { public static double rootLogLikelihoodRatio(long k11, long k12, long k21, long k22) { double llr = logLikelihoodRatio(k11, k12, k21, k22); double sqrt = Math.sqrt(llr); if ((double) k11 / (k11 + k12) < (double) k21 / (k21 + k22)) { sqrt = -sqrt; } return sqrt; } private  LogLikelihood(); }
LogLikelihood { public static double rootLogLikelihoodRatio(long k11, long k12, long k21, long k22) { double llr = logLikelihoodRatio(k11, k12, k21, k22); double sqrt = Math.sqrt(llr); if ((double) k11 / (k11 + k12) < (double) k21 / (k21 + k22)) { sqrt = -sqrt; } return sqrt; } private  LogLikelihood(); static double entropy(long... elements); static double logLikelihoodRatio(long k11, long k12, long k21, long k22); static double rootLogLikelihoodRatio(long k11, long k12, long k21, long k22); static List<ScoredItem<T>> compareFrequencies(Multiset<T> a,
                                                           Multiset<T> b,
                                                           int maxReturn,
                                                           double threshold); }
LogLikelihood { public static double rootLogLikelihoodRatio(long k11, long k12, long k21, long k22) { double llr = logLikelihoodRatio(k11, k12, k21, k22); double sqrt = Math.sqrt(llr); if ((double) k11 / (k11 + k12) < (double) k21 / (k21 + k22)) { sqrt = -sqrt; } return sqrt; } private  LogLikelihood(); static double entropy(long... elements); static double logLikelihoodRatio(long k11, long k12, long k21, long k22); static double rootLogLikelihoodRatio(long k11, long k12, long k21, long k22); static List<ScoredItem<T>> compareFrequencies(Multiset<T> a,
                                                           Multiset<T> b,
                                                           int maxReturn,
                                                           double threshold);  }