SHORE API
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
binomial.hpp
Go to the documentation of this file.
1 
2 /*
3  * Copyright 2008,2009,2010,2011,2012 Stephan Ossowski, Korbinian Schneeberger,
4  * Felix Ott, Joerg Hagmann, Alf Scotland, Sebastian Bender
5  *
6  * This file is part of SHORE.
7  *
8  * SHORE is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * SHORE is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with SHORE. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
25 
26 #ifndef SHORE_STATISTICS_BINOMIAL_HPP__
27 #define SHORE_STATISTICS_BINOMIAL_HPP__
28 
29 #include <cstddef>
30 
31 namespace shore {
32 
34 class binomial
35 {
36  private:
37 
38  size_t m_n;
39  double m_p;
40 
41  public:
42 
44  binomial(const size_t n,const double p);
45 
47  double pdf(const size_t k) const;
48 
50  double cdf(const size_t k) const;
51 
53  double cdf_P(const size_t k) const;
54 
56  double cdf_Q(const size_t k) const;
57 
61  double test_alt_less(const size_t k) const;
62 
66  double test_alt_greater(const size_t k) const;
67 
71  double test_alt_twosided(const size_t k) const;
72 };
73 
74 } // namespace
75 
76 #endif // SHORE_STATISTICS_BINOMIAL_HPP__
77