diff --git a/docs/examples/poisson_distribution.md b/docs/examples/poisson_distribution.md new file mode 100644 index 00000000..d74cb4b0 --- /dev/null +++ b/docs/examples/poisson_distribution.md @@ -0,0 +1,93 @@ +--- +jupytext: + text_representation: + extension: .md + format_name: myst +kernelspec: + display_name: Python 3 + language: python + name: python3 +--- +# Poisson Distribution + +The Poisson distribution is a discrete probability distribution that expresses the probability of a given number of events occurring in a fixed interval of time (or space) if these events occur with a known constant mean rate and independently of the time since the last event. + + +## Probability Density Function (PDF): + +```{code-cell} +--- +tags: [remove-input] +mystnb: + image: + alt: Poisson Distribution PDF +--- + +import arviz as az +from preliz import Poisson +az.style.use('arviz-doc') +for mu in [0.5, 3, 8]: + Poisson(mu).plot_pdf(); +``` + +## Cumulative Distribution Function (CDF): + +```{code-cell} +--- +tags: [remove-input] +mystnb: + image: + alt: Poisson Distribution CDF +--- + +for mu in [0.5, 3, 8]: + Poisson(mu).plot_cdf(); +``` + +## Key properties and parameters: + +```{eval-rst} +======== ========================== +Support :math:`x \in \mathbb{N}_0` +Mean :math:`\mu` +Variance :math:`\mu` +======== ========================== +``` + +**Probability Density Function (PDF):** + +$$ +f(x \mid \mu) = \frac{e^{-\mu}\mu^x}{x!} +$$ + +**Cumulative Distribution Function (CDF):** + +$$ +f(x \mid \mu) = \frac{\Gamma(x + 1, \mu)}{x!} +$$ + +where $\Gamma(x + 1, \mu)$ is the [upper incomplete gamma function](https://en.wikipedia.org/wiki/Incomplete_gamma_function). + +```{seealso} +:class: seealso + +**Common Alternatives:** + +- [NegativeBinomial](negative_binomial_distribution.md) - The Negative Binomial is often used as an alternative the Poisson when the variance is greater than the mean (overdispersed data). +- [ZeroInflatedPoisson](zero_inflated_poisson_distribution.md) - The Zero-Inflated Poisson is used when there is an excess of zero counts in the data. +- [HurdlePoisson](hurdle_distribution.md) - The Hurdle Poisson is used when there is an excess of zero counts in the data. + +**Related Distributions:** + +- [Binomial](binomial_distribution.md) - The Poisson distribution can be derived as a limiting case to the binomial distribution as the number of trials goes to infinity and the expected number of successes remains fixed. See [law of rare events](https://en.wikipedia.org/wiki/Poisson_distribution#law_of_rare_events). +- [Normal](normal_distribution.md) - For sufficiently large values of $\mu$, the normal distribution with mean $\mu$ and standard deviation \sqrt{\mu} can be a good approximation to the Poisson. +``` + +## References + +- [Wikipedia - Poisson Distribution](https://en.wikipedia.org/wiki/Poisson_distribution) + + + + +