Package xal.tools.statistics
Class UnivariateStatistics
java.lang.Object
xal.tools.statistics.UnivariateStatistics
- Direct Known Subclasses:
MutableUnivariateStatistics
,RunningWeightedStatistics
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 Summary
FieldsModifier and TypeFieldDescriptionprotected double
the mean and mean square of the samplesprotected double
protected int
the number of samples -
Constructor Summary
ConstructorsConstructorDescriptionConstructor with no samples.UnivariateStatistics
(int size, double average, double averageSquare) Primary Constructor with a starting set of statistics.Copy constructorUnivariateStatistics
(UnivariateStatistics stats, double scale) Constructor which scales the samples from an existing set of statistics. -
Method Summary
Modifier and TypeMethodDescriptiondouble
mean()
Get the mean of the samples.double
Get the mean square of the samples.int
Get the population of the samples (i.e. the number of samples)double
Get the sample standard deviation of the measurements (implies a random subset of all data).double
Get the standard deviation of the mean from the actual value assuming the supporting data is a random subset of all the data.double
Get the sample variance of the measurements (implies a random subset of all data).double
Get the variance of the mean from the actual value assuming the supporting data is a random subset of all the data.double
Get the standard deviation of the samples.double
Get the standard deviation of the mean from the actual value.double
variance()
Get the variance of the samples.double
Get the variance of the mean from the actual value.
-
Field Details
-
population
protected int populationthe number of samples -
mean
protected double meanthe mean and mean square of the samples -
meanSquare
protected double meanSquare
-
-
Constructor Details
-
UnivariateStatistics
public UnivariateStatistics()Constructor with no samples. -
UnivariateStatistics
Copy constructor- Parameters:
stats
- the statistics to copy
-
UnivariateStatistics
Constructor which scales the samples from an existing set of statistics.- Parameters:
stats
- the statistics against which to scalescale
- 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 samplesaverage
- the meanaverageSquare
- 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
-