summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2018-04-24 19:41:55 -0600
committerGitHub <noreply@github.com>2018-04-24 19:41:55 -0600
commitd7d5cb3feccc1fc6cf57159e8b9fe0a733968706 (patch)
treeac79b10323eb870c4436811a80b8d10eed3635b2
parenta04676a2d1048dc1cc62255547f63c7a17000d02 (diff)
parent4373b35379fa11e84a044e5f8bec71ed3e4d50a5 (diff)
downloadnumpy-d7d5cb3feccc1fc6cf57159e8b9fe0a733968706.tar.gz
Merge pull request #10883 from hameerabbasi/nb-doc-fix
DOC: Fix negative binomial documentation.
-rw-r--r--numpy/random/mtrand/mtrand.pyx18
1 files changed, 8 insertions, 10 deletions
diff --git a/numpy/random/mtrand/mtrand.pyx b/numpy/random/mtrand/mtrand.pyx
index 4dabaa093..8ef153c15 100644
--- a/numpy/random/mtrand/mtrand.pyx
+++ b/numpy/random/mtrand/mtrand.pyx
@@ -3817,7 +3817,7 @@ cdef class RandomState:
Draw samples from a negative binomial distribution.
Samples are drawn from a negative binomial distribution with specified
- parameters, `n` trials and `p` probability of success where `n` is an
+ parameters, `n` successes and `p` probability of success where `n` is an
integer > 0 and `p` is in the interval [0, 1].
Parameters
@@ -3837,21 +3837,19 @@ cdef class RandomState:
-------
out : ndarray or scalar
Drawn samples from the parameterized negative binomial distribution,
- where each sample is equal to N, the number of trials it took to
- achieve n - 1 successes, N - (n - 1) failures, and a success on the,
- (N + n)th trial.
+ where each sample is equal to N, the number of failures that
+ occurred before a total of n successes was reached.
Notes
-----
The probability density for the negative binomial distribution is
- .. math:: P(N;n,p) = \\binom{N+n-1}{n-1}p^{n}(1-p)^{N},
+ .. math:: P(N;n,p) = \\binom{N+n-1}{N}p^{n}(1-p)^{N},
- where :math:`n-1` is the number of successes, :math:`p` is the
- probability of success, and :math:`N+n-1` is the number of trials.
- The negative binomial distribution gives the probability of n-1
- successes and N failures in N+n-1 trials, and success on the (N+n)th
- trial.
+ where :math:`n` is the number of successes, :math:`p` is the
+ probability of success, and :math:`N+n` is the number of trials.
+ The negative binomial distribution gives the probability of N
+ failures given n successes, with a success on the last trial.
If one throws a die repeatedly until the third time a "1" appears,
then the probability distribution of the number of non-"1"s that