Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Exponential distribution page #487

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions docs/examples/exponential_distribution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
jupytext:
text_representation:
extension: .md
format_name: myst
kernelspec:
display_name: Python 3
language: python
name: python3
---
# Exponential Distribution

The exponential distribution is a continuous probability distribution that describes the time between events in a Poisson process, in which events occur continuously and independently at a constant average rate. It has a memorylessness property, which means that the probability of the event occurring in the next instant of time does not depend on how much time has already elapsed. It is characterized by the rate parameter $\lambda$ which is the reciprocal of the mean of the distribution.

Many real-world phenomena can be modeled using the exponential distribution across various fields. For example, it is used in physics to model the time between decays of a radioactive atom, in medicine to model the time between seizures in patients with epilepsy, in engineering to model the time between failures of a machine, and in finance to model the time between changes in the price of a stock.

In Bayesian modeling, the exponential distribution is often used as a prior distribution for scale parameters, which must always be positive.

## Probability Density Function (PDF):

```{code-cell}
---
tags: [remove-input]
mystnb:
image:
alt: Exponential Distribution PDF
---

import matplotlib.pyplot as plt
import arviz as az
from preliz import Exponential
az.style.use('arviz-doc')
lambdas = [0.5, 1., 2.]

for lam in lambdas:
Exponential(lam).plot_pdf(support=(0, 5))
```

## Cumulative Distribution Function (CDF):

```{code-cell}
---
tags: [remove-input]
mystnb:
image:
alt: Exponential Distribution CDF
---

for lam in lambdas:
Exponential(lam).plot_cdf(support=(0, 5))
```

## Key properties and parameters:

```{eval-rst}
======== ==========================================
Support :math:`x \in (0, \infty)`
Mean :math:`\frac{1}{\lambda}`
Variance :math:`\frac{1}{\lambda^2}`
======== ==========================================
```

**Probability Density Function (PDF):**

$$
f(x|\lambda) = \lambda e^{-\lambda x}
$$

**Cumulative Distribution Function (CDF):**

$$
F(x|\lambda) = 1 - e^{-\lambda x}
$$

```{seealso}
:class: seealso

**Common Alternatives:**

- [Gamma Distribution](gamma_distribution.md) - The Exponential distribution is a special case of the Gamma distribution with the shape parameter $\alpha = 1$.
- [Weibull Distribution](weibull_distribution.md) - The Exponential distribution is a special case of the Weibull distribution with the shape parameter $\alpha = 1$.

**Related Distributions:**

- [Poisson Distribution](poisson_distribution.md) - While the Exponential distribution models the time between events in a Poisson process, the Poisson distribution models the number of events in fixed intervals of time or space.
- [Geometric Distribution](geometric_distribution.md) - The discrete counterpart of the Exponential distribution, modeling the number of trials needed to achieve the first success in a sequence of Bernoulli trials.
```

## References

- [Wikipedia - Exponential Distribution](https://en.wikipedia.org/wiki/Exponential_distribution)





Loading