SSJ
3.3.1
Stochastic Simulation in Java
|
Represents a list of tally statistical collectors for a vector of functions of multiple means. More...
Public Member Functions | |
ListOfFunctionOfMultipleMeansTallies () | |
Constructs a new empty list of tallies. | |
ListOfFunctionOfMultipleMeansTallies (String name) | |
Constructs a new empty list of tallies with name name . More... | |
void | add (double[][] x) |
For each tally i in this list, adds the vector x[i] . More... | |
void | add (DoubleMatrix2D x) |
Equivalent to add(x.toArray()), without copying the elements of x into a temporary 2D array. More... | |
void | addSameDimension (double[]... x) |
For each element i of this list of tallies, adds the vector of observations x[0][i] , …, x[d-1][i] . More... | |
void | addSameDimension (DoubleMatrix1D... x) |
Equivalent to #addSameDimension(double[][]) x.toArray() , without copying the elements of x into a temporary 1D array. More... | |
int | getDimension () |
Assuming that each tally in this list has the same dimension, returns the dimension of tally 0, or 0 if this list is empty. 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[] a) |
Computes the function of averages for each tally in this list. More... | |
void | variance (double[] v) |
For each tally in this list, computes the sample variance and stores it into v . More... | |
void | standardDeviation (double[] v) |
For each tally in this list, computes the standard deviation, and stores it into v . More... | |
ListOfFunctionOfMultipleMeansTallies< E > | clone () |
Clones this object. More... | |
Public Member Functions inherited from ListOfStatProbes< E > | |
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 () |
Static Public Member Functions | |
static ListOfFunctionOfMultipleMeansTallies< FunctionOfMultipleMeansTally > | create (MultivariateFunction func, int d, int size) |
This factory method constructs and returns a list of tallies with size instances ofumontreal.ssj.stat.FunctionOfMultipleMeansTally. More... | |
Package Attributes | |
double [][] | temp = null |
Additional Inherited Members | |
Protected Attributes inherited from ListOfStatProbes< E > | |
boolean | collect |
boolean | broadcast |
String | name |
Package Functions inherited from ListOfStatProbes< E > | |
public< T > T [] | toArray (T[] a) |
Represents a list of tally statistical collectors for a vector of functions of multiple means.
Each element of such a list is an instance of umontreal.ssj.stat.FunctionOfMultipleMeansTally, and observations can be added with the add(double[][]) method. This class defines a factory method to construct a list of tallies computing the same function and sharing the same dimension.
ListOfFunctionOfMultipleMeansTallies | ( | String | name | ) |
Constructs a new empty list of tallies with name name
.
name | the name of this list. |
void add | ( | double | x[][] | ) |
For each tally i
in this list, adds the vector x[i]
.
Since each element of the 2D array x
can have a different dimension, it is not necessary for x
to be rectangular, although this is generally the case. If collecting is turned ON, x[i]
is added into the i
th tally of this list.
x | the array of vectors of observations being added. |
IllegalArgumentException | if the length of x does not correspond to size() , or the length of x[i] does not correspond to the dimension of the underlying tally i , for at least one i . |
void add | ( | DoubleMatrix2D | x | ) |
Equivalent to add(x.toArray()), without copying the elements of x
into a temporary 2D array.
This can be used only when all the function of multiple means tallies in this list share the same dimension.
x | the matrix of observations being added, each row corresponding to a vector added to a tally. |
IllegalArgumentException | if the number of rows in x does not correspond to size() , or the number of columns does not correspond to the dimension of the underlying tallies. |
void addSameDimension | ( | double... [] | x | ) |
For each element i
of this list of tallies, adds the vector of observations x[0][i]
, …, x[d-1][i]
.
This method can be used only when all tallies in this list share the same dimension. It creates a transposed 2D array compatible with add(double[][]), and calls the latter method with this array. For example, let lt
be a list of tallies whose l
elements correspond to ratios. If a program can generate two arrays num
and den
of length l
representing observations for the numerator and denominator of the ratios, respectively, the observations can be added using lt.add (num, den)
instead of creating an intermediate matrix of observations.
x | the 2D array of observations. |
IllegalArgumentException | if the length of x does not correspond to the dimension of the tally, or the length of the arrays x[j] are not equal for all j=0,…,d-1 . |
void addSameDimension | ( | DoubleMatrix1D... | x | ) |
Equivalent to #addSameDimension(double[][]) x.toArray()
, without copying the elements of x
into a temporary 1D array.
This can be used only when all the function of multiple means tallies in this list share the same dimension.
boolean areAllNumberObsEqual | ( | ) |
Tests that every tally in this list contains the same number of observations.
This returns true
if and only if all tallies have the same number of observations or if the list is empty.
void average | ( | double [] | a | ) |
Computes the function of averages for each tally in this list.
If the tally i
has no vector of observations, the Double.NaN
value is stored at index i
of the array a
.
ListOfFunctionOfMultipleMeansTallies<E> clone | ( | ) |
Clones this object.
This makes a shallow copy of this list, i.e., this does not clone all the objects in the list. The created clone is modifiable, even if the original list is unmodifiable.
|
static |
This factory method constructs and returns a list of tallies with size
instances of
umontreal.ssj.stat.FunctionOfMultipleMeansTally.
Each tally computes the multivariate function func
, in d
dimensions.
func | the multivariate function computed by the tallies. |
d | the dimension of the tallies. |
size | the size of the list. |
int getDimension | ( | ) |
Assuming that each tally in this list has the same dimension, returns the dimension of tally 0, or 0 if this list is empty.
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.
void standardDeviation | ( | double [] | v | ) |
For each tally in this list, computes the standard deviation, and stores it into v
.
This is equivalent to calling #variance(double[]) and performing a square root on every element of the filled array.
v | the array to be filled with standard deviations. |
NullPointerException | if v is null . |
IllegalArgumentException | if v.length does not correspond to size() . |
void variance | ( | double [] | v | ) |
For each tally in this list, computes the sample variance and stores it into v
.
If, for some tally i
, there are not enough observations for estimating the variance, Double.NaN
is stored at index i
of the array v
.
v | the array to be filled with sample variances. |
NullPointerException | if v is null . |
IllegalArgumentException | if v.length does not correspond to umontreal.ssj.stat.list.ListOfStatProbes.size. |