SSJ  3.3.1
Stochastic Simulation in Java
Public Member Functions | Static Public Member Functions | Package Attributes | List of all members
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 ListOfFunctionOfMultipleMeansTallies< E extends FunctionOfMultipleMeansTally >:
[legend]
Collaboration diagram for ListOfFunctionOfMultipleMeansTallies< E extends FunctionOfMultipleMeansTally >:
[legend]

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)
 
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)
 
remove (int index)
 
boolean remove (Object o)
 
boolean removeAll (Collection<?> c)
 
boolean retainAll (Collection<?> c)
 
set (int index, E element)
 
int size ()
 
List< E > subList (int fromIndex, int toIndex)
 
Object [] toArray ()
 

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
umontreal.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)
 

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.

Constructor & Destructor Documentation

◆ ListOfFunctionOfMultipleMeansTallies()

Constructs a new empty list of tallies with name name.

Parameters
namethe name of this list.

Member Function Documentation

◆ add() [1/2]

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

◆ add() [2/2]

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.

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.

◆ addSameDimension() [1/2]

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.

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.

◆ addSameDimension() [2/2]

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.

◆ areAllNumberObsEqual()

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.

Returns
the success indicator of the test.

◆ average()

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.

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

◆ create()

static ListOfFunctionOfMultipleMeansTallies<FunctionOfMultipleMeansTally> create ( MultivariateFunction  func,
int  d,
int  size 
)
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.

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

◆ getDimension()

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.

Returns
the dimension.

◆ numberObs()

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.

Returns
the number of observations.

◆ standardDeviation()

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.

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

◆ variance()

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.

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.

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