#include <BinomialInterval.h>
Public Types | |
enum | tail_type { equal_tailed, lower_tailed, upper_tailed } |
Public Member Functions | |
double | alpha () const |
virtual void | calculate (const double successes, const double trials)=0 |
bool | contains (double rho) |
double | coverage_prob (const double rho, const int trials) |
void | dump (const int trials_min, const int trials_max) |
void | init (const double alpha, const tail_type t=equal_tailed) |
double | length () const |
double | lower () const |
virtual const char * | name () const =0 |
virtual bool | neyman (const int ntot, const int nrho, double *rho, double *x_l, double *x_r) |
void | scan_ntot (const double rho, const int ntot_min, const int ntot_max, double *ntot, double *prob) |
void | scan_rho (const int ntot, const int nrho, double *rho, double *prob) |
double | upper () const |
Protected Member Functions | |
void | set (double l, double u) |
Protected Attributes | |
double | alpha_ |
double | alpha_min_ |
double | kappa2_ |
double | kappa_ |
double | lower_ |
tail_type | type_ |
double | upper_ |
Definition at line 18 of file BinomialInterval.h.
Definition at line 27 of file BinomialInterval.h.
{ equal_tailed, lower_tailed, upper_tailed };
double BinomialInterval::alpha | ( | void | ) | const [inline] |
Definition at line 77 of file BinomialInterval.h.
References alpha_.
Referenced by ClassImp().
{ return alpha_; }
virtual void BinomialInterval::calculate | ( | const double | successes, |
const double | trials | ||
) | [pure virtual] |
Implemented in BinomialNoncentralInterval< Sorter >, ClopperPearsonBinomialInterval, BinomialNoncentralInterval< SterneSorter >, and BinomialNoncentralInterval< FeldmanCousinsSorter >.
Referenced by coverage_prob(), and dump().
bool BinomialInterval::contains | ( | double | rho | ) |
Definition at line 22 of file BinomialInterval.cc.
References lower_, lower_tailed, type_, upper_, and upper_tailed.
Referenced by coverage_prob().
double BinomialInterval::coverage_prob | ( | const double | rho, |
const int | trials | ||
) |
Definition at line 31 of file BinomialInterval.cc.
References calculate(), contains(), and X.
Referenced by scan_ntot(), and scan_rho().
void BinomialInterval::dump | ( | const int | trials_min, |
const int | trials_max | ||
) |
Definition at line 60 of file BinomialInterval.cc.
References calculate(), lower_, n, name(), upper_, and X.
{ const std::string fn = std::string("table.") + name() + std::string(".txt"); FILE* fdump = fopen(fn.c_str(), "wt"); for (int n = trials_min; n <= trials_max; ++n) { for (int X = 0; X <= n; X++) { calculate(X, n); fprintf(fdump, "%i %i %f %f\n", X, n, lower_, upper_); } fprintf(fdump, "\n"); } fclose(fdump); }
void BinomialInterval::init | ( | const double | alpha, |
const tail_type | t = equal_tailed |
||
) |
double BinomialInterval::length | ( | ) | const [inline] |
double BinomialInterval::lower | ( | ) | const [inline] |
virtual const char* BinomialInterval::name | ( | ) | const [pure virtual] |
Implemented in ClopperPearsonBinomialInterval, FeldmanCousinsBinomialInterval, and SterneBinomialInterval.
Referenced by dump().
virtual bool BinomialInterval::neyman | ( | const int | ntot, |
const int | nrho, | ||
double * | rho, | ||
double * | x_l, | ||
double * | x_r | ||
) | [inline, virtual] |
Reimplemented in BinomialNoncentralInterval< Sorter >, BinomialNoncentralInterval< SterneSorter >, and BinomialNoncentralInterval< FeldmanCousinsSorter >.
Definition at line 69 of file BinomialInterval.h.
{ return false; }
void BinomialInterval::scan_ntot | ( | const double | rho, |
const int | ntot_min, | ||
const int | ntot_max, | ||
double * | ntot, | ||
double * | prob | ||
) |
Definition at line 51 of file BinomialInterval.cc.
References coverage_prob(), i, and nt.
void BinomialInterval::scan_rho | ( | const int | ntot, |
const int | nrho, | ||
double * | rho, | ||
double * | prob | ||
) |
Definition at line 44 of file BinomialInterval.cc.
References coverage_prob(), and i.
void BinomialInterval::set | ( | double | l, |
double | u | ||
) | [inline, protected] |
Definition at line 92 of file BinomialInterval.h.
References prof2calltree::l, lower_, and upper_.
double BinomialInterval::upper | ( | ) | const [inline] |
double BinomialInterval::alpha_ [protected] |
Definition at line 83 of file BinomialInterval.h.
Referenced by alpha(), and ClassImp().
double BinomialInterval::alpha_min_ [protected] |
Definition at line 85 of file BinomialInterval.h.
Referenced by ClopperPearsonBinomialInterval::calculate(), and ClassImp().
double BinomialInterval::kappa2_ [protected] |
Definition at line 87 of file BinomialInterval.h.
Referenced by ClassImp().
double BinomialInterval::kappa_ [protected] |
Definition at line 86 of file BinomialInterval.h.
Referenced by ClassImp().
double BinomialInterval::lower_ [protected] |
Definition at line 89 of file BinomialInterval.h.
Referenced by ClopperPearsonBinomialInterval::calculate(), contains(), dump(), length(), lower(), and set().
tail_type BinomialInterval::type_ [protected] |
Definition at line 84 of file BinomialInterval.h.
Referenced by ClassImp(), and contains().
double BinomialInterval::upper_ [protected] |
Definition at line 90 of file BinomialInterval.h.
Referenced by ClopperPearsonBinomialInterval::calculate(), contains(), dump(), length(), set(), and upper().