/** * {@inheritDoc} */ @Override public Percentile copy() { return new Percentile(this); }
public PercentileMetricAnomalyFinder() { _percentile = new Percentile(); }
/** * Build a new instance similar to the current one except for the * {@link NaNStrategy NaN handling} strategy. * <p> * This method is intended to be used as part of a fluent-type builder * pattern. Building finely tune instances should be done as follows: * </p> * <pre> * Percentile customized = new Percentile(quantile). * withEstimationType(estimationType). * withNaNStrategy(nanStrategy). * withKthSelector(kthSelector); * </pre> * <p> * If any of the {@code withXxx} method is omitted, the default value for * the corresponding customization parameter will be used. * </p> * @param newNaNStrategy NaN strategy for the new instance * @return a new instance, with changed NaN handling strategy * @throws NullArgumentException when newNaNStrategy is null */ public Percentile withNaNStrategy(final NaNStrategy newNaNStrategy) { return new Percentile(quantile, estimationType, newNaNStrategy, kthSelector); }
/** * Build a new instance similar to the current one except for the * {@link EstimationType estimation type}. * <p> * This method is intended to be used as part of a fluent-type builder * pattern. Building finely tune instances should be done as follows: * </p> * <pre> * Percentile customized = new Percentile(quantile). * withEstimationType(estimationType). * withNaNStrategy(nanStrategy). * withKthSelector(kthSelector); * </pre> * <p> * If any of the {@code withXxx} method is omitted, the default value for * the corresponding customization parameter will be used. * </p> * @param newEstimationType estimation type for the new instance * @return a new instance, with changed estimation type * @throws NullArgumentException when newEstimationType is null */ public Percentile withEstimationType(final EstimationType newEstimationType) { return new Percentile(quantile, newEstimationType, nanStrategy, kthSelector); }
/** * Build a new instance similar to the current one except for the * {@link KthSelector kthSelector} instance specifically set. * <p> * This method is intended to be used as part of a fluent-type builder * pattern. Building finely tune instances should be done as follows: * </p> * <pre> * Percentile customized = new Percentile(quantile). * withEstimationType(estimationType). * withNaNStrategy(nanStrategy). * withKthSelector(newKthSelector); * </pre> * <p> * If any of the {@code withXxx} method is omitted, the default value for * the corresponding customization parameter will be used. * </p> * @param newKthSelector KthSelector for the new instance * @return a new instance, with changed KthSelector * @throws NullArgumentException when newKthSelector is null */ public Percentile withKthSelector(final KthSelector newKthSelector) { return new Percentile(quantile, estimationType, nanStrategy, newKthSelector); }
/** * {@inheritDoc} */ @Override public Percentile copy() { return new Percentile(this); }
/** * {@inheritDoc} */ @Override public Percentile copy() { return new Percentile(this); }
private void intialize(){ for(int i=0;i<size;i++){ q[i] = new Percentile(); } }
public Percentile(final double quantile) { super(new org.apache.commons.math3.stat.descriptive.rank.Percentile(quantile)); } }
public ScottsBandwidth(double[] x, double adjustmentFactor){ this.x = x; this.adjustmentFactor = adjustmentFactor; pcntl = new Percentile(); }
private void intialize(){ for(int i=0;i<size;i++){ q[i] = new Percentile(); } }
public Percentile(final double quantile) { super(new org.apache.commons.math3.stat.descriptive.rank.Percentile(quantile)); } }
public Bootstrap(double lower, double upper){ this.lower = lower; this.upper = upper; percentile = new Percentile(); stdDev = new StandardDeviation(); }
@Override public double doublePercentile(int percentile){ if(this.size == 0){ throw new IllegalStateException(); } double[] data = new double[this.size]; System.arraycopy(this.values, 0, data, 0, data.length); Arrays.sort(data); Percentile statistic = new Percentile(); statistic.setData(data); return statistic.evaluate(percentile); } }
private Double _calculateNthPercentile(Collection<Double> values, Double percentileValue) { return new Percentile().evaluate(Doubles.toArray(values), percentileValue); }
DescriptiveStatistics shortList = new DescriptiveStatistics(); shortList.setPercentileImpl( new Percentile(). withEstimationType( Percentile.EstimationType.R_7 ) );
private double _calculateValue(double sum, List<Double> numberArr, int count, InternalReducerType type) { if (InternalReducerType.MEDIAN.equals(type)) { double[] numbers = ArrayUtils.toPrimitive(numberArr.toArray(new Double[numberArr.size()])); return new Percentile().evaluate(numbers, 50.0); } if(InternalReducerType.AVG.equals(type)) { return (sum / count); } return sum; }
private double _calculateValue(double sum, List<Double> numberArr, int count, InternalReducerType type) { if (InternalReducerType.MEDIAN.equals(type)) { double[] numbers = ArrayUtils.toPrimitive(numberArr.toArray(new Double[numberArr.size()])); return new Percentile().evaluate(numbers, 50.0); } if(InternalReducerType.AVG.equals(type)) { return (sum / count); } return sum; }
@Override public double getValue() { return new org.apache.commons.math3.stat.descriptive.rank.Percentile(nth * 100) .withEstimationType(org.apache.commons.math3.stat.descriptive.rank.Percentile.EstimationType.R_7) .withNaNStrategy(NaNStrategy.FIXED) .evaluate(values, 0, n); }
@Override protected int calculateNumericResult(DescriptiveStatistics ds) { ds.setPercentileImpl(new Percentile().withEstimationType(Percentile.EstimationType.R_3)); return actualResult = (int) ds.getPercentile((double) percentile); }