MTK++ Latest version: 0.2.0

Public Member Functions | Protected Attributes
MTKpp::pca Class Reference

Principal Component Analysis. More...

#include <mtkpp/src/Statistics/pca.h>

Inheritance diagram for MTKpp::pca:
Inheritance graph
[legend]
Collaboration diagram for MTKpp::pca:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 pca ()
 pca Constructor
 pca (table< double > *X, sheet *output)
 pca Constructor
int run (int nKeep)
 pca Destructor
double meanColumn (Eigen::Matrix< double, Dynamic, Dynamic > &m, const int &i)
 BaseStats Destructor.
double meanColumn (ublas::matrix< double > &m, const int &i)
 BaseStats Destructor.
double meanRow (Eigen::Matrix< double, Dynamic, Dynamic > &m, const int &i)
 Get sample mean of row.
double meanRow (ublas::matrix< double > &m, const int &i)
 Get sample mean of row.
double sumColumn (Eigen::Matrix< double, Dynamic, Dynamic > &m, const int &i)
 Get sum of column.
double sumColumn (ublas::matrix< double > &m, const int &i)
 Get sum of column.
double sumRow (Eigen::Matrix< double, Dynamic, Dynamic > &m, const int &i)
 Get sum of row.
double sumRow (ublas::matrix< double > &m, const int &i)
 Get sum of row.
double maxColumn (Eigen::Matrix< double, Dynamic, Dynamic > &m, const int &i)
 Get max value of column.
double maxColumn (Eigen::Matrix< double, Dynamic, Dynamic > &m, const int &i, int &r)
 Get max value of column.
double maxColumn (ublas::matrix< double > &m, const int &i)
 Get max value of column.
double maxColumn (ublas::matrix< double > &m, const int &i, int &r)
 Get max value of column.
double maxRow (Eigen::Matrix< double, Dynamic, Dynamic > &m, const int &i)
 Get max value of row.
double maxRow (ublas::matrix< double > &m, const int &i)
 Get max value of row.
double minColumn (Eigen::Matrix< double, Dynamic, Dynamic > &m, const int &i)
 Get min value of column.
double minColumn (Eigen::Matrix< double, Dynamic, Dynamic > &m, const int &i, int &r)
 Get min value of column.
double minColumn (ublas::matrix< double > &m, const int &i)
 Get min value of column.
double minColumn (ublas::matrix< double > &m, const int &i, int &r)
 Get min value of column.
double minRow (Eigen::Matrix< double, Dynamic, Dynamic > &m, const int &i)
 Get min value of row.
double minRow (ublas::matrix< double > &m, const int &i)
 Get min value of row.
int getColumnCenters (Eigen::Matrix< double, Dynamic, Dynamic > &mat, Eigen::Matrix< double, Dynamic, Dynamic > &mat_centers)
 Get Mean values for each column in the matrix.
int getColumnCenters (ublas::matrix< double > &mat, ublas::matrix< double > &mat_centers)
 Get Mean values for each column in the matrix.
void centerColumns (Eigen::Matrix< double, Dynamic, Dynamic > &m1, Eigen::Matrix< double, Dynamic, Dynamic > &m2)
 Center matrix by column.
void centerColumns (ublas::matrix< double > &m1, ublas::matrix< double > &m2)
 Center matrix by column.
void centerRows (Eigen::Matrix< double, Dynamic, Dynamic > &m1, Eigen::Matrix< double, Dynamic, Dynamic > &m2)
 Center matrix by row.
void centerRows (ublas::matrix< double > &m1, ublas::matrix< double > &m2)
 Center matrix by row.
void zScoreColumns (Eigen::Matrix< double, Dynamic, Dynamic > &m1, Eigen::Matrix< double, Dynamic, Dynamic > &m2)
 Calculate Z-Scores of matrix by column.
void zScoreColumns (ublas::matrix< double > &m1, ublas::matrix< double > &m2)
 Calculate Z-Scores of matrix by column.
void zScoreRows (Eigen::Matrix< double, Dynamic, Dynamic > &m1, Eigen::Matrix< double, Dynamic, Dynamic > &m2)
 Calculate Z-Scores of matrix by row.
void zScoreRows (ublas::matrix< double > &m1, ublas::matrix< double > &m2)
 Calculate Z-Scores of matrix by row.
int autoScale (Eigen::Matrix< double, Dynamic, Dynamic > &old_mat, Eigen::Matrix< double, Dynamic, Dynamic > &new_mat, Eigen::Matrix< double, Dynamic, Dynamic > &centers, Eigen::Matrix< double, Dynamic, Dynamic > &stdDevs)
 Autoscale using previously computed means and standard deviations.
int autoScale (ublas::matrix< double > &old_mat, ublas::matrix< double > &new_mat, ublas::matrix< double > &centers, ublas::matrix< double > &stdDevs)
 Autoscale using previously computed means and standard deviations.
double varianceColumn (Eigen::Matrix< double, Dynamic, Dynamic > &m, const int &i)
 Get variance of column.
double varianceColumn (ublas::matrix< double > &m, const int &i)
 Get variance of column.
double varianceRow (Eigen::Matrix< double, Dynamic, Dynamic > &m, const int &i)
 Get variance of row.
double varianceRow (ublas::matrix< double > &m, const int &i)
 Get variance of row.
int getStdDevColumns (Eigen::Matrix< double, Dynamic, Dynamic > &mat, Eigen::Matrix< double, Dynamic, Dynamic > &stdDev_mat)
 Get standard deviation for each column.
int getStdDevColumns (ublas::matrix< double > &mat, ublas::matrix< double > &stdDev_mat)
 Get standard deviation for each column.
double standardDeviationColumn (Eigen::Matrix< double, Dynamic, Dynamic > &m, const int &i)
 Get standard deviation of column.
double standardDeviationColumn (ublas::matrix< double > &m, const int &i)
 Get standard deviation of column.
double standardDeviationRow (Eigen::Matrix< double, Dynamic, Dynamic > &m, const int &i)
 Get standard deviation of row.
double standardDeviationRow (ublas::matrix< double > &m, const int &i)
 Get standard deviation of row.
double covarianceColumn (Eigen::Matrix< double, Dynamic, Dynamic > &m1, const int &i1, Eigen::Matrix< double, Dynamic, Dynamic > &m2, const int &i2)
 Calculate covariance between two column in different matrices.
double covarianceColumn (Eigen::Matrix< double, Dynamic, Dynamic > &m, const int &i, const int &j)
 Calculate covariance between two columns in the same matrix.
double covarianceColumn (ublas::matrix< double > &m1, const int &i1, ublas::matrix< double > &m2, const int &i2)
 Calculate covariance between two column in different matrices.
double covarianceColumn (ublas::matrix< double > &m, const int &i, const int &j)
 Calculate covariance between two columns in the same matrix.
void covarianceMatrix (Eigen::Matrix< double, Dynamic, Dynamic > &A, Eigen::Matrix< double, Dynamic, Dynamic > &CovMat)
 Calculates the Covariance Matrix (or variance, variance-covariance, dispersion)
void covarianceMatrix (ublas::matrix< double > &A, ublas::matrix< double > &CovMat)
 Calculates the Covariance Matrix (or variance, variance-covariance, dispersion)
void covarianceMatrix (ublas::matrix< double > &A, ublas::matrix< double, ublas::column_major > &CovMat)
double correlationCoefficientColumn (Eigen::Matrix< double, Dynamic, Dynamic > &m1, const int &i1, Eigen::Matrix< double, Dynamic, Dynamic > &m2, const int &i2)
 Calculate correlation coefficient by column.
double correlationCoefficientColumn (ublas::matrix< double > &m1, const int &i1, ublas::matrix< double > &m2, const int &i2)
 Calculate correlation coefficient by column.
double rSquaredColumn (Eigen::Matrix< double, Dynamic, Dynamic > &m1, const int &i1, Eigen::Matrix< double, Dynamic, Dynamic > &m2, const int &i2)
 Calculate R^2 by column.
double rSquaredColumn (ublas::matrix< double > &m1, const int &i1, ublas::matrix< double > &m2, const int &i2)
 Calculate R^2 by column.
double AdjustedRSquaredColumn (Eigen::Matrix< double, Dynamic, Dynamic > &Ys, const int &i1, Eigen::Matrix< double, Dynamic, Dynamic > &Y_Pred, const int &i2, const int &i3)
 Calculate Adjusted R^2 by column.
double AdjustedRSquaredColumn (ublas::matrix< double > &Ys, const int &i1, ublas::matrix< double > &Y_Pred, const int &i2, const int &i3)
 Calculate Adjusted R^2 by column.
double RMSE (Eigen::Matrix< double, Dynamic, Dynamic > &Ys, const int &i, Eigen::Matrix< double, Dynamic, Dynamic > &Y_Pred, const int &j)
 Calculate root mean squared error.
double RMSE (ublas::matrix< double > &Ys, const int &i, ublas::matrix< double > &Y_Pred, const int &j)
 Calculate root mean squared error.
double MSE (Eigen::Matrix< double, Dynamic, Dynamic > &Ys, const int &i, Eigen::Matrix< double, Dynamic, Dynamic > &Y_Pred, const int &j)
 Calculate mean squared error.
double MSE (ublas::matrix< double > &Ys, const int &i, ublas::matrix< double > &Y_Pred, const int &j)
 Calculate mean squared error.
double UnsignedError (Eigen::Matrix< double, Dynamic, Dynamic > &Ys, const int &i, Eigen::Matrix< double, Dynamic, Dynamic > &Y_Pred, const int &j)
 Calculate unsigned/absolute error.
double UnsignedError (ublas::matrix< double > &Ys, const int &i, ublas::matrix< double > &Y_Pred, const int &j)
 Calculate unsigned/absolute error.
double SignedError (Eigen::Matrix< double, Dynamic, Dynamic > &Ys, const int &i, Eigen::Matrix< double, Dynamic, Dynamic > &Y_Pred, const int &j)
 Calculate signed error.
double SignedError (ublas::matrix< double > &Ys, const int &i, ublas::matrix< double > &Y_Pred, const int &j)
 Calculate signed error.
double SumSquaredDeviationsColumn (Eigen::Matrix< double, Dynamic, Dynamic > &Ys, const int &i)
 Calculates the Sum of squared deviations.
double SumSquaredDeviationsColumn (ublas::matrix< double > &Ys, const int &i)
 Calculates the Sum of squared deviations.
double SumSquaredRegressionColumn (Eigen::Matrix< double, Dynamic, Dynamic > &Ys, Eigen::Matrix< double, Dynamic, Dynamic > &Y_Pred)
 Calculates the Sum of squared due to regression.
double SumSquaredRegressionColumn (ublas::matrix< double > &Ys, ublas::matrix< double > &Y_Pred)
 Calculates the Sum of squared due to regression.
double SumSquaredResidualErrorsColumn (Eigen::Matrix< double, Dynamic, Dynamic > &Ys, Eigen::Matrix< double, Dynamic, Dynamic > &Y_Pred, Eigen::Matrix< double, Dynamic, Dynamic > &Residuals)
 Calculates the Sum of squared residuals (Errors)
double SumSquaredResidualErrorsColumn (Eigen::Matrix< double, Dynamic, Dynamic > &Ys, const int &c, Eigen::Matrix< double, Dynamic, Dynamic > &Y_Pred, const int &d)
 Calculates the Sum of squared residuals (Errors)
double SumSquaredResidualErrorsColumn (ublas::matrix< double > &Ys, ublas::matrix< double > &Y_Pred, ublas::matrix< double > &Residuals)
 Calculates the Sum of squared residuals (Errors)
double SumSquaredResidualErrorsColumn (ublas::matrix< double > &Ys, const int &c, ublas::matrix< double > &Y_Pred, const int &d)
 Calculates the Sum of squared residuals (Errors)

Protected Attributes

table< double > * itsX
 X matrix.
unsigned int nRows
 Number of rows in X.
unsigned int nColumns
 Number of Columns in X.
sheetoutModel
 The sheet where the model is stored.

Detailed Description

Principal Component Analysis.

Author:
Martin Peters
Date:
2006

Constructor & Destructor Documentation

MTKpp::pca::pca ( )

pca Constructor

MTKpp::pca::pca ( table< double > *  X,
sheet output 
)

pca Constructor

Parameters:
XX matrix
outputsheet pointer

References MTKpp::table< T >::getNumColumns(), MTKpp::table< T >::getNumRows(), itsX, nColumns, nRows, outModel, and X.


Member Function Documentation

int MTKpp::pca::run ( int  nKeep)
double MTKpp::BaseStats::meanColumn ( Eigen::Matrix< double, Dynamic, Dynamic > &  m,
const int &  i 
) [inherited]
double MTKpp::BaseStats::meanColumn ( ublas::matrix< double > &  m,
const int &  i 
) [inherited]

BaseStats Destructor.

Get sample mean of column

Parameters:
mMatrix pointer
icolumn index
Returns:
sample average
double MTKpp::BaseStats::meanRow ( Eigen::Matrix< double, Dynamic, Dynamic > &  m,
const int &  i 
) [inherited]

Get sample mean of row.

Parameters:
mMatrix pointer
irow index
Returns:
sample average

Referenced by main(), and MTKpp::BaseStats::varianceRow().

double MTKpp::BaseStats::meanRow ( ublas::matrix< double > &  m,
const int &  i 
) [inherited]

Get sample mean of row.

Parameters:
mMatrix pointer
irow index
Returns:
sample average
double MTKpp::BaseStats::sumColumn ( Eigen::Matrix< double, Dynamic, Dynamic > &  m,
const int &  i 
) [inherited]

Get sum of column.

Parameters:
mMatrix pointer
icolumn index
Returns:
sum of values

Referenced by main().

double MTKpp::BaseStats::sumColumn ( ublas::matrix< double > &  m,
const int &  i 
) [inherited]

Get sum of column.

Parameters:
mMatrix pointer
icolumn index
Returns:
sum of values
double MTKpp::BaseStats::sumRow ( Eigen::Matrix< double, Dynamic, Dynamic > &  m,
const int &  i 
) [inherited]

Get sum of row.

Parameters:
mMatrix pointer
irow index
Returns:
sum of values

Referenced by main().

double MTKpp::BaseStats::sumRow ( ublas::matrix< double > &  m,
const int &  i 
) [inherited]

Get sum of row.

Parameters:
mMatrix pointer
irow index
Returns:
sum of values
double MTKpp::BaseStats::maxColumn ( Eigen::Matrix< double, Dynamic, Dynamic > &  m,
const int &  i 
) [inherited]

Get max value of column.

Parameters:
mMatrix pointer
icolumn index
Returns:
max value

Referenced by main().

double MTKpp::BaseStats::maxColumn ( Eigen::Matrix< double, Dynamic, Dynamic > &  m,
const int &  i,
int &  r 
) [inherited]

Get max value of column.

Parameters:
mMatrix pointer
icolumn index
rrow index [index of max value]
Returns:
max value
double MTKpp::BaseStats::maxColumn ( ublas::matrix< double > &  m,
const int &  i 
) [inherited]

Get max value of column.

Parameters:
mMatrix pointer
icolumn index
Returns:
max value
double MTKpp::BaseStats::maxColumn ( ublas::matrix< double > &  m,
const int &  i,
int &  r 
) [inherited]

Get max value of column.

Parameters:
mMatrix pointer
icolumn index
rrow index [index of max value]
Returns:
max value
double MTKpp::BaseStats::maxRow ( Eigen::Matrix< double, Dynamic, Dynamic > &  m,
const int &  i 
) [inherited]

Get max value of row.

Parameters:
mMatrix pointer
irow index
Returns:
max value

Referenced by main().

double MTKpp::BaseStats::maxRow ( ublas::matrix< double > &  m,
const int &  i 
) [inherited]

Get max value of row.

Parameters:
mMatrix pointer
irow index
Returns:
max value
double MTKpp::BaseStats::minColumn ( Eigen::Matrix< double, Dynamic, Dynamic > &  m,
const int &  i 
) [inherited]

Get min value of column.

Parameters:
mMatrix pointer
icolumn index
Returns:
min value

Referenced by main().

double MTKpp::BaseStats::minColumn ( Eigen::Matrix< double, Dynamic, Dynamic > &  m,
const int &  i,
int &  r 
) [inherited]

Get min value of column.

Parameters:
mMatrix pointer
icolumn index
rrow index [index of min value]
Returns:
min value
double MTKpp::BaseStats::minColumn ( ublas::matrix< double > &  m,
const int &  i 
) [inherited]

Get min value of column.

Parameters:
mMatrix pointer
icolumn index
Returns:
min value
double MTKpp::BaseStats::minColumn ( ublas::matrix< double > &  m,
const int &  i,
int &  r 
) [inherited]

Get min value of column.

Parameters:
mMatrix pointer
icolumn index
rrow index [index of min value]
Returns:
min value
double MTKpp::BaseStats::minRow ( Eigen::Matrix< double, Dynamic, Dynamic > &  m,
const int &  i 
) [inherited]

Get min value of row.

Parameters:
mMatrix pointer
irow index
Returns:
min value

Referenced by main().

double MTKpp::BaseStats::minRow ( ublas::matrix< double > &  m,
const int &  i 
) [inherited]

Get min value of row.

Parameters:
mMatrix pointer
irow index
Returns:
min value
int MTKpp::BaseStats::getColumnCenters ( Eigen::Matrix< double, Dynamic, Dynamic > &  mat,
Eigen::Matrix< double, Dynamic, Dynamic > &  mat_centers 
) [inherited]

Get Mean values for each column in the matrix.

Parameters:
matMatrix pointer
mat_centersMatrix pointer
Returns:
sucess

References MTKpp::BaseStats::meanColumn().

Referenced by main(), and run().

int MTKpp::BaseStats::getColumnCenters ( ublas::matrix< double > &  mat,
ublas::matrix< double > &  mat_centers 
) [inherited]

Get Mean values for each column in the matrix.

Parameters:
matMatrix pointer
mat_centersMatrix pointer
Returns:
sucess

References MTKpp::BaseStats::meanColumn().

void MTKpp::BaseStats::centerColumns ( Eigen::Matrix< double, Dynamic, Dynamic > &  m1,
Eigen::Matrix< double, Dynamic, Dynamic > &  m2 
) [inherited]

Center matrix by column.

Parameters:
m1Matrix pointer
m2Matrix pointer

References MTKpp::BaseStats::meanColumn().

Referenced by main(), run(), and MTKpp::BaseStats::zScoreColumns().

void MTKpp::BaseStats::centerColumns ( ublas::matrix< double > &  m1,
ublas::matrix< double > &  m2 
) [inherited]

Center matrix by column.

Parameters:
m1Matrix pointer
m2Matrix pointer

References MTKpp::BaseStats::meanColumn().

void MTKpp::BaseStats::centerRows ( Eigen::Matrix< double, Dynamic, Dynamic > &  m1,
Eigen::Matrix< double, Dynamic, Dynamic > &  m2 
) [inherited]

Center matrix by row.

Parameters:
m1Matrix pointer
m2Matrix pointer
void MTKpp::BaseStats::centerRows ( ublas::matrix< double > &  m1,
ublas::matrix< double > &  m2 
) [inherited]

Center matrix by row.

Parameters:
m1Matrix pointer
m2Matrix pointer
void MTKpp::BaseStats::zScoreColumns ( Eigen::Matrix< double, Dynamic, Dynamic > &  m1,
Eigen::Matrix< double, Dynamic, Dynamic > &  m2 
) [inherited]

Calculate Z-Scores of matrix by column.

Parameters:
m1Matrix pointer
m2Matrix pointer

References MTKpp::BaseStats::centerColumns(), and MTKpp::BaseStats::standardDeviationColumn().

Referenced by main().

void MTKpp::BaseStats::zScoreColumns ( ublas::matrix< double > &  m1,
ublas::matrix< double > &  m2 
) [inherited]

Calculate Z-Scores of matrix by column.

Parameters:
m1Matrix pointer
m2Matrix pointer

References MTKpp::BaseStats::centerColumns(), and MTKpp::BaseStats::standardDeviationColumn().

void MTKpp::BaseStats::zScoreRows ( Eigen::Matrix< double, Dynamic, Dynamic > &  m1,
Eigen::Matrix< double, Dynamic, Dynamic > &  m2 
) [inherited]

Calculate Z-Scores of matrix by row.

Parameters:
m1Matrix pointer
m2Matrix pointer
void MTKpp::BaseStats::zScoreRows ( ublas::matrix< double > &  m1,
ublas::matrix< double > &  m2 
) [inherited]

Calculate Z-Scores of matrix by row.

Parameters:
m1Matrix pointer
m2Matrix pointer
int MTKpp::BaseStats::autoScale ( Eigen::Matrix< double, Dynamic, Dynamic > &  old_mat,
Eigen::Matrix< double, Dynamic, Dynamic > &  new_mat,
Eigen::Matrix< double, Dynamic, Dynamic > &  centers,
Eigen::Matrix< double, Dynamic, Dynamic > &  stdDevs 
) [inherited]

Autoscale using previously computed means and standard deviations.

Parameters:
old_matmatrix pointer
new_matmatrix pointer
centersmatrix of means
stdDevsmatrix of standard deviations
Returns:
success

Referenced by main().

int MTKpp::BaseStats::autoScale ( ublas::matrix< double > &  old_mat,
ublas::matrix< double > &  new_mat,
ublas::matrix< double > &  centers,
ublas::matrix< double > &  stdDevs 
) [inherited]

Autoscale using previously computed means and standard deviations.

Parameters:
old_matmatrix pointer
new_matmatrix pointer
centersmatrix of means
stdDevsmatrix of standard deviations
Returns:
success
double MTKpp::BaseStats::varianceColumn ( Eigen::Matrix< double, Dynamic, Dynamic > &  m,
const int &  i 
) [inherited]

Get variance of column.

Parameters:
mMatrix pointer
icolumn index
Returns:
variance

References MTKpp::BaseStats::meanColumn().

Referenced by MTKpp::BaseStats::getStdDevColumns(), main(), and MTKpp::BaseStats::standardDeviationColumn().

double MTKpp::BaseStats::varianceColumn ( ublas::matrix< double > &  m,
const int &  i 
) [inherited]

Get variance of column.

Parameters:
mMatrix pointer
icolumn index
Returns:
variance

References MTKpp::BaseStats::meanColumn().

double MTKpp::BaseStats::varianceRow ( Eigen::Matrix< double, Dynamic, Dynamic > &  m,
const int &  i 
) [inherited]

Get variance of row.

Parameters:
mMatrix pointer
irow index
Returns:
variance

References MTKpp::BaseStats::meanRow().

Referenced by main(), and MTKpp::BaseStats::standardDeviationRow().

double MTKpp::BaseStats::varianceRow ( ublas::matrix< double > &  m,
const int &  i 
) [inherited]

Get variance of row.

Parameters:
mMatrix pointer
irow index
Returns:
variance

References MTKpp::BaseStats::meanRow().

int MTKpp::BaseStats::getStdDevColumns ( Eigen::Matrix< double, Dynamic, Dynamic > &  mat,
Eigen::Matrix< double, Dynamic, Dynamic > &  stdDev_mat 
) [inherited]

Get standard deviation for each column.

Parameters:
matmatrix pointer
stdDev_matmatrix of standard deviations
Returns:
success

References MTKpp::BaseStats::varianceColumn().

Referenced by main().

int MTKpp::BaseStats::getStdDevColumns ( ublas::matrix< double > &  mat,
ublas::matrix< double > &  stdDev_mat 
) [inherited]

Get standard deviation for each column.

Parameters:
matmatrix pointer
stdDev_matmatrix of standard deviations
Returns:
success

References MTKpp::BaseStats::varianceColumn().

double MTKpp::BaseStats::standardDeviationColumn ( Eigen::Matrix< double, Dynamic, Dynamic > &  m,
const int &  i 
) [inherited]

Get standard deviation of column.

Parameters:
mMatrix pointer
icolumn index
Returns:
standard deviation

References MTKpp::BaseStats::varianceColumn().

Referenced by main(), and MTKpp::BaseStats::zScoreColumns().

double MTKpp::BaseStats::standardDeviationColumn ( ublas::matrix< double > &  m,
const int &  i 
) [inherited]

Get standard deviation of column.

Parameters:
mMatrix pointer
icolumn index
Returns:
standard deviation

References MTKpp::BaseStats::varianceColumn().

double MTKpp::BaseStats::standardDeviationRow ( Eigen::Matrix< double, Dynamic, Dynamic > &  m,
const int &  i 
) [inherited]

Get standard deviation of row.

Parameters:
mMatrix pointer
irow index
Returns:
standard deviation

References MTKpp::BaseStats::varianceRow().

Referenced by main().

double MTKpp::BaseStats::standardDeviationRow ( ublas::matrix< double > &  m,
const int &  i 
) [inherited]

Get standard deviation of row.

Parameters:
mMatrix pointer
irow index
Returns:
standard deviation

References MTKpp::BaseStats::varianceRow().

double MTKpp::BaseStats::covarianceColumn ( Eigen::Matrix< double, Dynamic, Dynamic > &  m1,
const int &  i1,
Eigen::Matrix< double, Dynamic, Dynamic > &  m2,
const int &  i2 
) [inherited]

Calculate covariance between two column in different matrices.

Parameters:
m1Matrix pointer
i1column index
m2Matrix pointer
i2column index
Returns:
covariance

References MTKpp::BaseStats::meanColumn().

double MTKpp::BaseStats::covarianceColumn ( Eigen::Matrix< double, Dynamic, Dynamic > &  m,
const int &  i,
const int &  j 
) [inherited]

Calculate covariance between two columns in the same matrix.

Parameters:
mMatrix pointer
icolumn index
jcolumn index
Returns:
covariance

References MTKpp::BaseStats::meanColumn().

double MTKpp::BaseStats::covarianceColumn ( ublas::matrix< double > &  m1,
const int &  i1,
ublas::matrix< double > &  m2,
const int &  i2 
) [inherited]

Calculate covariance between two column in different matrices.

Parameters:
m1Matrix pointer
i1column index
m2Matrix pointer
i2column index
Returns:
covariance

References MTKpp::BaseStats::meanColumn().

double MTKpp::BaseStats::covarianceColumn ( ublas::matrix< double > &  m,
const int &  i,
const int &  j 
) [inherited]

Calculate covariance between two columns in the same matrix.

Parameters:
mMatrix pointer
icolumn index
jcolumn index
Returns:
covariance

References MTKpp::BaseStats::meanColumn().

void MTKpp::BaseStats::covarianceMatrix ( Eigen::Matrix< double, Dynamic, Dynamic > &  A,
Eigen::Matrix< double, Dynamic, Dynamic > &  CovMat 
) [inherited]

Calculates the Covariance Matrix (or variance, variance-covariance, dispersion)

The covariance matrix is the matrix of sample variances [i][i] and covariances [i][j] of p variables.

Parameters:
AMatrix object
CovMatcovariance matrix

References MTKpp::BaseStats::meanColumn().

Referenced by main(), and run().

void MTKpp::BaseStats::covarianceMatrix ( ublas::matrix< double > &  A,
ublas::matrix< double > &  CovMat 
) [inherited]

Calculates the Covariance Matrix (or variance, variance-covariance, dispersion)

The covariance matrix is the matrix of sample variances [i][i] and covariances [i][j] of p variables.

Parameters:
AMatrix object
CovMatcovariance matrix

References MTKpp::BaseStats::meanColumn().

void MTKpp::BaseStats::covarianceMatrix ( ublas::matrix< double > &  A,
ublas::matrix< double, ublas::column_major > &  CovMat 
) [inherited]
double MTKpp::BaseStats::correlationCoefficientColumn ( Eigen::Matrix< double, Dynamic, Dynamic > &  m1,
const int &  i1,
Eigen::Matrix< double, Dynamic, Dynamic > &  m2,
const int &  i2 
) [inherited]

Calculate correlation coefficient by column.

Parameters:
m1Matrix object
i1column index
m2Matrix object
i2column index
Returns:
correlation coefficient

References MTKpp::BaseStats::meanColumn(), and MTKpp::BaseStats::SumSquaredDeviationsColumn().

Referenced by main(), and MTKpp::BaseStats::rSquaredColumn().

double MTKpp::BaseStats::correlationCoefficientColumn ( ublas::matrix< double > &  m1,
const int &  i1,
ublas::matrix< double > &  m2,
const int &  i2 
) [inherited]

Calculate correlation coefficient by column.

Parameters:
m1Matrix object
i1column index
m2Matrix object
i2column index
Returns:
correlation coefficient

References MTKpp::BaseStats::meanColumn(), and MTKpp::BaseStats::SumSquaredDeviationsColumn().

double MTKpp::BaseStats::rSquaredColumn ( Eigen::Matrix< double, Dynamic, Dynamic > &  m1,
const int &  i1,
Eigen::Matrix< double, Dynamic, Dynamic > &  m2,
const int &  i2 
) [inherited]

Calculate R^2 by column.

Parameters:
m1Matrix object
i1column index
m2Matrix object
i2column index
Returns:
R-Squared

References MTKpp::BaseStats::correlationCoefficientColumn().

Referenced by main().

double MTKpp::BaseStats::rSquaredColumn ( ublas::matrix< double > &  m1,
const int &  i1,
ublas::matrix< double > &  m2,
const int &  i2 
) [inherited]

Calculate R^2 by column.

Parameters:
m1Matrix object
i1column index
m2Matrix object
i2column index
Returns:
R-Squared

References MTKpp::BaseStats::correlationCoefficientColumn().

double MTKpp::BaseStats::AdjustedRSquaredColumn ( Eigen::Matrix< double, Dynamic, Dynamic > &  Ys,
const int &  i1,
Eigen::Matrix< double, Dynamic, Dynamic > &  Y_Pred,
const int &  i2,
const int &  i3 
) [inherited]

Calculate Adjusted R^2 by column.

Parameters:
YsMatrix object
i1column index
Y_PredMatrix object
i2column index
i3column index
Returns:
Adjusted R-Squared

References MTKpp::BaseStats::SumSquaredDeviationsColumn(), and MTKpp::BaseStats::SumSquaredResidualErrorsColumn().

Referenced by main().

double MTKpp::BaseStats::AdjustedRSquaredColumn ( ublas::matrix< double > &  Ys,
const int &  i1,
ublas::matrix< double > &  Y_Pred,
const int &  i2,
const int &  i3 
) [inherited]

Calculate Adjusted R^2 by column.

Parameters:
YsMatrix object
i1column index
Y_PredMatrix object
i2column index
i3column index
Returns:
Adjusted R-Squared

References MTKpp::BaseStats::SumSquaredDeviationsColumn(), and MTKpp::BaseStats::SumSquaredResidualErrorsColumn().

double MTKpp::BaseStats::RMSE ( Eigen::Matrix< double, Dynamic, Dynamic > &  Ys,
const int &  i,
Eigen::Matrix< double, Dynamic, Dynamic > &  Y_Pred,
const int &  j 
) [inherited]

Calculate root mean squared error.

Parameters:
YsMatrix object
icolumn index
Y_PredMatrix object
jcolumn index
Returns:
rmse

Referenced by main(), and MTKpp::BaseStats::RMSE().

double MTKpp::BaseStats::RMSE ( ublas::matrix< double > &  Ys,
const int &  i,
ublas::matrix< double > &  Y_Pred,
const int &  j 
) [inherited]

Calculate root mean squared error.

Parameters:
YsMatrix object
icolumn index
Y_PredMatrix object
jcolumn index
Returns:
rmse

References MTKpp::BaseStats::RMSE().

double MTKpp::BaseStats::MSE ( Eigen::Matrix< double, Dynamic, Dynamic > &  Ys,
const int &  i,
Eigen::Matrix< double, Dynamic, Dynamic > &  Y_Pred,
const int &  j 
) [inherited]

Calculate mean squared error.

Parameters:
YsMatrix object
icolumn index
Y_PredMatrix object
jcolumn index
Returns:
mse

Referenced by main(), and MTKpp::BaseStats::MSE().

double MTKpp::BaseStats::MSE ( ublas::matrix< double > &  Ys,
const int &  i,
ublas::matrix< double > &  Y_Pred,
const int &  j 
) [inherited]

Calculate mean squared error.

Parameters:
YsMatrix object
icolumn index
Y_PredMatrix object
jcolumn index
Returns:
mse

References MTKpp::BaseStats::MSE().

double MTKpp::BaseStats::UnsignedError ( Eigen::Matrix< double, Dynamic, Dynamic > &  Ys,
const int &  i,
Eigen::Matrix< double, Dynamic, Dynamic > &  Y_Pred,
const int &  j 
) [inherited]

Calculate unsigned/absolute error.

Parameters:
YsMatrix object
icolumn index
Y_PredMatrix object
jcolumn index
Returns:
unsigned error

Referenced by main().

double MTKpp::BaseStats::UnsignedError ( ublas::matrix< double > &  Ys,
const int &  i,
ublas::matrix< double > &  Y_Pred,
const int &  j 
) [inherited]

Calculate unsigned/absolute error.

Parameters:
YsMatrix object
icolumn index
Y_PredMatrix object
jcolumn index
Returns:
unsigned error
double MTKpp::BaseStats::SignedError ( Eigen::Matrix< double, Dynamic, Dynamic > &  Ys,
const int &  i,
Eigen::Matrix< double, Dynamic, Dynamic > &  Y_Pred,
const int &  j 
) [inherited]

Calculate signed error.

Parameters:
YsMatrix object
icolumn index
Y_PredMatrix object
jcolumn index
Returns:
signed error

Referenced by main().

double MTKpp::BaseStats::SignedError ( ublas::matrix< double > &  Ys,
const int &  i,
ublas::matrix< double > &  Y_Pred,
const int &  j 
) [inherited]

Calculate signed error.

Parameters:
YsMatrix object
icolumn index
Y_PredMatrix object
jcolumn index
Returns:
signed error
double MTKpp::BaseStats::SumSquaredDeviationsColumn ( Eigen::Matrix< double, Dynamic, Dynamic > &  Ys,
const int &  i 
) [inherited]

Calculates the Sum of squared deviations.

total sum of squared deviations in Y from its mean (SST) -- \ SST = / (y[i] - y_mean)^2 --

Parameters:
YsMatrix object
icolumn index
Returns:
Sum Squared Deviation

References MTKpp::BaseStats::meanColumn().

Referenced by MTKpp::BaseStats::AdjustedRSquaredColumn(), MTKpp::BaseStats::correlationCoefficientColumn(), MTKpp::ols::LeastSquaresRegressionLine(), and main().

double MTKpp::BaseStats::SumSquaredDeviationsColumn ( ublas::matrix< double > &  Ys,
const int &  i 
) [inherited]

Calculates the Sum of squared deviations.

total sum of squared deviations in Y from its mean (SST) -- \ SST = / (y[i] - y_mean)^2 --

Parameters:
YsMatrix object
icolumn index
Returns:
Sum Squared Deviation

References MTKpp::BaseStats::meanColumn().

double MTKpp::BaseStats::SumSquaredRegressionColumn ( Eigen::Matrix< double, Dynamic, Dynamic > &  Ys,
Eigen::Matrix< double, Dynamic, Dynamic > &  Y_Pred 
) [inherited]

Calculates the Sum of squared due to regression.

total sum of squares due to regression (SSR)

__ SSR = \ (y_pred[i] - y_obs_mean)^2 /__

Parameters:
YsMatrix object
Y_PredMatrix object
Returns:
Sum Squared Deviation

References MTKpp::BaseStats::meanColumn().

Referenced by main().

double MTKpp::BaseStats::SumSquaredRegressionColumn ( ublas::matrix< double > &  Ys,
ublas::matrix< double > &  Y_Pred 
) [inherited]

Calculates the Sum of squared due to regression.

total sum of squares due to regression (SSR)

__ SSR = \ (y_pred[i] - y_obs_mean)^2 /__

Parameters:
YsMatrix object
Y_PredMatrix object
Returns:
Sum Squared Deviation

References MTKpp::BaseStats::meanColumn().

double MTKpp::BaseStats::SumSquaredResidualErrorsColumn ( Eigen::Matrix< double, Dynamic, Dynamic > &  Ys,
Eigen::Matrix< double, Dynamic, Dynamic > &  Y_Pred,
Eigen::Matrix< double, Dynamic, Dynamic > &  Residuals 
) [inherited]

Calculates the Sum of squared residuals (Errors)

residuals --> e[i] = y_obs[i] - y_pred[i] sum of squared residuals (SSE) -- \ SSE = / e[i]^2 --

Parameters:
Ys
Y_Pred
Residuals

Referenced by MTKpp::BaseStats::AdjustedRSquaredColumn(), and main().

double MTKpp::BaseStats::SumSquaredResidualErrorsColumn ( Eigen::Matrix< double, Dynamic, Dynamic > &  Ys,
const int &  c,
Eigen::Matrix< double, Dynamic, Dynamic > &  Y_Pred,
const int &  d 
) [inherited]

Calculates the Sum of squared residuals (Errors)

residuals --> e[i] = y_obs[i] - y_pred[i] sum of squared residuals (SSE) -- \ SSE = / e[i]^2 --

Parameters:
YsOrginial Y matrix
ccolumn in Ys
Y_PredPredicted Y matrix
dcolumn in Y_Pred
double MTKpp::BaseStats::SumSquaredResidualErrorsColumn ( ublas::matrix< double > &  Ys,
ublas::matrix< double > &  Y_Pred,
ublas::matrix< double > &  Residuals 
) [inherited]

Calculates the Sum of squared residuals (Errors)

residuals --> e[i] = y_obs[i] - y_pred[i] sum of squared residuals (SSE) -- \ SSE = / e[i]^2 --

Parameters:
Ys
Y_Pred
Residuals
double MTKpp::BaseStats::SumSquaredResidualErrorsColumn ( ublas::matrix< double > &  Ys,
const int &  c,
ublas::matrix< double > &  Y_Pred,
const int &  d 
) [inherited]

Calculates the Sum of squared residuals (Errors)

residuals --> e[i] = y_obs[i] - y_pred[i] sum of squared residuals (SSE) -- \ SSE = / e[i]^2 --

Parameters:
YsOrginial Y matrix
ccolumn in Ys
Y_PredPredicted Y matrix
dcolumn in Y_Pred

Member Data Documentation

table<double>* MTKpp::pca::itsX [protected]

X matrix.

              X[N][R]
         +-                    -+
         | X11 X12  .   .   X1R |
         | X21 X22  .   .   X2R |
         |  .   .   .   .    .  |
         |  .   .   .   .    .  |
         | XN1  .   .   .   XNR |
         +-                    -+

Referenced by pca(), and run().

unsigned int MTKpp::pca::nRows [protected]

Number of rows in X.

Referenced by pca(), and run().

unsigned int MTKpp::pca::nColumns [protected]

Number of Columns in X.

Referenced by pca(), and run().

The sheet where the model is stored.

Referenced by pca(), and run().


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

Generated on Fri Dec 23 2011 09:28:58 for MTK++ by Doxygen 1.7.5.1