Changeset 1553
 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((n2)/(1r*r)), n2); 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.