25package umontreal.ssj.stat;
27import cern.colt.list.DoubleArrayList;
28import java.util.logging.Level;
29import java.util.logging.Logger;
30import umontreal.ssj.util.PrintfFormat;
59 private DoubleArrayList array =
null;
60 private Logger log = Logger.getLogger(
"umontreal.ssj.stat");
67 array =
new DoubleArrayList();
77 array =
new DoubleArrayList();
88 array =
new DoubleArrayList(capacity);
100 array =
new DoubleArrayList(capacity);
127 public void add(
double x) {
140 return array.elements();
174 log.logp(Level.WARNING,
"TallyStore",
"covariance",
175 "This tally, with name " +
getName() +
", contains " +
numberObs() +
" observations while "
176 +
"the given tally, with name " + t2.
getName() +
", contains " + t2.
numberObs() +
"observations");
183 log.logp(Level.WARNING,
"TallyStore",
"covariance",
184 "This tally, with name " +
getName() +
", contains " +
numberObs() +
" observation");
196 t.array = (DoubleArrayList) array.clone();
212 for (
int i = 0; i < numObs; i++) {
214 if ((x > a) & (x < b))
237 int numGroups = numObs / gsize;
241 for (
int i = 0; i < numGroups; i++) {
243 for (
int j = 0; j < gsize; j++)
244 sum += obs[gsize * i + j];
249 int rest = numObs - numGroups * gsize;
252 for (
int j = 0; j < rest; j++)
253 sum += obs[gsize * numGroups + j];
264 StringBuffer sb =
new StringBuffer();
267 return sb.toString();
String getName()
Returns the name associated with this probe, or null if no name was specified upon construction.
void quickSort()
Sorts the elements of this probe using the quicksort from Colt.
DoubleArrayList getDoubleArrayList()
Returns the DoubleArrayList object that contains the observations for this probe.
TallyStore aggregate(int gsize)
Returns a new TallyStore instance that contains aggregate observations from this TallyStore.
double[] getArray()
Returns the observations stored in this probe.
double covariance(TallyStore t2)
Returns the sample covariance of the observations contained in this tally, and the other tally t2.
TallyStore(String name, int capacity)
Constructs a new TallyStore statistical probe with name name and given initial capacity capacity for ...
void init()
Initializes the statistical collector.
TallyStore(String name)
Constructs a new TallyStore statistical probe with name name.
String toString()
Returns the observations stored in this object as a String.
TallyStore(int capacity)
Constructs a new TallyStore statistical probe with given initial capacity capacity for its associated...
TallyStore clone()
Clones this object and the array which stores the observations.
TallyStore extractSubrange(double a, double b)
Returns a new TallyStore instance that contains all the observations of this TallyStore than are in t...
void add(double x)
Adds one observation x to this probe.
TallyStore(DoubleArrayList a)
Constructs a new TallyStore statistical probe with given associated array.
TallyStore()
Constructs a new TallyStore statistical probe.
double sum()
Returns the sum cumulated so far for this probe.
int numberObs()
Returns the number of observations given to this probe since its last initialization.
Tally()
Constructs a new unnamed Tally statistical probe.