#include <BinomialNoncentralInterval.h>
Public Member Functions | |
void | calculate (const double X, const double n) |
bool | find_rho_set (const double rho, const int ntot, int &x_l, int &x_r) const |
bool | neyman (const int ntot, const int nrho, double *rho, double *x_l, double *x_r) |
Private Attributes | |
Sorter | sorter_ |
Definition at line 31 of file BinomialNoncentralInterval.h.
void BinomialNoncentralInterval< Sorter >::calculate | ( | const double | X, |
const double | n | ||
) | [inline, virtual] |
Implements BinomialInterval.
Definition at line 80 of file BinomialNoncentralInterval.h.
{ rho = (rho_min + rho_max)/2; find_rho_set(rho, int(n), x_l, x_r); if (x_r < X) rho_min = rho; else rho_max = rho; } lower_ = rho; // Binary search for the largest rho whose acceptance set has left // endpoint X; this is the upper endpoint of the rho interval. rho_min = 0; rho_max = 1; while (std::fabs(rho_max - rho_min) > tol) { rho = (rho_min + rho_max)/2; find_rho_set(rho, int(n), x_l, x_r); if (x_l > X) rho_max = rho; else rho_min = rho; } upper_ = rho; } private:
bool BinomialNoncentralInterval< Sorter >::find_rho_set | ( | const double | rho, |
const int | ntot, | ||
int & | x_l, | ||
int & | x_r | ||
) | const [inline] |
Definition at line 37 of file BinomialNoncentralInterval.h.
Referenced by BinomialNoncentralInterval< FeldmanCousinsSorter >::calculate(), and BinomialNoncentralInterval< FeldmanCousinsSorter >::neyman().
bool BinomialNoncentralInterval< Sorter >::neyman | ( | const int | ntot, |
const int | nrho, | ||
double * | rho, | ||
double * | x_l, | ||
double * | x_r | ||
) | [inline, virtual] |
Reimplemented from BinomialInterval.
Definition at line 67 of file BinomialNoncentralInterval.h.
Sorter BinomialNoncentralInterval< Sorter >::sorter_ [private] |
Definition at line 115 of file BinomialNoncentralInterval.h.