Changeset 3005
 Timestamp:
 Mar 24, 2013, 9:39:45 AM (9 years ago)
 Location:
 trunk
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

trunk/NEWS
r3004 r3005 5 5 version 0.11 (released NOT YET) 6 6  Fisher::one_sided_p(void) is now deprecated (ticket #689) 7  PearsonCorrelation::one_sided_p(void) is now deprecated (ticket #689) 7 8 8 9 A complete list of closed tickets can be found here [[br]] 
trunk/yat/statistics/PearsonCorrelation.cc
r2919 r3005 29 29 namespace theplu { 30 30 namespace yat { 31 namespace statistics { 31 namespace statistics { 32 32 33 PearsonCorrelation::PearsonCorrelation(void) 33 PearsonCorrelation::PearsonCorrelation(void) 34 34 { 35 35 } … … 53 53 54 54 55 double PearsonCorrelation::p_ value_one_sided() const55 double PearsonCorrelation::p_right(void) const 56 56 { 57 return pearson_p_value(ap_.correlation(), 58 static_cast<unsigned int>(ap_.n())); 57 return pearson_p_value(ap_.correlation(), 58 static_cast<unsigned int>(ap_.n())); 59 } 60 61 62 double PearsonCorrelation::p_left(void) const 63 { 64 return pearson_p_value(ap_.correlation(), 65 static_cast<unsigned int>(ap_.n())); 66 } 67 68 69 double PearsonCorrelation::p_value_one_sided(void) const 70 { 71 return p_right(); 72 } 73 74 75 double PearsonCorrelation::p_value(void) const 76 { 77 double r = ap_.correlation(); 78 if (r>0) 79 return 2*p_right(); 80 return 2*p_left(); 59 81 } 60 82 
trunk/yat/statistics/PearsonCorrelation.h
r2119 r3005 1 1 #ifndef _theplu_yat_statistics_pearson_correlation_ 2 #define _theplu_yat_statistics_pearson_correlation_ 2 #define _theplu_yat_statistics_pearson_correlation_ 3 3 4 4 // $Id$ … … 28 28 #include "AveragerPairWeighted.h" 29 29 30 #include "yat/utility/deprecate.h" 31 30 32 namespace theplu { 31 33 namespace yat { … … 34 36 /// 35 37 /// @brief Class for calculating Pearson correlation. 36 /// 38 /// 37 39 class PearsonCorrelation 38 40 { … … 42 44 /// 43 45 PearsonCorrelation(void); 44 46 45 47 /// 46 48 /// @brief The destructor. 47 49 /// 48 50 virtual ~PearsonCorrelation(void); 49 50 51 51 52 /** 52 53 Adding a data value to PearsonCorrelation. … … 62 63 */ 63 64 double score(void) const; 64 65 66 /** 67 \deprecated Provided for backward compatibility with the 0.10 68 API. Use p_right(void). 69 */ 70 double p_value_one_sided(void) const YAT_DEPRECATE; 71 72 /** 73 Similar to p_right, but returns probability to get observed 74 correlation or less. 75 76 \since New in yat 0.11 77 */ 78 double p_left(void) const; 79 65 80 /** 66 81 The pvalue is the probability of getting a correlation as 67 82 large (or larger) as the observed value by random chance, when the true 68 correlation is zero (and the data is Gaussian). 69 83 correlation is zero (and the data is Gaussian). 84 70 85 Pvalue is calculated using function pearson_p_value(double, 71 86 unsigned int) where degrees of freedom is calculated using n(void) in … … 74 89 @return onesided pvalue 75 90 76 \ relates PearsonCorrelation91 \since New in yat 0.11 77 92 */ 78 double p_value_one_sided() const; 79 93 double p_right(void) const; 94 95 /** 96 Claculates the probability to get correlation greater than r 97 or less than r. 98 99 \return twosided pvalue 100 101 \since New in yat 0.11 102 */ 103 double p_value(void) const; 104 80 105 private: 81 106 AveragerPairWeighted ap_; 82 83 107 }; 84 108 85 109 }}} // of namespace statistics, yat, and theplu 86 87 110 #endif
Note: See TracChangeset
for help on using the changeset viewer.