Dear community members,
We’re excited to announce the implementation of the Poisson Binomial distribution in stats.poisson_binom
. We need your help to test it thoroughly and if you have an efficient implementation, contribute to it.
Where?
this pull requeset.
How You Can Help:
Please take the new feature for a test drive.
Here is a sample code:
import numpy as np
from scipy.stats import poisson_binom
rng = np.random.default_rng(12345)
n = 5
k = np.arange(n + 1)
p = rng.random(n)
poisson_binom.pmf(k, p)
Some Fun Applications to Explore:

Testing Reliability: Calculate the probability that at least 3 out of 5 components in a system will fail, where each component has a different probability of failure.

Epidemiology Studies: Estimate the probability that a certain number of individuals in a population will contract a disease given different individual risk levels.

Marketing Campaign Success: Determine the likelihood that at least half of your targeted audience will respond to a marketing campaign, given individual probabilities of response.

Quality Control in Manufacturing: Suppose you have 10 machines producing items, each with a different probability of producing a defective item. Use the Poisson Binomial distribution to calculate the probability of getting a specific number of defective items in a batch.

Voting Behavior: Determine the probability that a certain number of people out of a group will vote in favor of a candidate, where each person has a different probability of voting for them.

Insurance Risk Assessment: For an insurance company, calculate the probability that a certain number of claims will be filed in a given period, with each policyholder having a different probability of filing a claim.

Supply Chain Management: Estimate the probability that a certain number of suppliers will deliver on time, given that each supplier has a different probability of timely delivery.

Customer Retention Analysis: Calculate the likelihood that a specific number of customers will renew their subscription, where each customer has an individual probability of renewal.

Sports Analytics: Assess the probability that a certain number of players on a team will score a goal in a match, given each player’s different likelihood of scoring.

Network Reliability: For a computer network, determine the probability that a certain number of connections will remain operational, where each connection has a different probability of failure.

Portfolio Risk Management: In finance, calculate the probability that a specific number of assets in a portfolio will lose value, given different probabilities of loss for each asset.

Predictive Maintenance: For industrial equipment, determine the likelihood that a specific number of machines will require maintenance within a given time frame, given different probabilities of failure.
These are just a few examples of how the Poisson Binomial distribution can be applied. We encourage you to experiment with your own scenarios and share your findings and any issues you encounter.
A big thank you to @mdhaber for bringing this feature to life!
Your feedback is invaluable in helping us refine this feature before its full release. Thank you in advance for your contributions!
Looking forward to seeing your contributions and insights!
Best regards,
Ali