-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Distributions Gallery: Add VonMises (#574)
- Loading branch information
1 parent
0e986dd
commit e613494
Showing
2 changed files
with
90 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
--- | ||
jupytext: | ||
text_representation: | ||
extension: .md | ||
format_name: myst | ||
kernelspec: | ||
display_name: Python 3 | ||
language: python | ||
name: python3 | ||
--- | ||
# Von Mises Distribution | ||
|
||
<audio controls> <source src="../../_static/vonmises.mp3" type="audio/mpeg"> This browser cannot play the pronunciation audio file for this distribution. </audio> | ||
|
||
The Von Mises distribution is a continuous probability distribution on the unit circle. It is characterized by two parameters: $\mu$ and $\kappa$, which are the mean direction and concentration parameter, respectively. | ||
|
||
The Von Mises distribution is the circular analogue of the normal distribution, and it is used to model circular data, such as wind directions, compass bearings, or angles. | ||
|
||
## Probability Density Function (PDF): | ||
|
||
```{code-cell} | ||
--- | ||
tags: [remove-input] | ||
mystnb: | ||
image: | ||
alt: Von Mises Distribution PDF | ||
--- | ||
import numpy as np | ||
from preliz import style, VonMises | ||
style.use('preliz-doc') | ||
mus = [0., 0., 0., -2.5] | ||
kappas = [.01, 0.5, 4., 2.] | ||
for mu, kappa in zip(mus, kappas): | ||
VonMises(mu, kappa).plot_pdf(support=(-np.pi,np.pi)) | ||
``` | ||
|
||
## Cumulative Distribution Function (CDF): | ||
|
||
```{code-cell} | ||
--- | ||
tags: [remove-input] | ||
mystnb: | ||
image: | ||
alt: Von Mises Distribution CDF | ||
--- | ||
for mu, kappa in zip(mus, kappas): | ||
VonMises(mu, kappa).plot_cdf(support=(-np.pi,np.pi)) | ||
``` | ||
|
||
## Key properties and parameters: | ||
|
||
```{eval-rst} | ||
======== ========================================== | ||
Support :math:`x \in (-\pi, \pi)` | ||
Mean :math:`\mu` | ||
Variance :math:`1 - I_1(\kappa) / I_0(\kappa)` | ||
======== ========================================== | ||
``` | ||
|
||
**Probability Density Function (PDF):** | ||
|
||
$$ | ||
f(x|\mu, \kappa) = \frac{e^{\kappa \cos(x - \mu)}}{2\pi I_0(\kappa)} | ||
$$ | ||
|
||
where $I_0(\kappa)$ is the [modified Bessel function of the first kind](https://en.wikipedia.org/wiki/Bessel_function#Modified_Bessel_functions:_I%CE%B1,_K%CE%B1). | ||
|
||
**Cumulative Distribution Function (CDF):** | ||
|
||
The Von Mises distribution does not have an analytical expression for the CDF. However, it can be evaluated numerically by integrating the PDF in the interval $(-\pi, x)$: | ||
|
||
$$ | ||
F(x|\mu, \kappa) = \frac{1}{2\pi I_0(\kappa)} \int_{-\pi}^{x} e^{\kappa \cos(t - \mu)} dt | ||
$$ | ||
|
||
```{seealso} | ||
:class: seealso | ||
**Related Distributions:** | ||
- [Normal Distribution](normal.md) - When $\kappa \to \infty$, the Von Mises distribution approximates the normal distribution. | ||
- [Uniform Distribution](uniform.md) - When $\kappa = 0$, the Von Mises distribution converges to the uniform distribution in the interval $(-\pi, \pi)$. | ||
``` | ||
|
||
## References | ||
|
||
- [Wikipedia - Von Mises distribution](https://en.wikipedia.org/wiki/Von_Mises_distribution) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters