File: negativebinomial.yo

package info (click to toggle)
c%2B%2B-annotations 10.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 10,536 kB
  • ctags: 3,247
  • sloc: cpp: 19,157; makefile: 1,521; ansic: 165; sh: 128; perl: 90
file content (42 lines) | stat: -rw-r--r-- 1,597 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
The ti(negative_binomial_distribution<IntType = int>) probability distribution
describes the number of successes in a sequence of Bernoulli trials before a
specified number of failures occurs. For example, if one throws a die
repeatedly until the third time 1 appears, then the probability distribution
of the number of other faces that have appeared is a negative binomial
distribution.

It has two parameters: (tt(IntType)) k (> 0), being the number of failures
until the experiment is stopped and (tt(double)) p the probability of success
in each individual experiment.

Defined types:
        verb(
    typedef IntType result_type;

    struct param_type
    {
        explicit param_type(IntType k = IntType(1), double p = 0.5);

        IntType k() const;
        double p() const;
    };
            )

Constructors and members:
    itemization(
    itt(negative_binomial_distribution<>(IntType k = IntType(1),
                                                            double p = 0.5))
       constructs a negative_binomial distribution with specified tt(k) and
        tt(p) parameters;
    itt(negative_binomial_distribution<>(param_type const &param))
       constructs a negative_binomial distribution according to the values
        stored in the tt(param) struct.
    itt(IntType k() const)nl()
        returns the distribution's tt(k) parameter;
    itt(double p() const)nl()
        returns the distribution's tt(p) parameter;
    itt(result_type min() const)nl()
        returns 0;
    itt(result_type max() const)nl()
        returns the maximum value of tt(result_type);
    )