Tabnine Logo
StatisticalSummary
Code IndexAdd Tabnine to your IDE (free)

How to use
StatisticalSummary
in
org.apache.commons.math.stat.descriptive

Best Java code snippets using org.apache.commons.math.stat.descriptive.StatisticalSummary (Showing top 20 results out of 315)

origin: commons-math/commons-math

/**
 * Computes a <a href="http://www.itl.nist.gov/div898/handbook/prc/section2/prc22.htm#formula">
 * t statistic </a> to use in comparing the mean of the dataset described by 
 * <code>sampleStats</code> to <code>mu</code>.
 * <p>
 * This statistic can be used to perform a one sample t-test for the mean.
 * </p><p>
 * <strong>Preconditions</strong>: <ul>
 * <li><code>observed.getN() > = 2</code>.
 * </li></ul></p>
 *
 * @param mu comparison constant
 * @param sampleStats DescriptiveStatistics holding sample summary statitstics
 * @return t statistic
 * @throws IllegalArgumentException if the precondition is not met
 */
public double t(double mu, StatisticalSummary sampleStats)
throws IllegalArgumentException {
  if ((sampleStats == null) || (sampleStats.getN() < 2)) {
    throw new IllegalArgumentException("insufficient data for t statistic");
  }
  return t(sampleStats.getMean(), mu, sampleStats.getVariance(),
      sampleStats.getN());
}
origin: datacleaner/DataCleaner

nav.where(measureDimension, MEASURE_ROW_COUNT).put(numRows);
final long nonNullCount = s.getN();
  final double highestValue = s.getMax();
  final double lowestValue = s.getMin();
  final double sum = s.getSum();
  final double mean = s.getMean();
  final double standardDeviation = s.getStandardDeviation();
  final double variance = s.getVariance();
origin: datacleaner/DataCleaner

@Override
protected Serializable reduceValues(final List<Object> slaveValues, final String column, final String measure,
    final Collection<? extends NumberAnalyzerResult> results, final Class<?> valueClass) {
  if (SUM_MEASURES.contains(measure)) {
    return sum(slaveValues);
  } else if (NumberAnalyzer.MEASURE_HIGHEST_VALUE.equals(measure)) {
    return maximum(slaveValues);
  } else if (NumberAnalyzer.MEASURE_LOWEST_VALUE.equals(measure)) {
    return minimum(slaveValues);
  } else if (NumberAnalyzer.MEASURE_MEAN.equals(measure)) {
    final StatisticalSummary summary = getSummary(column, results);
    return summary.getMean();
  } else if (NumberAnalyzer.MEASURE_STANDARD_DEVIATION.equals(measure)) {
    final StatisticalSummary summary = getSummary(column, results);
    return summary.getStandardDeviation();
  } else if (NumberAnalyzer.MEASURE_VARIANCE.equals(measure)) {
    final StatisticalSummary summary = getSummary(column, results);
    return summary.getVariance();
  }
  logger.warn("Encountered non-reduceable measure '{}'. Slave values are: {}", measure, slaveValues);
  return null;
}
origin: org.apache.commons/commons-math

/**
 * Computes the empirical distribution using values from the file
 * in <code>valuesFileURL</code> and <code>binCount</code> bins.
 * <p>
 * <code>valuesFileURL</code> must exist and be readable by this process
 * at runtime.</p>
 * <p>
 * This method must be called before using <code>getNext()</code>
 * with <code>mode = DIGEST_MODE</code></p>
 *
 * @param binCount the number of bins used in computing the empirical
 * distribution
 * @throws IOException if an error occurs reading the input file
 */
public void computeDistribution(int binCount)
    throws IOException {
  empiricalDistribution = new EmpiricalDistributionImpl(binCount);
  empiricalDistribution.load(valuesFileURL);
  mu = empiricalDistribution.getSampleStats().getMean();
  sigma = empiricalDistribution.getSampleStats().getStandardDeviation();
}
origin: org.apache.commons/commons-math

/** Check sample data.
 * @param stat statistical summary
 * @exception IllegalArgumentException if there is not enough sample data
 */
private void checkSampleData(final StatisticalSummary stat)
  throws IllegalArgumentException {
  if ((stat == null) || (stat.getN() < 2)) {
    throw MathRuntimeException.createIllegalArgumentException(
       LocalizedFormats.INSUFFICIENT_DATA_FOR_T_STATISTIC,
       (stat == null) ? 0 : stat.getN());
  }
}
origin: datacleaner/DataCleaner

public Date getMean() {
  final double meanTimestamp = _statistics.getMean();
  if (Double.isNaN(meanTimestamp)) {
    return null;
  }
  return new Date(Double.valueOf(meanTimestamp).longValue());
}
origin: org.eobjects.analyzerbeans/AnalyzerBeans-basic-analyzers

if (value != null) {
  double doubleValue = value.doubleValue();
  double max = _statistics.getMax();
  double min = _statistics.getMin();
  max = _statistics.getMax();
  min = _statistics.getMin();
origin: org.eobjects.analyzerbeans/AnalyzerBeans-basic-analyzers

nav.where(measureDimension, MEASURE_ROW_COUNT).put(numRows);
long nonNullCount = s.getN();
  final double highestValue = s.getMax();
  final double lowestValue = s.getMin();
  final double sum = s.getSum();
  final double mean = s.getMean();
  final double standardDeviation = s.getStandardDeviation();
  final double variance = s.getVariance();
origin: org.eobjects.analyzerbeans/AnalyzerBeans-basic-analyzers

@Override
protected Serializable reduceValues(List<Object> slaveValues, String column, String measure,
    Collection<? extends NumberAnalyzerResult> results, Class<?> valueClass) {
  if (SUM_MEASURES.contains(measure)) {
    return sum(slaveValues);
  } else if (NumberAnalyzer.MEASURE_HIGHEST_VALUE.equals(measure)) {
    return maximum(slaveValues);
  } else if (NumberAnalyzer.MEASURE_LOWEST_VALUE.equals(measure)) {
    return minimum(slaveValues);
  } else if (NumberAnalyzer.MEASURE_MEAN.equals(measure)) {
    StatisticalSummary summary = getSummary(column, results);
    return summary.getMean();
  } else if (NumberAnalyzer.MEASURE_STANDARD_DEVIATION.equals(measure)) {
    StatisticalSummary summary = getSummary(column, results);
    return summary.getStandardDeviation();
  } else if (NumberAnalyzer.MEASURE_VARIANCE.equals(measure)) {
    StatisticalSummary summary = getSummary(column, results);
    return summary.getVariance();
  }
  
  logger.warn("Encountered non-reduceable measure '{}'. Slave values are: {}", measure, slaveValues);
  return null;
}
origin: commons-math/commons-math

/**
 * Computes the empirical distribution using values from the file
 * in <code>valuesFileURL</code> and <code>binCount</code> bins.
 * <p>
 * <code>valuesFileURL</code> must exist and be readable by this process
 * at runtime.</p>
 * <p>
 * This method must be called before using <code>getNext()</code>
 * with <code>mode = DIGEST_MODE</code></p>
 *
 * @param binCount the number of bins used in computing the empirical
 * distribution
 * @throws IOException if an error occurs reading the input file
 */
public void computeDistribution(int binCount)
    throws IOException {
  empiricalDistribution = new EmpiricalDistributionImpl(binCount);
  empiricalDistribution.load(valuesFileURL);
  mu = empiricalDistribution.getSampleStats().getMean();
  sigma = empiricalDistribution.getSampleStats().getStandardDeviation();
}
origin: org.apache.commons/math

/** Check sample data.
 * @param stat statistical summary
 * @exception IllegalArgumentException if there is not enough sample data
 */
private void checkSampleData(final StatisticalSummary stat)
  throws IllegalArgumentException {
  if ((stat == null) || (stat.getN() < 2)) {
    throw MathRuntimeException.createIllegalArgumentException(
       INSUFFICIENT_DATA_MESSAGE,
       (stat == null) ? 0 : stat.getN());
  }
}
origin: org.eobjects.analyzerbeans/AnalyzerBeans-basic-analyzers

public Date getMean() {
  double meanTimestamp = _statistics.getMean();
  if (Double.isNaN(meanTimestamp)) {
    return null;
  }
  return new Date(Double.valueOf(meanTimestamp).longValue());
}
origin: datacleaner/DataCleaner

if (value != null) {
  final double doubleValue = value.doubleValue();
  double max = _statistics.getMax();
  double min = _statistics.getMin();
  max = _statistics.getMax();
  min = _statistics.getMin();
origin: commons-math/commons-math

throws IllegalArgumentException, MathException {
  if ((sampleStats1 == null) || (sampleStats2 == null ||
      Math.min(sampleStats1.getN(), sampleStats2.getN()) < 2)) {
    throw new IllegalArgumentException("insufficient data for t statistic");
  return tTest(sampleStats1.getMean(), sampleStats2.getMean(), sampleStats1.getVariance(),
      sampleStats2.getVariance(), (double) sampleStats1.getN(), 
      (double) sampleStats2.getN());
origin: org.apache.commons/math

/**
 * Computes the empirical distribution using values from the file
 * in <code>valuesFileURL</code> and <code>binCount</code> bins.
 * <p>
 * <code>valuesFileURL</code> must exist and be readable by this process
 * at runtime.</p>
 * <p>
 * This method must be called before using <code>getNext()</code>
 * with <code>mode = DIGEST_MODE</code></p>
 *
 * @param binCount the number of bins used in computing the empirical
 * distribution
 * @throws IOException if an error occurs reading the input file
 */
public void computeDistribution(int binCount)
    throws IOException {
  empiricalDistribution = new EmpiricalDistributionImpl(binCount);
  empiricalDistribution.load(valuesFileURL);
  mu = empiricalDistribution.getSampleStats().getMean();
  sigma = empiricalDistribution.getSampleStats().getStandardDeviation();
}
origin: commons-math/commons-math

if ((sampleStats1 == null) ||
    (sampleStats2 == null ||
        Math.min(sampleStats1.getN(), sampleStats2.getN()) < 2)) {
  throw new IllegalArgumentException("insufficient data for t statistic");
return t(sampleStats1.getMean(), sampleStats2.getMean(), 
    sampleStats1.getVariance(), sampleStats2.getVariance(),
    (double) sampleStats1.getN(), (double) sampleStats2.getN());
origin: commons-math/commons-math

throws IllegalArgumentException, MathException {
  if ((sampleStats1 == null) || (sampleStats2 == null ||
      Math.min(sampleStats1.getN(), sampleStats2.getN()) < 2)) {
    throw new IllegalArgumentException("insufficient data for t statistic");
  return homoscedasticTTest(sampleStats1.getMean(),
      sampleStats2.getMean(), sampleStats1.getVariance(),
      sampleStats2.getVariance(), (double) sampleStats1.getN(), 
      (double) sampleStats2.getN());
origin: commons-math/commons-math

if ((sampleStats == null) || (sampleStats.getN() < 2)) {
  throw new IllegalArgumentException("insufficient data for t statistic");
return tTest(sampleStats.getMean(), mu, sampleStats.getVariance(),
    sampleStats.getN());
origin: commons-math/commons-math

if ((sampleStats1 == null) ||
    (sampleStats2 == null ||
        Math.min(sampleStats1.getN(), sampleStats2.getN()) < 2)) {
  throw new IllegalArgumentException("insufficient data for t statistic");
return homoscedasticT(sampleStats1.getMean(), sampleStats2.getMean(), 
    sampleStats1.getVariance(), sampleStats2.getVariance(), 
    (double) sampleStats1.getN(), (double) sampleStats2.getN());
origin: org.apache.commons/commons-math

/**
 * Computes a <a href="http://www.itl.nist.gov/div898/handbook/prc/section2/prc22.htm#formula">
 * t statistic </a> to use in comparing the mean of the dataset described by
 * <code>sampleStats</code> to <code>mu</code>.
 * <p>
 * This statistic can be used to perform a one sample t-test for the mean.
 * </p><p>
 * <strong>Preconditions</strong>: <ul>
 * <li><code>observed.getN() > = 2</code>.
 * </li></ul></p>
 *
 * @param mu comparison constant
 * @param sampleStats DescriptiveStatistics holding sample summary statitstics
 * @return t statistic
 * @throws IllegalArgumentException if the precondition is not met
 */
public double t(double mu, StatisticalSummary sampleStats)
throws IllegalArgumentException {
  checkSampleData(sampleStats);
  return t(sampleStats.getMean(), mu, sampleStats.getVariance(),
      sampleStats.getN());
}
org.apache.commons.math.stat.descriptiveStatisticalSummary

Javadoc

Reporting interface for basic univariate statistics.

Most used methods

  • getMean
    Returns the arithmetic mean [http://www.xycoon.com/arithmetic_mean.htm] of the available values
  • getN
    Returns the number of available values
  • getStandardDeviation
    Returns the standard deviation of the available values.
  • getVariance
    Returns the variance of the available values.
  • getMax
    Returns the maximum of the available values
  • getMin
    Returns the minimum of the available values
  • getSum
    Returns the sum of the values that have been added to Univariate.

Popular in Java

  • Finding current android device location
  • putExtra (Intent)
  • setRequestProperty (URLConnection)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Runner (org.openjdk.jmh.runner)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now