@Test public void calcMaxDecisions() throws Exception { Double output = DecisionAdjuster.calcMaxDecisions((long) 1, (long) Math.pow(10, 10)); assertThat("log(10^10/1) = 23", output, IsCloseTo.closeTo(23.0258509, precision)); output = DecisionAdjuster.calcMaxDecisions((long) 100, (long) Math.pow(10, 10)); assertThat("log(10^10/100) = 18", output, IsCloseTo.closeTo(18.4206807, precision)); output = DecisionAdjuster.calcMaxDecisions((long) 1, (long) Math.pow(10, 11)); assertThat("log(10^11/1) = 25", output, IsCloseTo.closeTo(25.328436, precision)); }
public static Double calcMaxDecisions(final long min_impressions, final long max_impressions) { if (min_impressions <= 0) { throw new IllegalArgumentException("Minimum number of unique impressions must be positive."); } if (max_impressions <= 0) { throw new IllegalArgumentException("Maximum number of unique impressions must be positive."); } return log(1.0 * max_impressions / min_impressions); }
DecisionAdjuster { public static Double calcMaxDecisions(final long min_impressions, final long max_impressions) { if (min_impressions <= 0) { throw new IllegalArgumentException("Minimum number of unique impressions must be positive."); } if (max_impressions <= 0) { throw new IllegalArgumentException("Maximum number of unique impressions must be positive."); } return log(1.0 * max_impressions / min_impressions); } }
DecisionAdjuster { public static Double calcMaxDecisions(final long min_impressions, final long max_impressions) { if (min_impressions <= 0) { throw new IllegalArgumentException("Minimum number of unique impressions must be positive."); } if (max_impressions <= 0) { throw new IllegalArgumentException("Maximum number of unique impressions must be positive."); } return log(1.0 * max_impressions / min_impressions); } private  DecisionAdjuster(); }
DecisionAdjuster { public static Double calcMaxDecisions(final long min_impressions, final long max_impressions) { if (min_impressions <= 0) { throw new IllegalArgumentException("Minimum number of unique impressions must be positive."); } if (max_impressions <= 0) { throw new IllegalArgumentException("Maximum number of unique impressions must be positive."); } return log(1.0 * max_impressions / min_impressions); } private  DecisionAdjuster(); static Double scaledZ(final double confidence_level, final double max_decisions); static Double scaledZ(final double confidence_level); static Double calcMaxDecisions(final long min_impressions, final long max_impressions); }
DecisionAdjuster { public static Double calcMaxDecisions(final long min_impressions, final long max_impressions) { if (min_impressions <= 0) { throw new IllegalArgumentException("Minimum number of unique impressions must be positive."); } if (max_impressions <= 0) { throw new IllegalArgumentException("Maximum number of unique impressions must be positive."); } return log(1.0 * max_impressions / min_impressions); } private  DecisionAdjuster(); static Double scaledZ(final double confidence_level, final double max_decisions); static Double scaledZ(final double confidence_level); static Double calcMaxDecisions(final long min_impressions, final long max_impressions); static final long DEFAULT_MIN_IMPRESSIONS; static final long DEFAULT_MAX_IMPRESSIONS; static final double DEFAULT_MAX_DECISIONS; }