R.PNBINOM Function (Gnumeric)
Evaluate negative-binomial cumulative probabilities with Gnumeric R.PNBINOM. Check failures before successes, fractional shapes, survival tails and zero size.
Verification status: 23 reference, boundary and advanced-check formulas were recalculated with Gnumeric 1.12.57 ssconvert. Saved identities, the blank input and numerical results were independently checked. Gnumeric 1.12.62 was source-checked only. How formula examples are checked
Quick answer: =R.PNBINOM(2,3,.5) gives 0.5 in Gnumeric 1.12.57.
Availability and version history
- Introduced: First release not established; present in the retained 1.12.57 source.
- Supported in: Gnumeric 1.12.62; no retirement is established.
- Scope: Desktop Gnumeric with its Statistical Functions From R plugin. English comma-separated formulas are shown.
- Checked: October 14, 2026. Tables and the named advanced check use 1.12.57 ssconvert. Current 1.12.62 source was inspected; that release was not executed.
What R.PNBINOM returns
R.PNBINOM gives P(X≤x) for the negative-binomial failure count. For positive shape r and success chance p, the CDF at a nonnegative integer k is the regularized incomplete beta value I_p(r,k+1). A FALSE lower_tail requests P(X>x). Versioned function help.
Syntax and arguments
=R.PNBINOM(cutoff,size,success_probability[,lower_tail[,log_p]])
- cutoff: required failure-count threshold; ordinary fractional cutoffs are floored.
- size: required nonnegative shape; a positive integer describes the target number of successes. Positive noninteger shapes are supported mathematically.
- success_probability: per-trial success chance, with 0<p≤1.
- lower_tail: optional TRUE for P(X≤x); FALSE for the strict upper tail P(X>x).
- log_p: optional FALSE. TRUE uses the natural logarithm of the probability.
Brackets mark optional arguments; do not type them. Current worksheet implementation.
Reproducible examples
These self-contained formulas were recalculated natively. Ordinary-domain results were checked against independent mathematics; source guards explain the boundary cases. Results are rounded to twelve decimal places, or thirteen significant digits for small nonzero values. This is presentation precision, not a universal accuracy guarantee.
| Formula | Gnumeric 1.12.57 result |
|---|---|
=R.PNBINOM(2,3,.5) |
0.5 |
=R.PNBINOM(2.9,3,.5) |
0.5 |
=R.PNBINOM(4,2,.25) |
0.466064453125 |
=R.PNBINOM(2,2.5,.4) |
0.412361006886 |
=R.PNBINOM(2,3,.5,FALSE()) |
0.5 |
=R.PNBINOM(2,3,.5,TRUE(),TRUE()) |
-0.69314718056 |
=R.PNBINOM(2,3,.5,FALSE(),TRUE()) |
-0.69314718056 |
=R.PNBINOM(0,0,.5) |
1 |
Practical worksheet
For three required successes and p=0.5, R.PNBINOM(2,3,0.5)=0.5. This is the chance of completing the third success with at most two failures, hence within five total trials. The strict upper tail is also 0.5 for this particular symmetric setup.
Advanced interpretation and checks
To allow seven total trials while seeking three successes, use a failure cutoff of four: R.PNBINOM(4,3,0.5)=0.7734375. The complementary probability of needing more trials is 0.2265625. At size 1 the model becomes geometric, so the saved subtraction check against R.PGEOM is mathematically zero. Keep the shape and probability fixed when comparing neighboring CDFs.
The saved advanced-check result for =R.PNBINOM(3,1,.2)-R.PGEOM(3,.2) was 0.
Boundaries and troubleshooting
Positive fractional shapes are accepted; fractional failure cutoffs are floored. Size zero gives a point mass at zero, so its CDF is one at nonnegative cutoffs and zero below zero. The helper still rejects p=0, including size zero, unlike a special branch in R.QNBINOM. Negative sizes and invalid success probabilities fail. A zero tail requested in log mode becomes #NUM! rather than a finite log value.
F5 is genuinely empty, rather than a cell containing an empty string.
| Formula | Gnumeric 1.12.57 result |
|---|---|
=R.PNBINOM(-1,3,.5) |
0 |
=R.PNBINOM(-1,3,.5,TRUE(),TRUE()) |
#NUM! |
=R.PNBINOM(2,-1,.5) |
#NUM! |
=R.PNBINOM(2,3,0) |
#NUM! |
=R.PNBINOM(2,3,-.1) |
#NUM! |
=R.PNBINOM(2,3,1.1) |
#NUM! |
=R.PNBINOM(1,0,.5) |
1 |
=R.PNBINOM(-1,0,.5) |
0 |
=R.PNBINOM(0,3,1) |
1 |
=R.PNBINOM(0,3,1,FALSE(),TRUE()) |
#NUM! |
=R.PNBINOM("abc",3,.5) |
#VALUE! |
=R.PNBINOM(F5,3,.5) |
0.125 |
=R.PNBINOM(2,3) |
#N/A |
=R.PNBINOM(2,3,.5,1,0,1) |
#N/A |
Official evidence and checking scope
- Current worksheet callback
- Tested-version worksheet callback
- Current pnbinom calculation
- Tested-version pnbinom calculation
- Nonfinite worksheet-value handling
- Statistical Functions From R plugin declaration
The relevant complete worksheet callback and main calculation helper are unchanged between the inspected versions. That does not establish later-version numerical execution. Both stale and uncached SUM controls recalculated correctly. Native XML preserves the R.* identities. The secondary ODF export keeps these calls in the ORG.GNUMERIC namespace; it does not establish execution in another product. GUI entry, other locales and other spreadsheet products were not tested.