Statistical Methods
Calculate a Total Count When Event Probabilities Differ
Define the task
A binomial count assumes a shared event probability. If independent binary events have different known probabilities, a Poisson-binomial calculation retains that heterogeneity. List one probability per event and explain its provenance. Independence is a substantive assumption: shared exposures, clustering or repeated observations may invalidate it. The calculation does not estimate the supplied risks or account for their estimation uncertainty.
Carry out the check
Build the count distribution by successively combining each Bernoulli event with the previous count probabilities. Check that all masses sum to one. The expected count is the sum of probabilities, and the variance is the sum of p(1−p) under independence. Distinguish P(count=k) from P(count≥k). The browser tool sums upper-tail masses directly and uses floating-point arithmetic; extremely tiny probabilities can underflow. Do not substitute a Poisson approximation without checking its suitability.
Worked hypothetical example
Hypothetical example: risks [0.2,0.5,0.8] produce probabilities [0.08,0.42,0.42,0.08] for counts 0,1,2,3. Thus P(count≥2)=0.50, the expected count is 1.5 and variance is 0.57. Replacing all risks by their mean 0.5 preserves the expectation but changes the variance to 0.75. Report the probability vector and independence assumption so another analyst can reproduce the scenario.
Method checked 22 November 2026 against Primary method documentation: scipy.stats.poisson_binom.