|
| ListOfTallies () |
| Constructs a new empty list of tallies.
|
|
| ListOfTallies (String name) |
| Constructs a new empty list of tallies with name name . More...
|
|
void | add (double[] x) |
| Adds the observation x[i] in tally i of this list, for i = 0,…, size() - 1 . More...
|
|
int | numberObs () |
| Assuming that each tally in this list contains the same number of observations, returns the number of observations in tally 0, or 0 if this list is empty. More...
|
|
boolean | areAllNumberObsEqual () |
| Tests that every tally in this list contains the same number of observations. More...
|
|
void | average (double[] r) |
| Computes the average for each tally in this list, and stores the averages in the array r . More...
|
|
void | variance (double[] v) |
| For each tally in this list, computes the sample variance, and stores the variances into the array v . More...
|
|
void | standardDeviation (double[] std) |
| For each tally in this list, computes the sample standard deviation, and stores the standard deviations into the array std . More...
|
|
double | covariance (int i, int j) |
| Returns the empirical covariance of the observations in tallies with indices i and j . More...
|
|
double | correlation (int i, int j) |
| Returns the empirical correlation between the observations in tallies with indices i and j . More...
|
|
void | covariance (DoubleMatrix2D c) |
| Constructs and returns the sample covariance matrix for the tallies in this list. More...
|
|
void | correlation (DoubleMatrix2D c) |
| Similar to covariance(DoubleMatrix2D) for computing the sample correlation matrix. More...
|
|
ListOfTallies< E > | clone () |
| Clones this object. More...
|
|
| ListOfStatProbes () |
| Constructs an empty list of statistical probes.
|
|
| ListOfStatProbes (String name) |
| Constructs an empty list of statistical probes with name name . More...
|
|
String | getName () |
| Returns the global name of this list of statistical probes. More...
|
|
void | setName (String name) |
| Sets the global name of this list to name . More...
|
|
boolean | isModifiable () |
| Determines if this list of statistical probes is modifiable, i.e., if probes can be added or removed. More...
|
|
void | setUnmodifiable () |
| Forbids any future modification to this list of statistical probes. More...
|
|
void | init () |
| Initializes this list of statistical probes by calling umontreal.ssj.stat.StatProbe.init on each element.
|
|
void | sum (double[] s) |
| For each probe in the list, computes the sum by calling umontreal.ssj.stat.StatProbe.sum, and stores the results into the array s . More...
|
|
void | average (double[] a) |
| For each probe in this list, computes the average by calling umontreal.ssj.stat.StatProbe.average, and stores the results into the array a . More...
|
|
boolean | isCollecting () |
| Determines if this list of statistical probes is collecting values. More...
|
|
void | setCollecting (boolean c) |
| Sets the status of the statistical collecting mechanism to c . More...
|
|
boolean | isBroadcasting () |
| Determines if this list of statistical probes is broadcasting observations to registered observers. More...
|
|
void | setBroadcasting (boolean b) |
| Sets the status of the observation broadcasting mechanism to b . More...
|
|
void | addArrayOfObservationListener (ArrayOfObservationListener l) |
| Adds the observation listener l to the list of observers of this list of statistical probes. More...
|
|
void | removeArrayOfObservationListener (ArrayOfObservationListener l) |
| Removes the observation listener l from the list of observers of this list of statistical probes. More...
|
|
void | clearArrayOfObservationListeners () |
| Removes all observation listeners from the list of observers of this list of statistical probes.
|
|
void | notifyListeners (double[] x) |
| Notifies the observation x to all registered observers if broadcasting is ON. More...
|
|
String | report () |
| Formats a report for each probe in the list of statistical probes. More...
|
|
ListOfStatProbes< E > | clone () |
| Clones this object. More...
|
|
boolean | add (E o) |
|
void | add (int index, E o) |
|
boolean | addAll (Collection<? extends E > c) |
|
boolean | addAll (int index, Collection<? extends E > c) |
|
void | clear () |
|
boolean | contains (Object o) |
|
boolean | containsAll (Collection<?> c) |
|
boolean | equals (Object o) |
|
E | get (int index) |
|
int | hashCode () |
|
int | indexOf (Object o) |
|
boolean | isEmpty () |
|
Iterator< E > | iterator () |
|
int | lastIndexOf (Object o) |
|
ListIterator< E > | listIterator () |
|
ListIterator< E > | listIterator (int index) |
|
E | remove (int index) |
|
boolean | remove (Object o) |
|
boolean | removeAll (Collection<?> c) |
|
boolean | retainAll (Collection<?> c) |
|
E | set (int index, E element) |
|
int | size () |
|
List< E > | subList (int fromIndex, int toIndex) |
|
Object [] | toArray () |
|
Represents a list of tally statistical collectors.
Each element of the list is an instance of umontreal.ssj.stat.Tally, and a vector of observations can be added with the #add(double[]) method. This class defines factory methods to fill a newly-constructed list with Tally
or TallyStore
instances.
double covariance |
( |
int |
i, |
|
|
int |
j |
|
) |
| |
Returns the empirical covariance of the observations in tallies with indices i
and j
.
If \(x_1,…,x_n\) represent the observations in tally i
whereas \(y_1,…,y_n\) represent the observations in tally j
, then the covariance is given by
\[ S_{X, Y} = \frac{1}{n-1}\sum_{k=1}^n (x_k - \bar{X}_n)(y_k - \bar{Y}_n) = \frac{1}{n-1}\left(\sum_{k=1}^n x_ky_k - \frac{1}{n} \sum_{k=1}^n x_k\sum_{r=1}^n y_r\right). \]
This returns Double.NaN
if the tallies do not contain the same number of observations, or if they contain less than two observations. This method throws an exception if the underlying tallies are not capable of storing observations, i.e. if the tallies are not TallyStores. The ListOfTalliesWithCovariance subclass provides an alternative implementation of this method which does not require the observations to be stored.
- Parameters
-
i | the index of the first tally. |
j | the index of the second tally. |
- Returns
- the value of the covariance.
- Exceptions
-
ArrayIndexOutOfBoundsException | if one or both indices are out of bounds. |