
9 Apr
2010
9 Apr
'10
10:21 a.m.
Hi, Having a test which values are chi^2-distributed, I tried to calculate a p-value and utterly failed. My code, so far: #include <boost/math/distributions/chi_squared.hpp> using boost::math::chi_squared; <snip> chi_squared dist(N - 1); p = cdf(complement(dist, (std::fabs(beta)))) ; Here, N is the sample size and beta my beta-estimate. Reading Numerical Recipies my approach might be a bit naive, yet is there any short hand using boost? (Or am I making a stupid mistake here? Which?) TIA Christian