Skip to content

Commit

Permalink
Distribution Gallery: Add Kumaraswamy (#548)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleicazatti authored Oct 1, 2024
1 parent f8ec5cd commit 4ee6344
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/examples/gallery/beta.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ where $B(x;\alpha,\beta)$ is the [Incomplete beta function](https://en.wikipedia
**Common Alternatives:**
- [Kumaraswamy](Kumaraswamy.md) - It is similar to the Beta distribution, but with closed form expression for its probability density function, cumulative distribution function and quantile function.
- [Kumaraswamy](kumaraswamy.md) - It is similar to the Beta distribution, but with closed form expression for its probability density function, cumulative distribution function and quantile function.
**Related Distributions:**
- [Beta Scaled](beta_scaled.md) - A Beta distribution defined on an arbitrary range.
Expand Down
91 changes: 91 additions & 0 deletions docs/examples/gallery/kumaraswamy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
jupytext:
text_representation:
extension: .md
format_name: myst
kernelspec:
display_name: Python 3
language: python
name: python3
---
# Kumaraswamy Distribution

<audio controls> <source src="../../_static/kumaraswamy.mp3" type="audio/mpeg"> This browser cannot play the pronunciation audio file for this distribution. </audio>

The Kumaraswamy distribution is a continuous probability distribution bounded between 0 and 1. It is characterized by two positive shape parameters: $a$ and $b$.

The Kumaraswamy distribution is a flexible distribution that can adopt a wide range of shapes, including uniform, U-shape, exponential-like, and many others, always restricted to the unit interval [0, 1].

## Probability Density Function (PDF):

```{code-cell}
---
tags: [remove-input]
mystnb: image
---
import matplotlib.pyplot as plt
from preliz import Kumaraswamy, style
style.use('preliz-doc')
a_s = [.5, 5., 1., 1., 2., 2.]
b_s = [.5, 1., 1., 3., 2., 5.]
for a, b in zip(a_s, b_s):
ax = Kumaraswamy(a, b).plot_pdf()
ax.set_ylim(0, 3.)
```

## Cumulative Distribution Function (CDF):

```{code-cell}
---
tags: [remove-input]
mystnb: image
---
for a, b in zip(a_s, b_s):
ax = Kumaraswamy(a, b).plot_cdf()
```

## Key properties and parameters:

```{eval-rst}
======== ==============================================================
Support :math:`x \in (0, 1)`
Mean :math:`b B(1 + \tfrac{1}{a}, b)`
Variance :math:`b B(1 + \tfrac{2}{a}, b) - (b B(1 + \tfrac{1}{a}, b))^2`
======== ==============================================================
```

**Probability Density Function (PDF):**

$$
f(x|a, b) = a b x^{a-1} (1 - x^{a})^{b-1}
$$


**Cumulative Distribution Function (CDF):**

$$
F(x|a, b) = 1 - (1 - x^{a})^{b}
$$


```{seealso}
:class: seealso
**Common Alternatives:**
- [Beta](beta.md) - The Kumaraswamy distribution is similar to the Beta distribution, but with closed-form expressions for its probability density function, cumulative distribution function and quantile function.
**Related Distributions:**
- [Uniform](uniform.md) - The Uniform distribution on the interval [0, 1] is a special case of the Kumaraswamy distribution with $a = b = 1$.
```

## References

- [Wikipedia - Kumaraswamy distribution](https://en.wikipedia.org/wiki/Kumaraswamy_distribution)



2 changes: 1 addition & 1 deletion docs/gallery_content.rst
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ Continuous Distributions
Inverse Gamma

.. grid-item-card::
:link: ./api_reference.html#preliz.distributions.kumaraswamy.Kumaraswamy
:link: ./examples/gallery/kumaraswamy.html
:text-align: center
:shadow: none
:class-card: example-gallery
Expand Down

0 comments on commit 4ee6344

Please sign in to comment.