Changeset 1553 for trunk/yat/statistics
- Timestamp:
- Oct 7, 2008, 6:06:50 PM (14 years ago)
- Location:
- trunk/yat/statistics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/statistics/utility.cc
r1487 r1553 47 47 if (n<=2) 48 48 return std::numeric_limits<double>::quiet_NaN(); 49 if (r>=1.0) 50 return 0.0; 51 if (r<=-1.0) 52 return 1.0; 49 53 return gsl_cdf_tdist_Q(r*sqrt((n-2)/(1-r*r)), n-2); 50 54 } -
trunk/yat/statistics/utility.h
r1500 r1553 100 100 101 101 \return Probability that correlation is larger than \a r by 102 chance when having \a n samples. 102 chance when having \a n samples. For \a r larger or equal to 1.0, 103 0.0 is returned. For \a r smaller or equal to -1.0, 1.0 is 104 returned. 103 105 */ 104 106 double pearson_p_value(double r, unsigned int n);
Note: See TracChangeset
for help on using the changeset viewer.