@Test public void distinguishableEffectSizes() throws Exception { DistinguishableEffectSize output = testStats95.distinguishableEffectSizes(5, 2, 4, 3); assertThat("check lower bound", output.getNegativeEffectSize(), IsCloseTo.closeTo(-0.6533213, precision)); assertThat("check upper bound", output.getPositiveEffectSize(), IsCloseTo.closeTo(0.6533213, precision)); output = testStats95.distinguishableEffectSizes(500, 200, 400, 300); assertThat("check lower bound", output.getNegativeEffectSize(), IsCloseTo.closeTo(-0.0653321, precision)); assertThat("check upper bound", output.getPositiveEffectSize(), IsCloseTo.closeTo(0.0653321, precision)); output = testStats95.distinguishableEffectSizes(0, 0, 2, 1); assertThat("0 impressions returns Infinity", output.getNegativeEffectSize().isInfinite()); assertThat("0 impressions returns Infinity", output.getPositiveEffectSize().isInfinite()); output = testStats95.distinguishableEffectSizes(2, 1, 0, 0); assertThat("0 impressions returns Infinity", output.getNegativeEffectSize().isInfinite()); assertThat("0 impressions returns Infinity", output.getPositiveEffectSize().isInfinite()); output = testStats95.distinguishableEffectSizes(0, 0, 0, 0); assertThat("0 impressions returns NaN", output.getNegativeEffectSize(), is(NaN)); assertThat("0 impressions returns NaN", output.getPositiveEffectSize(), is(NaN)); }
@Override public DistinguishableEffectSize distinguishableEffectSizes(final long number_impressions_1, final long number_actions_1, final long number_impressions_2, final long number_actions_2) { SymmetricInputValidation(number_impressions_1, number_actions_1, number_impressions_2, number_actions_2); double zval = DecisionAdjuster.scaledZ(confidenceLevel, maxDecisions); double pooled_rate = 1.0 * (number_actions_1 + number_actions_2) / (number_impressions_1 + number_impressions_2); double effect_size = zval * sqrt(pooled_rate * (1 - pooled_rate) * (1.0 / number_impressions_1 + 1.0 / number_impressions_2)); return new DistinguishableEffectSize.Builder() .withNegativeEffectSize(-effect_size) .withPositiveEffectSize(effect_size) .build(); }
NormalApproxSymMetric extends com.intuit.wasabi.analyticsobjects.metrics.NormalApproxMetric { @Override public DistinguishableEffectSize distinguishableEffectSizes(final long number_impressions_1, final long number_actions_1, final long number_impressions_2, final long number_actions_2) { SymmetricInputValidation(number_impressions_1, number_actions_1, number_impressions_2, number_actions_2); double zval = DecisionAdjuster.scaledZ(confidenceLevel, maxDecisions); double pooled_rate = 1.0 * (number_actions_1 + number_actions_2) / (number_impressions_1 + number_impressions_2); double effect_size = zval * sqrt(pooled_rate * (1 - pooled_rate) * (1.0 / number_impressions_1 + 1.0 / number_impressions_2)); return new DistinguishableEffectSize.Builder() .withNegativeEffectSize(-effect_size) .withPositiveEffectSize(effect_size) .build(); } }
NormalApproxSymMetric extends com.intuit.wasabi.analyticsobjects.metrics.NormalApproxMetric { @Override public DistinguishableEffectSize distinguishableEffectSizes(final long number_impressions_1, final long number_actions_1, final long number_impressions_2, final long number_actions_2) { SymmetricInputValidation(number_impressions_1, number_actions_1, number_impressions_2, number_actions_2); double zval = DecisionAdjuster.scaledZ(confidenceLevel, maxDecisions); double pooled_rate = 1.0 * (number_actions_1 + number_actions_2) / (number_impressions_1 + number_impressions_2); double effect_size = zval * sqrt(pooled_rate * (1 - pooled_rate) * (1.0 / number_impressions_1 + 1.0 / number_impressions_2)); return new DistinguishableEffectSize.Builder() .withNegativeEffectSize(-effect_size) .withPositiveEffectSize(effect_size) .build(); } NormalApproxSymMetric(final double conf_level);  NormalApproxSymMetric(final double conf_level, final double max_decisions); }
NormalApproxSymMetric extends com.intuit.wasabi.analyticsobjects.metrics.NormalApproxMetric { @Override public DistinguishableEffectSize distinguishableEffectSizes(final long number_impressions_1, final long number_actions_1, final long number_impressions_2, final long number_actions_2) { SymmetricInputValidation(number_impressions_1, number_actions_1, number_impressions_2, number_actions_2); double zval = DecisionAdjuster.scaledZ(confidenceLevel, maxDecisions); double pooled_rate = 1.0 * (number_actions_1 + number_actions_2) / (number_impressions_1 + number_impressions_2); double effect_size = zval * sqrt(pooled_rate * (1 - pooled_rate) * (1.0 / number_impressions_1 + 1.0 / number_impressions_2)); return new DistinguishableEffectSize.Builder() .withNegativeEffectSize(-effect_size) .withPositiveEffectSize(effect_size) .build(); } NormalApproxSymMetric(final double conf_level);  NormalApproxSymMetric(final double conf_level, final double max_decisions); @Override DistinguishableEffectSize distinguishableEffectSizes(final long number_impressions_1,
                                                                final long number_actions_1,
                                                                final long number_impressions_2,
                                                                final long number_actions_2); @Override Double fractionOfData(final long number_impressions_1, final long number_actions_1,
                                 final long number_impressions_2, final long number_actions_2,
                                 final double effect_size); }
NormalApproxSymMetric extends com.intuit.wasabi.analyticsobjects.metrics.NormalApproxMetric { @Override public DistinguishableEffectSize distinguishableEffectSizes(final long number_impressions_1, final long number_actions_1, final long number_impressions_2, final long number_actions_2) { SymmetricInputValidation(number_impressions_1, number_actions_1, number_impressions_2, number_actions_2); double zval = DecisionAdjuster.scaledZ(confidenceLevel, maxDecisions); double pooled_rate = 1.0 * (number_actions_1 + number_actions_2) / (number_impressions_1 + number_impressions_2); double effect_size = zval * sqrt(pooled_rate * (1 - pooled_rate) * (1.0 / number_impressions_1 + 1.0 / number_impressions_2)); return new DistinguishableEffectSize.Builder() .withNegativeEffectSize(-effect_size) .withPositiveEffectSize(effect_size) .build(); } NormalApproxSymMetric(final double conf_level);  NormalApproxSymMetric(final double conf_level, final double max_decisions); @Override DistinguishableEffectSize distinguishableEffectSizes(final long number_impressions_1,
                                                                final long number_actions_1,
                                                                final long number_impressions_2,
                                                                final long number_actions_2); @Override Double fractionOfData(final long number_impressions_1, final long number_actions_1,
                                 final long number_impressions_2, final long number_actions_2,
                                 final double effect_size);  }