yat
0.20.3pre
|
Chi squared test. More...
#include <yat/statistics/Chi2.h>
Public Member Functions | |
unsigned int | dof (void) const |
const utility::Matrix & | expected (void) const |
double | p_value (void) const |
double | p_value (size_t N) const |
double | operator() (void) |
double | operator() (const utility::MatrixBase &data) |
Chi squared test.
unsigned int theplu::yat::statistics::Chi2::dof | ( | void | ) | const |
const utility::Matrix& theplu::yat::statistics::Chi2::expected | ( | void | ) | const |
The expected value in element ij is calculated as sum of values in row i times sum of values in column j divided by total sum of values.
double theplu::yat::statistics::Chi2::operator() | ( | void | ) |
double theplu::yat::statistics::Chi2::operator() | ( | const utility::MatrixBase & | data | ) |
Sum is calculated as
where is X is data and E is matrix with expected values (see expected(void));
double theplu::yat::statistics::Chi2::p_value | ( | void | ) | const |
double theplu::yat::statistics::Chi2::p_value | ( | size_t | N | ) | const |
Randomise the data such that row sums and column sums are conserved and calculate chi-squared. Return fraction of time the randomised chi-squared is greater (or equal) than the chi-squared calculated on original data.
N | number of randomisations |
Complexity: N x M, where M is total number of samples