Ignore:
Timestamp:
Feb 25, 2008, 9:23:47 PM (14 years ago)
Author:
Peter
Message:

fixes #292

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/statistics/utility.cc

    r1025 r1145  
    2727#include "utility.h"
    2828
     29#include <gsl/gsl_cdf.h>
    2930#include <gsl/gsl_randist.h>
    3031#include <gsl/gsl_statistics_double.h>
     32
     33#include <cassert>
    3134
    3235namespace theplu {
     
    4144    return p;
    4245  }
     46
     47
     48  double pearson_p_value(double r, u_int n)
     49  {
     50    assert(n>=2);
     51    if (n<2)
     52      return std::numeric_limits<double>::quiet_NaN();
     53    return gsl_cdf_tdist_Q(r*sqrt((n-2)/(1-r*r)), n-2);
     54  }
     55
    4356
    4457  double kurtosis(const utility::VectorBase& v)
Note: See TracChangeset for help on using the changeset viewer.