@Test public void scaledZ() throws Exception { Double output = DecisionAdjuster.scaledZ(0.95, 23); assertThat("test 1", output, IsCloseTo.closeTo(3.0653832, precision)); output = DecisionAdjuster.scaledZ(0.99, 23); assertThat("test 2", output, IsCloseTo.closeTo(3.5180182, precision)); output = DecisionAdjuster.scaledZ(0.80, 23); assertThat("test 3", output, IsCloseTo.closeTo(2.6237934, precision)); output = DecisionAdjuster.scaledZ(0.95, 18); assertThat("test 4", output, IsCloseTo.closeTo(2.9913161, precision)); output = DecisionAdjuster.scaledZ(0.95, 33); assertThat("test 5", output, IsCloseTo.closeTo(3.1717658, precision)); }
public static Double scaledZ(final double confidence_level, final double max_decisions) { if (confidence_level <= 0.0 || confidence_level >= 1.0) { throw new IllegalArgumentException("Confidence level must be in the interval (0, 1)."); } if (max_decisions <= 0.0) { throw new IllegalArgumentException("Scale factor must be positive."); } double significance_level = 1.0 - confidence_level; return normalInverse(1.0 - significance_level / max_decisions / 2.); }
DecisionAdjuster { public static Double scaledZ(final double confidence_level, final double max_decisions) { if (confidence_level <= 0.0 || confidence_level >= 1.0) { throw new IllegalArgumentException("Confidence level must be in the interval (0, 1)."); } if (max_decisions <= 0.0) { throw new IllegalArgumentException("Scale factor must be positive."); } double significance_level = 1.0 - confidence_level; return normalInverse(1.0 - significance_level / max_decisions / 2.); } }
DecisionAdjuster { public static Double scaledZ(final double confidence_level, final double max_decisions) { if (confidence_level <= 0.0 || confidence_level >= 1.0) { throw new IllegalArgumentException("Confidence level must be in the interval (0, 1)."); } if (max_decisions <= 0.0) { throw new IllegalArgumentException("Scale factor must be positive."); } double significance_level = 1.0 - confidence_level; return normalInverse(1.0 - significance_level / max_decisions / 2.); } private  DecisionAdjuster(); }
DecisionAdjuster { public static Double scaledZ(final double confidence_level, final double max_decisions) { if (confidence_level <= 0.0 || confidence_level >= 1.0) { throw new IllegalArgumentException("Confidence level must be in the interval (0, 1)."); } if (max_decisions <= 0.0) { throw new IllegalArgumentException("Scale factor must be positive."); } double significance_level = 1.0 - confidence_level; return normalInverse(1.0 - significance_level / max_decisions / 2.); } 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 scaledZ(final double confidence_level, final double max_decisions) { if (confidence_level <= 0.0 || confidence_level >= 1.0) { throw new IllegalArgumentException("Confidence level must be in the interval (0, 1)."); } if (max_decisions <= 0.0) { throw new IllegalArgumentException("Scale factor must be positive."); } double significance_level = 1.0 - confidence_level; return normalInverse(1.0 - significance_level / max_decisions / 2.); } 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; }