/** * Construct a MultivariateSummaryStatistics instance * @param k dimension of the data * @param isCovarianceBiasCorrected if true, the unbiased sample * covariance is computed, otherwise the biased population covariance * is computed */ public MultivariateSummaryStatistics(int k, boolean isCovarianceBiasCorrected) { this.k = k; sumImpl = new StorelessUnivariateStatistic[k]; sumSqImpl = new StorelessUnivariateStatistic[k]; minImpl = new StorelessUnivariateStatistic[k]; maxImpl = new StorelessUnivariateStatistic[k]; sumLogImpl = new StorelessUnivariateStatistic[k]; geoMeanImpl = new StorelessUnivariateStatistic[k]; meanImpl = new StorelessUnivariateStatistic[k]; for (int i = 0; i < k; ++i) { sumImpl[i] = new Sum(); sumSqImpl[i] = new SumOfSquares(); minImpl[i] = new Min(); maxImpl[i] = new Max(); sumLogImpl[i] = new SumOfLogs(); geoMeanImpl[i] = new GeometricMean(); meanImpl[i] = new Mean(); } covarianceImpl = new VectorialCovariance(k, isCovarianceBiasCorrected); }
/** * Copies source to dest. * <p>Neither source nor dest can be null.</p> * * @param source Min to copy * @param dest Min to copy to * @throws NullArgumentException if either source or dest is null */ public static void copy(Min source, Min dest) throws NullArgumentException { MathUtils.checkNotNull(source); MathUtils.checkNotNull(dest); dest.setData(source.getDataRef()); dest.n = source.n; dest.value = source.value; } }
private void createHistogram(double[] x){ n = x.length; Min min = new Min(); Max max = new Max(); Mean mean = new Mean(); min.increment(x[i]); max.increment(x[i]); mean.increment(x[i]); double range = max.getResult() - min.getResult(); double lowestBoundary = min.getResult()-range/1000; double largestBoundary = max.getResult()+range/1000; binCalc = new ScottBinCalculation(n, min.getResult(), max.getResult(), sd.getResult()); }else if(binCalculationType== BinCalculationType.FREEDMAN_DIACONIS){ Percentile percentile = new Percentile(); double q1 = percentile.evaluate(x, 25); double q3 = percentile.evaluate(x, 75); binCalc = new FreedmanDiaconisBinCalculation(n, min.getResult(), max.getResult(), q1, q3); }else if(binCalculationType==BinCalculationType.STURGES){ binCalc = new SturgesBinCalculation(n, min.getResult(), max.getResult());
/** * Construct the object using the supplied arrays of points and weights. * * @param points discrete real points * @param weights weights for the points */ public ContinuousQuadratureRule(double[] points, double[] weights){ Min min = new Min(); Max max = new Max(); this.numberOfPoints = points.length; this.min = min.evaluate(points); this.max = max.evaluate(points); //Enforce that min <= max if(this.min>this.max){ double temp = this.min; this.min = this.max; this.max = temp; } range = this.max-this.min; step = range/((double)numberOfPoints - 1.0); this.points = points; this.weights = weights; }
/** * Gets the smallest observed data points. * * @return smallest value. */ public double min(){ return min.getResult(); }
public void addCategory(Object categoryID, double scoreValue){ categoryMap.put(categoryID, new Category(categoryID, scoreValue)); maximumPossibleScore.increment(scoreValue); minimumPossibleScore.increment(scoreValue); scoreLevels.add(scoreValue); }
/** * Copy constructor, creates a new {@code Min} identical * to the {@code original} * * @param original the {@code Min} instance to copy * @throws NullArgumentException if original is null */ public Min(Min original) throws NullArgumentException { copy(original, this); }
throws MathIllegalArgumentException { double min = Double.NaN; if (test(values, begin, length)) { min = values[begin]; for (int i = begin; i < begin + length; i++) {
public long getMin() { return (long) min.getResult(); }
public void increment(DataPoint<? extends Number> dataPoint) { Number value = dataPoint.getValue(); min.increment(value.doubleValue()); average.increment(value.doubleValue()); max.increment(value.doubleValue()); sum.increment(value.doubleValue()); samples++; percentiles.stream().forEach(p -> p.addValue(value.doubleValue())); }
dest.min = (Min) dest.minImpl; } else { Min.copy(source.min, dest.min);
throws MathIllegalArgumentException { double min = Double.NaN; if (test(values, begin, length)) { min = values[begin]; for (int i = begin; i < begin + length; i++) {
@Override public Min createStatistic(){ return new Min(); } };
public double getMin(){ return min.getResult(); }
public void increment(DataPoint<? extends Number> dataPoint) { Number value = dataPoint.getValue(); min.increment(value.doubleValue()); average.increment(value.doubleValue()); max.increment(value.doubleValue()); sum.increment(value.doubleValue()); samples++; percentiles.stream().forEach(p -> p.addValue(value.doubleValue())); }
/** * Copies source to dest. * <p>Neither source nor dest can be null.</p> * * @param source Min to copy * @param dest Min to copy to * @throws NullArgumentException if either source or dest is null */ public static void copy(Min source, Min dest) throws NullArgumentException { MathUtils.checkNotNull(source); MathUtils.checkNotNull(dest); dest.setData(source.getDataRef()); dest.n = source.n; dest.value = source.value; } }
/** * Copy constructor, creates a new {@code Min} identical * to the {@code original} * * @param original the {@code Min} instance to copy * @throws NullArgumentException if original is null */ public Min(Min original) throws NullArgumentException { copy(original, this); }