MTK++ Latest version: 0.2.0
Principal Component Analysis. More...
#include <mtkpp/src/Statistics/pca.h>
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 > ¢ers, 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 > ¢ers, 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. | |
sheet * | outModel |
The sheet where the model is stored. |
Principal Component Analysis.
MTKpp::pca::pca | ( | ) |
pca Constructor
pca Constructor
X | X matrix |
output | sheet pointer |
References MTKpp::table< T >::getNumColumns(), MTKpp::table< T >::getNumRows(), itsX, nColumns, nRows, outModel, and X.
int MTKpp::pca::run | ( | int | nKeep | ) |
pca Destructor
Run PCA
nKeep | Number of components to keep |
References MTKpp::sheet::addTable(), MTKpp::BaseStats::centerColumns(), MTKpp::BaseStats::covarianceMatrix(), MTKpp::eigenValueSort(), MTKpp::errorLogger, MTKpp::BaseStats::getColumnCenters(), MTKpp::table< T >::getColumnLabel(), MTKpp::table< T >::getMatrix(), MTKpp::table< T >::getRowLabel(), MTKpp::INFO, itsX, MTKpp::MTK_ERROR, nColumns, nRows, outModel, MTKpp::table< T >::setColumnLabel(), MTKpp::table< T >::setName(), MTKpp::table< T >::setRowLabel(), MTKpp::table< T >::setSizes(), MTKpp::errorHandler::throwError(), and X.
Referenced by main().
double MTKpp::BaseStats::meanColumn | ( | Eigen::Matrix< double, Dynamic, Dynamic > & | m, |
const int & | i | ||
) | [inherited] |
BaseStats Destructor.
Get sample mean of column
m | Matrix pointer |
i | column index |
Referenced by MTKpp::BaseStats::centerColumns(), MTKpp::BaseStats::correlationCoefficientColumn(), MTKpp::BaseStats::covarianceColumn(), MTKpp::BaseStats::covarianceMatrix(), MTKpp::BaseStats::getColumnCenters(), MTKpp::ols::LeastSquaresRegressionLine(), main(), MTKpp::BaseStats::SumSquaredDeviationsColumn(), MTKpp::BaseStats::SumSquaredRegressionColumn(), and MTKpp::BaseStats::varianceColumn().
double MTKpp::BaseStats::meanColumn | ( | ublas::matrix< double > & | m, |
const int & | i | ||
) | [inherited] |
BaseStats Destructor.
Get sample mean of column
m | Matrix pointer |
i | column index |
double MTKpp::BaseStats::meanRow | ( | Eigen::Matrix< double, Dynamic, Dynamic > & | m, |
const int & | i | ||
) | [inherited] |
Get sample mean of row.
m | Matrix pointer |
i | row index |
Referenced by main(), and MTKpp::BaseStats::varianceRow().
double MTKpp::BaseStats::meanRow | ( | ublas::matrix< double > & | m, |
const int & | i | ||
) | [inherited] |
Get sample mean of row.
m | Matrix pointer |
i | row index |
double MTKpp::BaseStats::sumColumn | ( | Eigen::Matrix< double, Dynamic, Dynamic > & | m, |
const int & | i | ||
) | [inherited] |
Get sum of column.
m | Matrix pointer |
i | column index |
Referenced by main().
double MTKpp::BaseStats::sumColumn | ( | ublas::matrix< double > & | m, |
const int & | i | ||
) | [inherited] |
Get sum of column.
m | Matrix pointer |
i | column index |
double MTKpp::BaseStats::sumRow | ( | Eigen::Matrix< double, Dynamic, Dynamic > & | m, |
const int & | i | ||
) | [inherited] |
double MTKpp::BaseStats::sumRow | ( | ublas::matrix< double > & | m, |
const int & | i | ||
) | [inherited] |
Get sum of row.
m | Matrix pointer |
i | row index |
double MTKpp::BaseStats::maxColumn | ( | Eigen::Matrix< double, Dynamic, Dynamic > & | m, |
const int & | i | ||
) | [inherited] |
Get max value of column.
m | Matrix pointer |
i | column index |
Referenced by main().
double MTKpp::BaseStats::maxColumn | ( | Eigen::Matrix< double, Dynamic, Dynamic > & | m, |
const int & | i, | ||
int & | r | ||
) | [inherited] |
Get max value of column.
m | Matrix pointer |
i | column index |
r | row index [index of max value] |
double MTKpp::BaseStats::maxColumn | ( | ublas::matrix< double > & | m, |
const int & | i | ||
) | [inherited] |
Get max value of column.
m | Matrix pointer |
i | column index |
double MTKpp::BaseStats::maxColumn | ( | ublas::matrix< double > & | m, |
const int & | i, | ||
int & | r | ||
) | [inherited] |
Get max value of column.
m | Matrix pointer |
i | column index |
r | row index [index of max value] |
double MTKpp::BaseStats::maxRow | ( | Eigen::Matrix< double, Dynamic, Dynamic > & | m, |
const int & | i | ||
) | [inherited] |
Get max value of row.
m | Matrix pointer |
i | row index |
Referenced by main().
double MTKpp::BaseStats::maxRow | ( | ublas::matrix< double > & | m, |
const int & | i | ||
) | [inherited] |
Get max value of row.
m | Matrix pointer |
i | row index |
double MTKpp::BaseStats::minColumn | ( | Eigen::Matrix< double, Dynamic, Dynamic > & | m, |
const int & | i | ||
) | [inherited] |
Get min value of column.
m | Matrix pointer |
i | column index |
Referenced by main().
double MTKpp::BaseStats::minColumn | ( | Eigen::Matrix< double, Dynamic, Dynamic > & | m, |
const int & | i, | ||
int & | r | ||
) | [inherited] |
Get min value of column.
m | Matrix pointer |
i | column index |
r | row index [index of min value] |
double MTKpp::BaseStats::minColumn | ( | ublas::matrix< double > & | m, |
const int & | i | ||
) | [inherited] |
Get min value of column.
m | Matrix pointer |
i | column index |
double MTKpp::BaseStats::minColumn | ( | ublas::matrix< double > & | m, |
const int & | i, | ||
int & | r | ||
) | [inherited] |
Get min value of column.
m | Matrix pointer |
i | column index |
r | row index [index of min value] |
double MTKpp::BaseStats::minRow | ( | Eigen::Matrix< double, Dynamic, Dynamic > & | m, |
const int & | i | ||
) | [inherited] |
Get min value of row.
m | Matrix pointer |
i | row index |
Referenced by main().
double MTKpp::BaseStats::minRow | ( | ublas::matrix< double > & | m, |
const int & | i | ||
) | [inherited] |
Get min value of row.
m | Matrix pointer |
i | row index |
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.
mat | Matrix pointer |
mat_centers | Matrix pointer |
References MTKpp::BaseStats::meanColumn().
int MTKpp::BaseStats::getColumnCenters | ( | ublas::matrix< double > & | mat, |
ublas::matrix< double > & | mat_centers | ||
) | [inherited] |
Get Mean values for each column in the matrix.
mat | Matrix pointer |
mat_centers | Matrix pointer |
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.
m1 | Matrix pointer |
m2 | Matrix 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.
m1 | Matrix pointer |
m2 | Matrix 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.
m1 | Matrix pointer |
m2 | Matrix pointer |
void MTKpp::BaseStats::centerRows | ( | ublas::matrix< double > & | m1, |
ublas::matrix< double > & | m2 | ||
) | [inherited] |
Center matrix by row.
m1 | Matrix pointer |
m2 | Matrix 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.
m1 | Matrix pointer |
m2 | Matrix 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.
m1 | Matrix pointer |
m2 | Matrix 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.
m1 | Matrix pointer |
m2 | Matrix pointer |
void MTKpp::BaseStats::zScoreRows | ( | ublas::matrix< double > & | m1, |
ublas::matrix< double > & | m2 | ||
) | [inherited] |
Calculate Z-Scores of matrix by row.
m1 | Matrix pointer |
m2 | Matrix 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.
old_mat | matrix pointer |
new_mat | matrix pointer |
centers | matrix of means |
stdDevs | matrix of standard deviations |
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.
old_mat | matrix pointer |
new_mat | matrix pointer |
centers | matrix of means |
stdDevs | matrix of standard deviations |
double MTKpp::BaseStats::varianceColumn | ( | Eigen::Matrix< double, Dynamic, Dynamic > & | m, |
const int & | i | ||
) | [inherited] |
Get variance of column.
m | Matrix pointer |
i | column index |
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.
m | Matrix pointer |
i | column index |
References MTKpp::BaseStats::meanColumn().
double MTKpp::BaseStats::varianceRow | ( | Eigen::Matrix< double, Dynamic, Dynamic > & | m, |
const int & | i | ||
) | [inherited] |
Get variance of row.
m | Matrix pointer |
i | row index |
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.
m | Matrix pointer |
i | row index |
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.
mat | matrix pointer |
stdDev_mat | matrix of standard deviations |
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.
mat | matrix pointer |
stdDev_mat | matrix of standard deviations |
References MTKpp::BaseStats::varianceColumn().
double MTKpp::BaseStats::standardDeviationColumn | ( | Eigen::Matrix< double, Dynamic, Dynamic > & | m, |
const int & | i | ||
) | [inherited] |
Get standard deviation of column.
m | Matrix pointer |
i | column index |
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.
m | Matrix pointer |
i | column index |
References MTKpp::BaseStats::varianceColumn().
double MTKpp::BaseStats::standardDeviationRow | ( | Eigen::Matrix< double, Dynamic, Dynamic > & | m, |
const int & | i | ||
) | [inherited] |
Get standard deviation of row.
m | Matrix pointer |
i | row index |
References MTKpp::BaseStats::varianceRow().
Referenced by main().
double MTKpp::BaseStats::standardDeviationRow | ( | ublas::matrix< double > & | m, |
const int & | i | ||
) | [inherited] |
Get standard deviation of row.
m | Matrix pointer |
i | row index |
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.
m1 | Matrix pointer |
i1 | column index |
m2 | Matrix pointer |
i2 | column index |
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.
m | Matrix pointer |
i | column index |
j | column index |
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.
m1 | Matrix pointer |
i1 | column index |
m2 | Matrix pointer |
i2 | column index |
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.
m | Matrix pointer |
i | column index |
j | column index |
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.
A | Matrix object |
CovMat | covariance matrix |
References MTKpp::BaseStats::meanColumn().
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.
A | Matrix object |
CovMat | covariance matrix |
References MTKpp::BaseStats::meanColumn().
void MTKpp::BaseStats::covarianceMatrix | ( | ublas::matrix< double > & | A, |
ublas::matrix< double, ublas::column_major > & | CovMat | ||
) | [inherited] |
References MTKpp::BaseStats::meanColumn().
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.
m1 | Matrix object |
i1 | column index |
m2 | Matrix object |
i2 | column index |
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.
m1 | Matrix object |
i1 | column index |
m2 | Matrix object |
i2 | column index |
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.
m1 | Matrix object |
i1 | column index |
m2 | Matrix object |
i2 | column index |
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.
m1 | Matrix object |
i1 | column index |
m2 | Matrix object |
i2 | column index |
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.
Ys | Matrix object |
i1 | column index |
Y_Pred | Matrix object |
i2 | column index |
i3 | column index |
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.
Ys | Matrix object |
i1 | column index |
Y_Pred | Matrix object |
i2 | column index |
i3 | column index |
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.
Ys | Matrix object |
i | column index |
Y_Pred | Matrix object |
j | column index |
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.
Ys | Matrix object |
i | column index |
Y_Pred | Matrix object |
j | column index |
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.
Ys | Matrix object |
i | column index |
Y_Pred | Matrix object |
j | column index |
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.
Ys | Matrix object |
i | column index |
Y_Pred | Matrix object |
j | column index |
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.
Ys | Matrix object |
i | column index |
Y_Pred | Matrix object |
j | column index |
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.
Ys | Matrix object |
i | column index |
Y_Pred | Matrix object |
j | column index |
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.
Ys | Matrix object |
i | column index |
Y_Pred | Matrix object |
j | column index |
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.
Ys | Matrix object |
i | column index |
Y_Pred | Matrix object |
j | column index |
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 --
Ys | Matrix object |
i | column index |
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 --
Ys | Matrix object |
i | column index |
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 /__
Ys | Matrix object |
Y_Pred | Matrix object |
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 /__
Ys | Matrix object |
Y_Pred | Matrix object |
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 --
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 --
Ys | Orginial Y matrix |
c | column in Ys |
Y_Pred | Predicted Y matrix |
d | column 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 --
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 --
Ys | Orginial Y matrix |
c | column in Ys |
Y_Pred | Predicted Y matrix |
d | column in Y_Pred |
table<double>* MTKpp::pca::itsX [protected] |
unsigned int MTKpp::pca::nRows [protected] |
unsigned int MTKpp::pca::nColumns [protected] |
sheet* MTKpp::pca::outModel [protected] |
Generated on Fri Dec 23 2011 09:28:58 for MTK++ by Doxygen 1.7.5.1