After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 703164 - r.?nbinom documentation problem
r.?nbinom documentation problem
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: Analytics
git master
Other Linux
: Normal normal
: ---
Assigned To: Morten Welinder
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2013-06-27 05:01 UTC by Andreas J. Guelzow
Modified: 2013-06-28 04:23 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andreas J. Guelzow 2013-06-27 05:01:50 UTC
The documentation currently says:
---------------------------------------
R.PNBINOM: cumulative distribution function of the negative binomial distribution

Arguments:
x: observation
n: the number of trials
psuc: the probability of success in each trial
lower_tail: if true (the default), the lower tail of the distribution is considered
log_p: if true, log of the probability is used
---------------------------------------

Since the number of trials for the negative binomial distribution is not fixed (in fact the random variable x is the number of trials), n is not correct. In the R documentation we have: 

----------------------------------------------------------
Usage

dnbinom(x, size, prob, mu, log = FALSE)
pnbinom(q, size, prob, mu, lower.tail = TRUE, log.p = FALSE)
qnbinom(p, size, prob, mu, lower.tail = TRUE, log.p = FALSE)
rnbinom(n, size, prob, mu)

Arguments
x 	vector of (non-negative integer) quantiles.
q 	vector of quantiles.
p 	vector of probabilities.
n 	number of observations. If length(n) > 1, the length is taken to be the number required.
size 	target for number of successful trials, or dispersion parameter (the shape parameter of the gamma mixing distribution). Must be strictly positive, need not be integer.
prob 	probability of success in each trial. 0 < prob <= 1.
mu 	alternative parametrization via mean: see ‘Details’.
log, log.p 	logical; if TRUE, probabilities p are given as log(p).
lower.tail 	logical; if TRUE (default), probabilities are P[X ≤ x], otherwise, P[X > x].
----------------------------------------------------------

I suspect we should have:

n: target for number of successful trials
Comment 1 Andreas J. Guelzow 2013-06-27 05:05:29 UTC
or we could say:

n: required number of successful trials

Note that this is somewhat strange since I belive it is more common to define the negative binomial distribution as "In probability theory and statistics, the negative binomial distribution is a discrete probability distribution of the number of successes in a sequence of Bernoulli trials before a specified (non-random) number of failures (denoted r) occurs." (from wikipedia)
Comment 2 Andreas J. Guelzow 2013-06-28 04:23:20 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.