DescriptiveStatistics implements StatisticalSummary, Serializable { public double getPercentile(double p) throws MathIllegalStateException, MathIllegalArgumentException { if (percentileImpl instanceof Percentile) { ((Percentile) percentileImpl).setQuantile(p); } else { try { percentileImpl.getClass().getMethod(SET_QUANTILE_METHOD_NAME, new Class[] {Double.TYPE}).invoke(percentileImpl, new Object[] {Double.valueOf(p)}); } catch (NoSuchMethodException e1) { throw new MathIllegalStateException( LocalizedFormats.PERCENTILE_IMPLEMENTATION_UNSUPPORTED_METHOD, percentileImpl.getClass().getName(), SET_QUANTILE_METHOD_NAME); } catch (IllegalAccessException e2) { throw new MathIllegalStateException( LocalizedFormats.PERCENTILE_IMPLEMENTATION_CANNOT_ACCESS_METHOD, SET_QUANTILE_METHOD_NAME, percentileImpl.getClass().getName()); } catch (InvocationTargetException e3) { throw new IllegalStateException(e3.getCause()); } } return apply(percentileImpl); } DescriptiveStatistics();  DescriptiveStatistics(int window);  DescriptiveStatistics(double[] initialDoubleArray);  DescriptiveStatistics(DescriptiveStatistics original); void addValue(double v); void removeMostRecentValue(); double replaceMostRecentValue(double v); double getMean(); double getGeometricMean(); double getVariance(); double getPopulationVariance(); double getStandardDeviation(); double getSkewness(); double getKurtosis(); double getMax(); double getMin(); long getN(); double getSum(); double getSumsq(); void clear(); int getWindowSize(); void setWindowSize(int windowSize); double[] getValues(); double[] getSortedValues(); double getElement(int index); double getPercentile(double p); @Override String toString(); double apply(UnivariateStatistic stat); synchronized UnivariateStatistic getMeanImpl(); synchronized void setMeanImpl(UnivariateStatistic meanImpl); synchronized UnivariateStatistic getGeometricMeanImpl(); synchronized void setGeometricMeanImpl(
            UnivariateStatistic geometricMeanImpl); synchronized UnivariateStatistic getKurtosisImpl(); synchronized void setKurtosisImpl(UnivariateStatistic kurtosisImpl); synchronized UnivariateStatistic getMaxImpl(); synchronized void setMaxImpl(UnivariateStatistic maxImpl); synchronized UnivariateStatistic getMinImpl(); synchronized void setMinImpl(UnivariateStatistic minImpl); synchronized UnivariateStatistic getPercentileImpl(); synchronized void setPercentileImpl(UnivariateStatistic percentileImpl); synchronized UnivariateStatistic getSkewnessImpl(); synchronized void setSkewnessImpl(
            UnivariateStatistic skewnessImpl); synchronized UnivariateStatistic getVarianceImpl(); synchronized void setVarianceImpl(
            UnivariateStatistic varianceImpl); synchronized UnivariateStatistic getSumsqImpl(); synchronized void setSumsqImpl(UnivariateStatistic sumsqImpl); synchronized UnivariateStatistic getSumImpl(); synchronized void setSumImpl(UnivariateStatistic sumImpl); DescriptiveStatistics copy(); static void copy(DescriptiveStatistics source, DescriptiveStatistics dest); static final int INFINITE_WINDOW; }
@Test public void testMath1129(){ final double[] data = new double[] { -0.012086732064244697, -0.24975668704012527, 0.5706168483164684, -0.322111769955327, 0.24166759508327315, Double.NaN, 0.16698443218942854, -0.10427763937565114, -0.15595963093172435, -0.028075857595882995, -0.24137994506058857, 0.47543170476574426, -0.07495595384947631, 0.37445697625436497, -0.09944199541668033 }; final DescriptiveStatistics ds = new DescriptiveStatistics(data); final double t = ds.getPercentile(75); final double o = ds.getPercentile(25); final double iqr = t - o; Assert.assertTrue(iqr >= 0); }