Class UnivariateStatistics

java.lang.Object
xal.tools.statistics.UnivariateStatistics
Direct Known Subclasses:
MutableUnivariateStatistics, RunningWeightedStatistics

public class UnivariateStatistics extends Object
UnivariateStatistics calculates statistics of a series of measurements. UnivariateStatistics is immutable. Use MutableUnivariateStatistics if you need to update the statistics with measurements. Only simple statistics are generated (mean and standard deviation).
Author:
tap
  • Field Details

    • population

      protected int population
      the number of samples
    • mean

      protected double mean
      the mean and mean square of the samples
    • meanSquare

      protected double meanSquare
  • Constructor Details

    • UnivariateStatistics

      public UnivariateStatistics()
      Constructor with no samples.
    • UnivariateStatistics

      public UnivariateStatistics(UnivariateStatistics stats)
      Copy constructor
      Parameters:
      stats - the statistics to copy
    • UnivariateStatistics

      public UnivariateStatistics(UnivariateStatistics stats, double scale)
      Constructor which scales the samples from an existing set of statistics.
      Parameters:
      stats - the statistics against which to scale
      scale - factor which is used to scale the copied statistics
    • UnivariateStatistics

      public UnivariateStatistics(int size, double average, double averageSquare)
      Primary Constructor with a starting set of statistics.
      Parameters:
      size - the number of samples
      average - the mean
      averageSquare - the mean square of the samples
  • Method Details

    • population

      public int population()
      Get the population of the samples (i.e. the number of samples)
      Returns:
      the number of samples
    • mean

      public double mean()
      Get the mean of the samples.
      Returns:
      the mean of the samples
    • meanSquare

      public double meanSquare()
      Get the mean square of the samples.
      Returns:
      the mean of the samples
    • standardDeviation

      public double standardDeviation()
      Get the standard deviation of the samples.
      Returns:
      the standard deviation of the samples
    • variance

      public double variance()
      Get the variance of the samples.
      Returns:
      the variance of the samples
    • sampleStandardDeviation

      public double sampleStandardDeviation()
      Get the sample standard deviation of the measurements (implies a random subset of all data).
      Returns:
      the sample standard deviation
    • sampleVariance

      public double sampleVariance()
      Get the sample variance of the measurements (implies a random subset of all data).
      Returns:
      the sample variance of the measurements
    • varianceOfMean

      public double varianceOfMean()
      Get the variance of the mean from the actual value.
      Returns:
      the variance of the mean from the actual value
    • standardDeviationOfMean

      public double standardDeviationOfMean()
      Get the standard deviation of the mean from the actual value.
      Returns:
      the standard deviation of the mean from the actual value
    • sampleVarianceOfMean

      public double sampleVarianceOfMean()
      Get the variance of the mean from the actual value assuming the supporting data is a random subset of all the data.
      Returns:
      the sample variance of the mean
    • sampleStandardDeviationOfMean

      public double sampleStandardDeviationOfMean()
      Get the standard deviation of the mean from the actual value assuming the supporting data is a random subset of all the data.
      Returns:
      the sample standard deviation of the mean