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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/statistics/Fisher.h

    r295 r447  
    1111namespace statistics { 
    1212  ///
    13   /// Class for Fisher's exact test.   
     13  /// @brief Fisher's exact test.   
    1414  /// Fisher's Exact test is a procedure that you can use for data
    1515  /// in a two by two contingency table: \f[ \begin{tabular}{|c|c|}
     
    3535  /// 10 a Chi-square test is reasonable to use.
    3636  ///
    37 
     37  /// @note The statistica assumes that each column and row sum,
     38  /// respectively, are fixed. Just because you have a 2x2 table, this
     39  /// assumtion does not necessarily match you experimental upset. See
     40  /// e.g. Barnard's test for alternative.
     41  ///
    3842 
    3943  class Fisher : public Score
     
    5357   
    5458    ///
     59    /// Cutoff sets the limit whether a value should go into the left
     60    /// or the right column. @see score
     61    ///
     62    /// @return reference to cutoff for column
     63    ///
     64    inline double& cutoff_column(void) { return cutoff_column_; }
     65
     66    ///
     67    /// Cutoff sets the limit whether a value should go into the left
     68    /// or the right row. @see score
     69    ///
     70    /// @return reference to cutoff for row
     71    ///
     72    inline double& cutoff_row(void) { return cutoff_row_; }
     73
     74    ///
     75    /// Calculates the expected values under the null hypothesis.
     76    /// a' = (a+c)(a+b)/(a+b+c+d)
     77    ///
     78    void expected(u_int& a, u_int& b, u_unt& c, u_int& d);
     79
     80    ///
     81    /// minimum_size is the threshold for when the p-value calculation
     82    /// is performed using a Chi2 approximation.
     83    ///
     84    /// @return reference to minimum_size
     85    ///
     86    inline u_int& minimum_size(void){ return minimum_size_; } 
     87
     88    ///
     89    /// If absolute, the p-value is the two-sided p-value. If all
     90    /// elements in table is at least minimum_size, a Chi2
     91    /// approximation is used.
     92    ///
    5593    /// @return p-value
    56     ///
    57     double p_value() const;
     94    ///
     95    double p_value() const;
    5896   
    5997    ///
     
    75113    /// calculated as \f$ \sum w_i \f$, so when each weight is
    76114    /// unitary the same table is created as in the unweighted version
     115    ///
    77116    /// @return odds ratio
     117    ///
     118    /// @note
    78119    ///
    79120    double score(const gslapi::vector& x, const gslapi::vector& y, 
     
    93134         
    94135  private:
     136    double oddsratio(const double a, const double b,
     137                     const double c, const double d) const;
     138
     139    double p_value_approximative(void) const;
     140    double p_value_exact(void) const;
     141
    95142    std::vector<size_t> train_set_;
    96143    gslapi::vector weight_;
    97     u_int a_;
    98     u_int b_;
    99     u_int c_;
    100     u_int d_;
    101 
    102     double oddsratio(const double a, const double b,
    103                      const double c, const double d) const;
     144    double a_;
     145    double b_;
     146    double c_;
     147    double d_;
     148    double cutoff_column_;
     149    double cutoff_row_;
     150    double minimum_size_;
    104151
    105152  };
Note: See TracChangeset for help on using the changeset viewer.