|
SSJ V. labo. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectumontreal.iro.lecuyer.stat.matrix.MatrixOfStatProbes<E>
umontreal.iro.lecuyer.stat.matrix.MatrixOfFunctionOfMultipleMeansTallies<E>
public class MatrixOfFunctionOfMultipleMeansTallies<E extends FunctionOfMultipleMeansTally>
Represents a matrix of statistical collectors
for functions of multiple means.
Each element of such a matrix is an instance of
FunctionOfMultipleMeansTally
,
and observations can be added with
the add
method.
This class defines a factory method to construct a matrix of tallies
computing the same function and sharing the same dimension.
Constructor Summary | |
---|---|
MatrixOfFunctionOfMultipleMeansTallies(int numRows,
int numColumns)
Constructs a new unnamed matrix of function of multiple means tallies with numRows rows, and numColumns columns, and filled with null references. |
|
MatrixOfFunctionOfMultipleMeansTallies(String name,
int numRows,
int numColumns)
Constructs a new empty matrix of function of multiple means tallies with name name, numRows rows, and numColumns columns, and filled with null references. |
Method Summary | |
---|---|
void |
add(double[][][] x)
For each function of multiple means tally with row index r and column index c, adds the vector of observations x[r][c] if collecting is turned ON. |
void |
add(DoubleMatrix3D x)
Equivalent to add (x.toArray()),
without copying the elements of x
into a temporary 3D array. |
void |
addSameDimension(DoubleMatrix2D... x)
For each element (r, c) of this matrix of tallies, adds the vector of observations x[0].get (r, c), ..., x[d-1].get (r, c). |
boolean |
areAllNumberObsEqual()
Tests that every tally in this matrix contains the same number of observations. |
void |
average(DoubleMatrix2D m)
Computes the average for each function of multiple means tally in the matrix. |
MatrixOfFunctionOfMultipleMeansTallies<E> |
clone()
Clones this object. |
static MatrixOfFunctionOfMultipleMeansTallies<FunctionOfMultipleMeansTally> |
create(MultivariateFunction func,
int d,
int numRows,
int numColumns)
This factory method constructs and returns a matrix of function of multiple means tallies with numRows rows, numColumns columns, and filled with instances of FunctionOfMultipleMeansTally . |
int |
getDimension()
Assuming that each tally in this matrix has the same dimension, returns the dimension of tally (0, 0), or 0 if the matrix has no row or column. |
int |
numberObs()
Assuming that each tally in this matrix contains the same number of observations, returns the number of observations in tally (0, 0), or 0 if the matrix has no row or column. |
void |
standardDeviation(DoubleMatrix2D m)
For each tally in the matrix, computes the standard deviation, and stores it into the matrix m. |
void |
variance(DoubleMatrix2D m)
For each tally in the matrix, computes the sample variance, and stores it into the given matrix. |
Methods inherited from class umontreal.iro.lecuyer.stat.matrix.MatrixOfStatProbes |
---|
addMatrixOfObservationListener, clearMatrixOfObservationListeners, columnReport, columns, get, getName, init, isBroadcasting, isCollecting, iterator, notifyListeners, removeMatrixOfObservationListener, rowReport, rows, set, setBroadcasting, setCollecting, setColumns, setName, setRows, sum, viewColumn, viewRow |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MatrixOfFunctionOfMultipleMeansTallies(int numRows, int numColumns)
numRows
- the number of rows in the matrix.numColumns
- the number of columns in the matrix.
NegativeArraySizeException
- if
numRows or numColumns are negative.public MatrixOfFunctionOfMultipleMeansTallies(String name, int numRows, int numColumns)
name
- the global name of the matrix.numRows
- the number of rows in the matrix.numColumns
- the number of columns in the matrix.
NegativeArraySizeException
- if
numRows or numColumns are negative.Method Detail |
---|
public static MatrixOfFunctionOfMultipleMeansTallies<FunctionOfMultipleMeansTally> create(MultivariateFunction func, int d, int numRows, int numColumns)
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.numRows
- the number of rows in the matrix.numColumns
- the number of columns in the matrix.
public void add(double[][][] x)
x
- the vectors of observations to be added.
IllegalArgumentException
- if the dimensions
of x, x[r], or x[r][c] are incorrect.public void add(DoubleMatrix3D x)
add
(x.toArray()),
without copying the elements of x
into a temporary 3D array.
Each slice of the 3D matrix x corresponds to
a row of the matrix of probes.
Each row of the 3D matrix corresponds to a column of
the matrix of probes.
Each column of the 3D matrix corresponds to a component
of a vector of observations added to a function of multiple means tally.
This can be used only when all the function of multiple means tallies
in the array share the same dimension.
x
- the matrix of observations.
IllegalArgumentException
- if the dimensions
of the matrix are incorrect.public void addSameDimension(DoubleMatrix2D... x)
add
, and calls the latter method with this array.
For example, let mt be a matrix of tallies with dimensions r×c
whose l = rc elements correspond to ratios.
If a program can generate two matrices
num and den of dimensions r×c
representing observations for the numerator and
denominator of the ratios, respectively, the
observations can be added using
mt.add (num, den) instead of creating
an intermediate 3D array of observations.
x
- the array of matrices of observations.
IllegalArgumentException
- if the length of
x does not correspond to the dimension of
the tally, or the dimensions of the matrices
x[j] are not equal for all j=0,...,d-1.public int getDimension()
public int numberObs()
public boolean areAllNumberObsEqual()
public void average(DoubleMatrix2D m)
average
in class MatrixOfStatProbes<E extends FunctionOfMultipleMeansTally>
m
- the matrix to be filled with averages.public void variance(DoubleMatrix2D m)
m
- the matrix to be filled with sample variances.
NullPointerException
- if m is null.
IllegalArgumentException
- if m.rows()
does not correspond to rows
, or
m.columns() does not correspond to columns
.public void standardDeviation(DoubleMatrix2D m)
variance
and
performing a square root on every element
of the filled matrix.
m
- the matrix to be filled with standard deviations.
NullPointerException
- if m is null.
IllegalArgumentException
- if m.rows()
does not correspond to rows
, or
m.columns() does not correspond to columns
.public MatrixOfFunctionOfMultipleMeansTallies<E> clone()
clone
in class MatrixOfStatProbes<E extends FunctionOfMultipleMeansTally>
|
SSJ V. labo. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |