question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

binomial cdf fails for large n

See original GitHub issue

in R:

> pbinom(101073, 101184, 0.9988219676207195)
[1] 0.7857314

in jStat

> jStat.binomial.cdf(101073, 101184, 0.9988219676207195)
NaN

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jspeiscommented, Jun 4, 2019

@trevnorris might be interesting to look at this implementation seems like this approach uses a numerical approximation that appears able to replicate R’s results in my previous example at least to 5 decimal places

0reactions
trevnorriscommented, Jun 4, 2019

@jspeis Excellent. Thanks for the reference. The accuracy is determined by the accuracy of the log gamma implementation. Using jstat.gammaln I’m able to get 10 digits of accuracy.

One question. There’s a function Betinc(X, A, B). Does that look like a reference to some other stats function to you?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error in the normal approximation to the binomial distribution
The following plot shows the error in the normal approximation to the CDF of a binomial(10, 0.5) random variable. Here we are computing...
Read more >
10.3 - Cumulative Binomial Probabilities | STAT 414
Solution · Find n , the number in the sample, in the first column on the left. · Find the column containing p,...
Read more >
The Binomial Distribution: A Probability Model for a Discrete ...
As a result, whenever using the binomial distribution, we must clearly specify which outcome is the "success" and which is the "failure".
Read more >
Using a binomial probability table to solve ... - YouTube
In this video, we calculate a set of probabilities all at once using a binomial probability table. When looking for the probability that...
Read more >
Binomial distribution - Wikipedia
However, for N much larger than n, the binomial distribution remains a good approximation, and is widely used.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found