public class SimpleStatsTally extends AbstractSimpleStats
A frequent use is as a PropertyChangeListener. In this capacity, an instance
listens for a single property name and adds a new observation if the newValue
is of type Number
| Modifier and Type | Field and Description |
|---|---|
private double |
diff
The difference between the current observation and the mean.
|
private double |
mean
The mean of the statistic.
|
private double |
variance
The variance of the statistic.
|
count, DEFAULT_NAME, DEFAULT_NUMBER_FORMAT, maxObs, minObs, name, numberFormatEOL| Constructor and Description |
|---|
SimpleStatsTally()
Construct a SimpleStatsTally with the default name.
|
SimpleStatsTally(SimpleStatsTally original) |
SimpleStatsTally(java.lang.String name)
Construct a SimpleStatsTally with the given name.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getMean()
Gets the current mean of the statistic
|
SamplingType |
getSamplingType()
Returns the SamplingType which is always
TALLY. |
double |
getStandardDeviation()
Gets the current standard deviation of the statistic
|
double |
getVariance()
Gets the current variance of the statistic
|
void |
newObservation(double x)
Update counters with a new observation.
|
void |
reset()
Should reset/initialize all relevant counters.
|
clone, getCount, getDataLine, getMaxObs, getMinObs, getName, newObservation, newObservation, newObservation, propertyChange, setName, setNumberFormat, setSamplingType, toStringprivate double mean
private double variance
private double diff
public SimpleStatsTally()
public SimpleStatsTally(java.lang.String name)
name - The property name that will be listened to.public SimpleStatsTally(SimpleStatsTally original)
public void newObservation(double x)
newObservation in interface SampleStatisticsnewObservation in class AbstractSimpleStatsx - The new (primitive) observation.public double getMean()
public double getVariance()
public double getStandardDeviation()
public SamplingType getSamplingType()
TALLY.public void reset()
SampleStatisticsreset in interface SampleStatisticsreset in class AbstractSimpleStats