CDMatrixStat |
The CDMatrixStat class provides functions calculating statistics for the matrix and some statistical tests.
Constructors/Destructor |
CDMatrixStat (void)Default constructor. Creates an uninitialized matrix.
CDMatrixStat
(int rows, int cols,
double *storage = 0)If storage is zero, create a dynamically sized double precision matrix with the number of rows and cols specified. If storage is not zero, use the memory it points to.
CDMatrixStat (const CDMatrixStat &mat)
Creates a matrix with the same properties and values as another matrix.
Argument Description rows,cols number of rows and columns in matrix storage pointer to previously allocated memory mat reference to another matrix ~CDMatrixStat (void)
Destructor.
Methods |
Matrix Statistics |
double Mean()CDMatrixStat::MeanColReturn the mean value of the elements.
void MeanCol(CDVectorStat& vMean)Calculate the mean value of the elements in each column.
Argument Description vMean reference to vector holding the mean values
double Std()CDMatrixStat::StdColReturn the standard deviation of the elements.
void StdCol(CDVectorStat& vStd)CDMatrixStat::SumCalculate the standard deviation of the elements in each column.
Argument Description vStd reference to vector holding the standard deviations
double Sum()CDMatrixStat::SumColReturn the sum of the elements.
void SumCol(CDVectorStat& vSum)CDMatrixStat::VarCalculate the sum of the elements in each column.
Argument Description vSum reference to vector holding the sums
double Var()CDMatrixStat::VarColReturn the variance of the elements.
void VarCol(CDVectorStat& vVar)Calculate the variance of the elements in each column.
Argument Description vVar reference to vector holding the variance
Statistical Tests |
void OneWayANOVA(double& dZ, int& nDFModel, int& nDFError)CDMatrixStat:: TTestPerform a one way analysis of variance, where each column in the matrix corresponds to a set of observations, which are assumed to be Gaussian distributed, i.e.
Hypothesis: mean1 = mean2 = mean3 = ...
Reject region: dz > F(nDFModel, nDFError )_{1-alpha}
Argument Description dZ test statistics nDFModel degrees of freedom for the model nDFError degrees of freedom for the error
void TTest(const int iCol1,const int iCol2, double& dZ, int& nDF)Perform a t-test on the observations corresponding to columns iCol1 and iCol2, which are assumed to be Gaussian distributed observation, i.e.
Hypothesis: mean1 = mean2
Reject region: dZ < t(nDF)_alpha v dZ > t(nDF)_{1-alpha}
Note, that the variance estimate used in the t-test is created by a pulled variance based on all the columns in the matrix.
Argument Description iCol1, iCol2 index to columns, which corresponds to the two set of observations dZ test statistics nDF degrees of freedom
Miscellaneous |
void ToString(CString& strOut)This function returns a string representing the vector.
Argument Description strOut reference to the string
Overloaded Operators |
CDMatrixStat::operator=
CDMatrixStat& operator= (double value)
Assigns value to all elements of this matrix.CDMatrixStat& operator= (const CDMatrixStat& vec)
Copies the values of another matrix to the corresponding elements of this matrix.
Argument Description value value to be assigned to this matrix's elements vec reference to matrix with values to be copied
Copyright, 1999
Section for Image Analysis
Department of Mathematical
Modelling
Technical University of
Denmark
DK-2800 Lyngby
Authors: Rune Fisker
Last updated: 03-05-1999