|
Boost Users : |
Subject: [Boost-users] [math/distributions] calculating p-value?
From: Christian Meesters (meesters_at_[hidden])
Date: 2010-04-09 06:21:17
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
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net