SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.stat.list.ListOfFunctionOfMultipleMeansTallies< E extends FunctionOfMultipleMeansTally > Class Template Reference

Represents a list of tally statistical collectors for a vector of functions of multiple means. More...

Inheritance diagram for umontreal.ssj.stat.list.ListOfFunctionOfMultipleMeansTallies< E extends FunctionOfMultipleMeansTally >:
umontreal.ssj.stat.list.ListOfStatProbes< E >

Public Member Functions

 ListOfFunctionOfMultipleMeansTallies ()
 Constructs a new empty list of tallies.
 ListOfFunctionOfMultipleMeansTallies (String name)
 Constructs a new empty list of tallies with name name.
void add (double[][] x)
 For each tally i in this list, adds the vector x[i].
void add (DoubleMatrix2D x)
 Equivalent to add(x.toArray()), without copying the elements of x into a temporary 2D array.
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].
void addSameDimension (DoubleMatrix1D... x)
 Equivalent to #addSameDimension(double[][]) x.toArray(), without copying the elements of x into a temporary 1D array.
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.
boolean areAllNumberObsEqual ()
 Tests that every tally in this list contains the same number of observations.
void average (double[] a)
 Computes the function of averages for each tally in this list.
void variance (double[] v)
 For each tally in this list, computes the sample variance and stores it into v.
void standardDeviation (double[] v)
 For each tally in this list, computes the standard deviation, and stores it into v.
ListOfFunctionOfMultipleMeansTallies< E > clone ()
 Clones this object.
Public Member Functions inherited from umontreal.ssj.stat.list.ListOfStatProbes< E >
 ListOfStatProbes ()
 Constructs an empty list of statistical probes.
String getName ()
 Returns the global name of this list of statistical probes.
void setName (String name)
 Sets the global name of this list to name.
boolean isModifiable ()
 Determines if this list of statistical probes is modifiable, i.e., if probes can be added or removed.
void setUnmodifiable ()
 Forbids any future modification to this list of statistical probes.
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.
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.
boolean isCollecting ()
 Determines if this list of statistical probes is collecting values.
void setCollecting (boolean c)
 Sets the status of the statistical collecting mechanism to c.
boolean isBroadcasting ()
 Determines if this list of statistical probes is broadcasting observations to registered observers.
void setBroadcasting (boolean b)
 Sets the status of the observation broadcasting mechanism to b.
void addArrayOfObservationListener (ArrayOfObservationListener l)
 Adds the observation listener l to the list of observers of this list of statistical probes.
void removeArrayOfObservationListener (ArrayOfObservationListener l)
 Removes the observation listener l from the list of observers of this list of statistical probes.
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.
String report ()
 Formats a report for each probe in the list of statistical probes.
ListOfStatProbes< E > clone ()
 Clones this object.

Static Public Member Functions

static ListOfFunctionOfMultipleMeansTallies< FunctionOfMultipleMeansTallycreate (MultivariateFunction func, int d, int size)
 This factory method constructs and returns a list of tallies with size instances of
.

Detailed Description

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.

Definition at line 42 of file ListOfFunctionOfMultipleMeansTallies.java.

Constructor & Destructor Documentation

◆ ListOfFunctionOfMultipleMeansTallies() [1/2]

Constructs a new empty list of tallies.

Definition at line 48 of file ListOfFunctionOfMultipleMeansTallies.java.

◆ ListOfFunctionOfMultipleMeansTallies() [2/2]

umontreal.ssj.stat.list.ListOfFunctionOfMultipleMeansTallies< E extends FunctionOfMultipleMeansTally >.ListOfFunctionOfMultipleMeansTallies ( String name)

Constructs a new empty list of tallies with name name.

Parameters
namethe name of this list.

Definition at line 57 of file ListOfFunctionOfMultipleMeansTallies.java.

Member Function Documentation

◆ add() [1/2]

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 ith tally of this list.

Parameters
xthe array of vectors of observations being added.
Exceptions
IllegalArgumentExceptionif 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.

Definition at line 93 of file ListOfFunctionOfMultipleMeansTallies.java.

◆ add() [2/2]

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.

Parameters
xthe matrix of observations being added, each row corresponding to a vector added to a tally.
Exceptions
IllegalArgumentExceptionif 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.

Definition at line 117 of file ListOfFunctionOfMultipleMeansTallies.java.

◆ addSameDimension() [1/2]

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.

Parameters
xthe 2D array of observations.
Exceptions
IllegalArgumentExceptionif 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.

Definition at line 146 of file ListOfFunctionOfMultipleMeansTallies.java.

◆ addSameDimension() [2/2]

void umontreal.ssj.stat.list.ListOfFunctionOfMultipleMeansTallies< E extends FunctionOfMultipleMeansTally >.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.

Definition at line 177 of file ListOfFunctionOfMultipleMeansTallies.java.

◆ 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.

Returns
the success indicator of the test.

Definition at line 237 of file ListOfFunctionOfMultipleMeansTallies.java.

◆ average()

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.

Definition at line 253 of file ListOfFunctionOfMultipleMeansTallies.java.

◆ 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.

Definition at line 312 of file ListOfFunctionOfMultipleMeansTallies.java.

◆ create()

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.

Parameters
functhe multivariate function computed by the tallies.
dthe dimension of the tallies.
sizethe size of the list.
Returns
the created list.

Definition at line 72 of file ListOfFunctionOfMultipleMeansTallies.java.

◆ 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.

Returns
the dimension.

Definition at line 209 of file ListOfFunctionOfMultipleMeansTallies.java.

◆ 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.

Returns
the number of observations.

Definition at line 223 of file ListOfFunctionOfMultipleMeansTallies.java.

◆ standardDeviation()

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.

Parameters
vthe array to be filled with standard deviations.
Exceptions
NullPointerExceptionif `v` is `null`.
IllegalArgumentExceptionif `v.length` does not correspond to size().

Definition at line 294 of file ListOfFunctionOfMultipleMeansTallies.java.

◆ variance()

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.

Parameters
vthe array to be filled with sample variances.
Exceptions
NullPointerExceptionif `v` is `null`.
IllegalArgumentExceptionif `v.length` does not correspond to umontreal.ssj.stat.list.ListOfStatProbes.size.

Definition at line 271 of file ListOfFunctionOfMultipleMeansTallies.java.


The documentation for this class was generated from the following file: