-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecating SampleDist in favor of GaussianKDE (#284)
Deprecating SampleDist in favor of GaussianKDE
- Loading branch information
Showing
13 changed files
with
131 additions
and
205 deletions.
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,8 @@ | ||
.coverage | ||
__pycache__ | ||
*.egg-info | ||
*.pyc | ||
.ipynb_checkpoints | ||
.mypy_cache | ||
.envrc | ||
docs/.build |
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
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
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
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
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 |
---|---|---|
@@ -1,3 +1,34 @@ | ||
"""Kernel density estimation.""" | ||
""" | ||
In some cases a constructed distribution that are first and foremost data | ||
driven. In such scenarios it make sense to make use of | ||
`kernel density estimation`_ (KDE). In ``chaospy`` KDE can be accessed through | ||
the :func:`GaussianKDE` constructor. | ||
Basic usage of the :func:`GaussianKDE` constructor involves just passing the | ||
data as input argument:: | ||
>>> data = [3, 4, 5, 5] | ||
>>> distribution = chaospy.GaussianKDE(data) | ||
This distribution can be used as any other distributions:: | ||
>>> distribution.cdf([3, 3.5, 4, 4.5, 5]).round(4) | ||
array([0.1393, 0.2542, 0.3889, 0.5512, 0.7359]) | ||
>>> distribution.mom(1).round(4) | ||
4.25 | ||
>>> distribution.sample(4).round(4) | ||
array([4.7784, 2.8769, 5.8109, 4.2995]) | ||
In addition multivariate distributions supported:: | ||
>>> data = [[1, 2, 2, 3], [5, 5, 4, 3]] | ||
>>> distribution = chaospy.GaussianKDE(data) | ||
>>> distribution.sample(4).round(4) | ||
array([[2.081 , 3.0304, 3.0882, 0.4872], | ||
[3.2878, 2.5473, 2.2699, 5.3412]]) | ||
.. _kernel density estimation: \ | ||
https://en.wikipedia.org/wiki/Kernel_density_estimation | ||
""" | ||
from .gaussian import GaussianKDE | ||
from .mixture import GaussianMixture |
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
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
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.