public class Samples extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
private double |
product |
private double |
sum |
private double |
sumInv |
private double |
sumSqr |
private int |
total |
Constructor and Description |
---|
Samples()
Empty object where the internal values are initialised to 0.
|
Samples(double value)
Initialise the internal values of the accumulator with the argument given.
|
Modifier and Type | Method and Description |
---|---|
Samples |
add(double value)
Add an observable (value) to the accumulator.
|
Samples |
add(Samples value)
Add the contents of anther accumulator to this accumulator.
|
void |
clear()
Clear the contents of the accumulator.
|
double |
getGeometricMean()
Obtain the geometric mean of the set of observables in the accumulator.
|
double |
getHarmonicMean()
Obtain the harmonic mean of the set of observables in the accumulator.
|
double |
getMean()
Obtain the mean of the set of observables in the accumulator.
|
double |
getRootMeanSquare()
Obtain the root mean square of the set of observables in the accumulator.
|
int |
getSize()
Get the number of items added to the Accumulator.
|
double |
getStdDev()
Obtain the standard deviation (error in the mean) of the set of observeables in the accumulator.
|
double |
getSum()
Get the sum of the values held in the accumulator.
|
String |
getSummary()
Get a tab delimited string of the mean and standard deviation of the values in the accumulator.
|
double |
getVariance()
Default sample variance implementation based on the second moment \f$ M_n^{(2)} \f$ moment<2>, mean and count.
|
private double sum
private double sumSqr
private double product
private double sumInv
private int total
public Samples()
public Samples(double value)
value
- the value to initialise the internal variables.public final Samples add(double value)
value
- add the value to the accumulated values.public final Samples add(Samples value)
value
- add the value to the accumulated values.public final double getMean()
public final double getRootMeanSquare()
public final double getGeometricMean()
public final double getHarmonicMean()
public final double getSum()
public final int getSize()
public final double getVariance()
public final double getStdDev()
public final void clear()
public final String getSummary()
Copyright © 2015 University of Glasgow. All rights reserved.