# Changeset 447 for trunk/lib/statistics/Fisher.h

Ignore:
Timestamp:
Dec 15, 2005, 7:51:18 PM (16 years ago)
Message:

added copy constructor for KernelView? and added construction of KernelView? in test

File:
1 edited

### Legend:

Unmodified
 r295 namespace statistics { /// /// Class for Fisher's exact test. /// @brief Fisher's exact test. /// Fisher's Exact test is a procedure that you can use for data /// in a two by two contingency table: \f[ \begin{tabular}{|c|c|} /// 10 a Chi-square test is reasonable to use. /// /// @note The statistica assumes that each column and row sum, /// respectively, are fixed. Just because you have a 2x2 table, this /// assumtion does not necessarily match you experimental upset. See /// e.g. Barnard's test for alternative. /// class Fisher : public Score /// /// Cutoff sets the limit whether a value should go into the left /// or the right column. @see score /// /// @return reference to cutoff for column /// inline double& cutoff_column(void) { return cutoff_column_; } /// /// Cutoff sets the limit whether a value should go into the left /// or the right row. @see score /// /// @return reference to cutoff for row /// inline double& cutoff_row(void) { return cutoff_row_; } /// /// Calculates the expected values under the null hypothesis. /// a' = (a+c)(a+b)/(a+b+c+d) /// void expected(u_int& a, u_int& b, u_unt& c, u_int& d); /// /// minimum_size is the threshold for when the p-value calculation /// is performed using a Chi2 approximation. /// /// @return reference to minimum_size /// inline u_int& minimum_size(void){ return minimum_size_; } /// /// If absolute, the p-value is the two-sided p-value. If all /// elements in table is at least minimum_size, a Chi2 /// approximation is used. /// /// @return p-value /// double p_value() const; /// double p_value() const; /// /// calculated as \f$\sum w_i \f$, so when each weight is /// unitary the same table is created as in the unweighted version /// /// @return odds ratio /// /// @note /// double score(const gslapi::vector& x, const gslapi::vector& y, private: double oddsratio(const double a, const double b, const double c, const double d) const; double p_value_approximative(void) const; double p_value_exact(void) const; std::vector train_set_; gslapi::vector weight_; u_int a_; u_int b_; u_int c_; u_int d_; double oddsratio(const double a, const double b, const double c, const double d) const; double a_; double b_; double c_; double d_; double cutoff_column_; double cutoff_row_; double minimum_size_; };