**'umontreal.iro.lecuyer.stat.list.ListOfTalliesWithCovariance'**Java class

## Class ListOfTalliesWithCovariance<E extends Tally>

- java.lang.Object
- umontreal.iro.lecuyer.stat.list.ListOfStatProbes<E>
- umontreal.iro.lecuyer.stat.list.ListOfTallies<E>
- umontreal.iro.lecuyer.stat.list.ListOfTalliesWithCovariance<E>

- All Implemented Interfaces:
- Cloneable, Iterable<E>, Collection<E>, List<E>, RandomAccess

public class ListOfTalliesWithCovariance<E extends Tally>extends ListOfTallies<E>

Extends`ListOfTallies`

to add support for the computation of the sample covariance between each pair of elements in a list, without storing all observations. This list of tallies contains internal structures to keep track of bar(X)_{n, i}for*i*= 0,…,*d*- 1, and ∑_{k=0}^{n-1}(*X*_{i, k}- bar(X)_{k, i})(*X*_{j, k}- bar(X)_{k, j})/*n*, for*i*= 0,…,*d*- 2 and*j*= 1,…,*d*- 1, with*j*>*i*. Here, bar(X)_{n, i}is the*i*th component of bar()**X**_{n}, the average vector, and bar(X)_{0, i}= 0 for*i*= 0,…,*d*- 1. The value*X*_{i, k}corresponds to the*i*th component of the*k*th observation**X**_{k}. These sums are updated every time a vector is added to this list, and are used to estimate the covariances.Note: the size of the list of tallies must remain fixed because of the data structures used for computing sample covariances. As a result, the first call to

`init`makes this list unmodifiable.Note: for the sample covariance to be computed between a pair of tallies, the number of observations in each tally should be the same. It is therefore recommended to always add complete vectors of observations to this list. Moreover, one must use the

`add`

method in this class to add vectors of observations for the sums used for covariance estimation to be updated correctly. Failure to use this method, e.g., adding observations to each individual tally in the list, will result in an incorrect estimate of the covariances, unless the tallies in the list can store observations. For example, the following code, which adds the vector`v`in the list of tallies`list`, works correctly only if the list contains instances of`TallyStore`

:`for (int i = 0; i < v.length; i++)`

list.get (i).add (v[i]);`list.add (v);`

**Warning:**You cannot see the full API documentation of this class since the access to the DatMelt documentation for third-party Java classes is denied. Guests can only view jhplot Java API. To view the complete description of this class and its methods, please request the full DataMelt membership.

If you are already a full member, please login to the DataMelt member area before visiting this documentation.