public class TallyStore extends Tally
Tally for which the individual
observations are stored in a list implemented as a
DoubleArrayList.
The DoubleArrayList object used to
store the values can be either passed to the constructor or created by
the constructor, and can be accessed via the
getDoubleArrayList method.
The same counters as in Tally are maintained and are used by
the inherited methods. One must access the list of observations
to compute quantities not supported by the methods in
Tally, and/or to use methods provided by the COLT package.
Never add or remove observations directly on the
DoubleArrayList object,
because this would put the counters of the TallyStore object in an
inconsistent state.
There are two potential reasons for using a TallyStore object
instead of directly using a DoubleArrayList object:
(a) it can broadcast observations and
(b) it maintains a few additional counters that may speed up some operations
such as computing the average.
| Constructor and Description |
|---|
TallyStore()
Constructs a new TallyStore statistical probe.
|
TallyStore(DoubleArrayList a)
Constructs a new TallyStore statistical probe
with given associated array.
|
TallyStore(int capacity)
Constructs a new TallyStore statistical probe
with given initial capacity capacity for its associated array.
|
TallyStore(java.lang.String name)
Constructs a new TallyStore statistical probe with name name.
|
TallyStore(java.lang.String name,
int capacity)
Constructs a new TallyStore statistical probe with
name name and given initial capacity capacity for its
associated array.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(double x)
Gives a new observation x to the statistical collector.
|
TallyStore |
clone()
Clones this object and the array which stores the observations.
|
double |
covariance(TallyStore t2)
Returns the sample covariance of the observations contained
in this tally, and the other tally t2.
|
double[] |
getArray()
Returns the observations stored in this probe.
|
DoubleArrayList |
getDoubleArrayList()
Returns the
DoubleArrayList
object that contains the observations for this probe. |
void |
init()
Initializes the statistical collector.
|
void |
quickSort()
Sorts the elements of this probe using the quicksort
from Colt.
|
java.lang.String |
toString()
Returns the observations stored in this object as a String.
|
average, confidenceIntervalNormal, confidenceIntervalStudent, confidenceIntervalVarianceChi2, formatCINormal, formatCINormal, formatCIStudent, formatCIStudent, formatCIVarianceChi2, formatConfidenceIntervalNormal, formatConfidenceIntervalNormal, formatConfidenceIntervalStudent, formatConfidenceIntervalStudent, getConfidenceLevel, numberObs, report, report, reportAndCIStudent, reportAndCIStudent, reportAndConfidenceIntervalStudent, reportAndConfidenceIntervalStudent, setConfidenceIntervalNone, setConfidenceIntervalNormal, setConfidenceIntervalStudent, setConfidenceLevel, setShowNumberObs, shortReport, shortReportHeader, standardDeviation, varianceaddObservationListener, clearObservationListeners, getName, isBroadcasting, isCollecting, max, min, notifyListeners, removeObservationListener, report, report, setBroadcasting, setCollecting, setName, sumpublic TallyStore()
public TallyStore(java.lang.String name)
name - the name of the tally.public TallyStore(int capacity)
capacity - initial capacity of the array of observationspublic TallyStore(java.lang.String name,
int capacity)
name - the name of the tally.capacity - initial capacity of the array of observationspublic TallyStore(DoubleArrayList a)
a - array that will contain observationspublic void init()
StatProbepublic void add(double x)
TallynotifyListeners.public double[] getArray()
public DoubleArrayList getDoubleArrayList()
DoubleArrayList
object that contains the observations for this probe. WARNING:
In previous releases, this function was named getArray.public void quickSort()
public double covariance(TallyStore t2)
t2 - the other tally.public TallyStore clone()
public java.lang.String toString()
toString in class java.lang.ObjectTo submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.