SpatiumLib
|
Functions | |
double | mean (const std::vector< double > &values) |
Compute mean value. More... | |
double | variance (const std::vector< double > &values, bool sample=false) |
Compute the variance. More... | |
double | stdDev (const std::vector< double > &values, bool sample=false) |
Compute the standard deviation. More... | |
double | covariance (const std::vector< double > &values1, const std::vector< double > &values2, bool sample=false) |
Compute the covariance. More... | |
Matrix | covariance (const Matrix &values) |
Compute the covariance matrix. More... | |
int | eigenvalues2 (const Matrix &matrix, double &eigenval1, double &eigenval2) |
Compute eigenvalues for 2-by-2 matrix. More... | |
bool | eigenvector2 (const Matrix &matrix, double eigenval, std::vector< double > &eigenvec) |
Compute the eigenvector of a 2-by-2 matrix for a given eigenvalue. More... | |
|
inline |
Compute the covariance.
[in] | values1 | Values vector 1 |
[in] | values2 | Values vector 2 |
[in] | sample | Sample covariance if true, population if false (default) |
|
inline |
Compute eigenvalues for 2-by-2 matrix.
[in] | matrix | 2-by-2 matrix |
[out] | eigenval1 | Eigenvalue 1 |
[out] | eigenval2 | Eigenvalue 2 |
|
inline |
Compute the eigenvector of a 2-by-2 matrix for a given eigenvalue.
Beware. There are two solution vectors pointing in opposite direction. Either is correct. Also the length of the vector may vary. You should normalize the result vector.
[in] | matrix | 2-by-2 matrix |
[in] | eigenval | Eigenvalue |
[out] | eigenvec | Eigenvector |
|
inline |
Compute mean value.
[in] | values | Values vector |
|
inline |
Compute the standard deviation.
[in] | values | Values vector |
[in] | sample | Sample standard deviation if true, population if false (default) |
|
inline |
Compute the variance.
[in] | values | Values vector |
[in] | sample | Sample variance if true, population if false (default) |