@Override public double expectedShortfallFromUnsorted(double level, DoubleArray sample) { return expectedShortfallResultFromUnsorted(level, sample).getValue(); }
@Override public double quantileWithExtrapolationFromUnsorted(double level, DoubleArray sample) { return quantileResultWithExtrapolationFromUnsorted(level, sample).getValue(); }
@Override public double quantileFromUnsorted(double level, DoubleArray sample) { return quantileResultFromUnsorted(level, sample).getValue(); }
public void interpolation_wrong_quantile_small() { assertThrowsIllegalArg(() -> QUANTILE_SAMPLE_INTERPOLATION.quantileFromUnsorted(LEVEL4, UNSORTED_100)); assertThrowsIllegalArg(() -> QUANTILE_SAMPLE1_INTERPOLATION.quantileFromUnsorted(LEVEL4, UNSORTED_100)); assertThrowsIllegalArg(() -> QUANTILE_MIDWAY_INTERPOLATION.quantileFromUnsorted(LEVEL4, UNSORTED_100)); assertThrowsIllegalArg(() -> QUANTILE_NEAREST_INDEX.quantileFromUnsorted(LEVEL4, UNSORTED_100)); assertThrowsIllegalArg(() -> QUANTILE_SAMPLE1_NEAREST_INDEX.quantileFromUnsorted(LEVEL4, UNSORTED_100)); }
public void interpolation_wrong_quantile_large() { assertThrowsIllegalArg(() -> QUANTILE_MIDWAY_INTERPOLATION.quantileFromUnsorted(LEVEL5, UNSORTED_100)); assertThrowsIllegalArg(() -> QUANTILE_SAMPLE1_INTERPOLATION.quantileFromUnsorted(LEVEL5, UNSORTED_100)); assertThrowsIllegalArg(() -> QUANTILE_SAMPLE1_NEAREST_INDEX.quantileFromUnsorted(LEVEL5, UNSORTED_100)); }
public void index_nearest_095_100() { double quantileExpected = QUANTILE_INDEX_ABOVE.quantileFromUnsorted(LEVEL3, UNSORTED_100); double quantileComputed = QUANTILE_NEAREST_INDEX.quantileFromUnsorted(LEVEL3, UNSORTED_100); assertEquals(quantileComputed, quantileExpected, TOL); }
@Override public Double apply(Double level) { return QUANTILE_NEAREST_INDEX.quantileWithExtrapolationFromUnsorted(level, UNSORTED_100); } };
@Override public Double apply(Double level) { return QUANTILE_MIDWAY_INTERPOLATION.quantileWithExtrapolationFromUnsorted(level, UNSORTED_100); } };
@Override public Double apply(Double level) { return QUANTILE_INDEX_ABOVE.quantileWithExtrapolationFromUnsorted(level, UNSORTED_123); } };
@Override public Double apply(Double level) { return QUANTILE_SAMPLE1_INTERPOLATION.quantileWithExtrapolationFromUnsorted(level, UNSORTED_123); } };
@Override public Double apply(Double level) { return QUANTILE_SAMPLE1_NEAREST_INDEX.quantileWithExtrapolationFromUnsorted(level, UNSORTED_100); } };
@Override public QuantileResult build() { return new QuantileResult( value, indices, weights); }
public void quantile() { double[] level = {0.98, 0.981, 0.9811, 0.97}; for (int i = 0; i < level.length; i++) { check_quantile(level[i]); } }
@Override public Double apply(Double level) { return QUANTILE_SAMPLE_INTERPOLATION.quantileWithExtrapolationFromUnsorted(level, UNSORTED_100); } };
@Override public Double apply(Double level) { return ExcelInterpolationQuantileMethod.DEFAULT.quantileWithExtrapolationFromUnsorted(level, data); } };
@Override public Double apply(Double level) { return QUANTILE_NEAREST_INDEX.quantileWithExtrapolationFromUnsorted(level, UNSORTED_100); } };
@Override public Double apply(Double level) { return QUANTILE_MIDWAY_INTERPOLATION.quantileWithExtrapolationFromUnsorted(level, UNSORTED_100); } };
@Override public Double apply(Double level) { return QUANTILE_INDEX_ABOVE.quantileWithExtrapolationFromUnsorted(level, UNSORTED_100); } };
@Override public Double apply(Double level) { return QUANTILE_SAMPLE1_INTERPOLATION.quantileWithExtrapolationFromUnsorted(level, UNSORTED_100); } };
@Override public Double apply(Double level) { return QUANTILE_SAMPLE1_NEAREST_INDEX.quantileWithExtrapolationFromUnsorted(level, UNSORTED_100); } };