pyest 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyest-0.2.2/.gitattributes +16 -0
- pyest-0.2.2/.github/workflows/pythonapp.yml +32 -0
- pyest-0.2.2/.gitignore +158 -0
- pyest-0.2.2/.readthedocs.yaml +22 -0
- pyest-0.2.2/CONTRIBUTING.md +62 -0
- pyest-0.2.2/LICENSE.txt +7 -0
- pyest-0.2.2/PKG-INFO +158 -0
- pyest-0.2.2/README.md +127 -0
- pyest-0.2.2/docs/.gitignore +30 -0
- pyest-0.2.2/docs/Makefile +20 -0
- pyest-0.2.2/docs/api.rst +50 -0
- pyest-0.2.2/docs/conf.py +67 -0
- pyest-0.2.2/docs/contributing.rst +83 -0
- pyest-0.2.2/docs/examples.rst +29 -0
- pyest-0.2.2/docs/index.rst +32 -0
- pyest-0.2.2/docs/installation.rst +47 -0
- pyest-0.2.2/docs/requirements.txt +1 -0
- pyest-0.2.2/docs/usage.rst +72 -0
- pyest-0.2.2/examples/example_gm_2d_split.py +50 -0
- pyest-0.2.2/examples/example_split_for_fov.py +147 -0
- pyest-0.2.2/examples/example_splitting_cislunar.py +249 -0
- pyest-0.2.2/examples/example_splitting_polar_transformation.py +216 -0
- pyest-0.2.2/pyest/__init__.py +11 -0
- pyest-0.2.2/pyest/filters/GaussianMixtureFilter.py +87 -0
- pyest-0.2.2/pyest/filters/Gmkf.py +202 -0
- pyest-0.2.2/pyest/filters/Gmukf.py +168 -0
- pyest-0.2.2/pyest/filters/KalmanFilter.py +628 -0
- pyest-0.2.2/pyest/filters/UnscentedKalmanFilter.py +262 -0
- pyest-0.2.2/pyest/filters/__init__.py +8 -0
- pyest-0.2.2/pyest/filters/sigma_points.py +213 -0
- pyest-0.2.2/pyest/gm/__init__.py +4 -0
- pyest-0.2.2/pyest/gm/defaults.py +82 -0
- pyest-0.2.2/pyest/gm/gm.py +941 -0
- pyest-0.2.2/pyest/gm/main.py +2 -0
- pyest-0.2.2/pyest/gm/reduce.py +297 -0
- pyest-0.2.2/pyest/gm/split.py +1695 -0
- pyest-0.2.2/pyest/linalg.py +122 -0
- pyest-0.2.2/pyest/metrics.py +90 -0
- pyest-0.2.2/pyest/particle.py +60 -0
- pyest-0.2.2/pyest/sensors/FieldOfView.py +356 -0
- pyest-0.2.2/pyest/sensors/__init__.py +1 -0
- pyest-0.2.2/pyest/sensors/defaults.py +7 -0
- pyest-0.2.2/pyest/tens.py +338 -0
- pyest-0.2.2/pyest/utils.py +96 -0
- pyest-0.2.2/pyproject.toml +50 -0
- pyest-0.2.2/requirements.txt +7 -0
- pyest-0.2.2/tests/README.md +0 -0
- pyest-0.2.2/tests/__init__.py +0 -0
- pyest-0.2.2/tests/test_distributions.py +52 -0
- pyest-0.2.2/tests/test_filters.py +336 -0
- pyest-0.2.2/tests/test_gm.py +529 -0
- pyest-0.2.2/tests/test_linalg.py +72 -0
- pyest-0.2.2/tests/test_metrics.py +27 -0
- pyest-0.2.2/tests/test_sensors.py +168 -0
- pyest-0.2.2/tests/test_sigma_points.py +84 -0
- pyest-0.2.2/tox.ini +16 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Set the default behavior, in case people don't have core.autocrlf set.
|
|
2
|
+
* text=auto
|
|
3
|
+
|
|
4
|
+
# Explicitly declare text files you want to always be normalized and converted
|
|
5
|
+
# to native line endings on checkout.
|
|
6
|
+
*.c text
|
|
7
|
+
*.h text
|
|
8
|
+
*.py text
|
|
9
|
+
*.md text
|
|
10
|
+
|
|
11
|
+
# Declare files that will always have CRLF line endings on checkout.
|
|
12
|
+
*.sln text eol=crlf
|
|
13
|
+
|
|
14
|
+
# Denote all files that are truly binary and should not be modified.
|
|
15
|
+
*.png binary
|
|
16
|
+
*.jpg binary
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Python application
|
|
2
|
+
|
|
3
|
+
on: [push]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
build:
|
|
7
|
+
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
timeout-minutes: 10
|
|
10
|
+
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v2
|
|
13
|
+
- name: Set up Python 3.9
|
|
14
|
+
uses: actions/setup-python@v1
|
|
15
|
+
with:
|
|
16
|
+
python-version: 3.9
|
|
17
|
+
- name: Install dependencies
|
|
18
|
+
run: |
|
|
19
|
+
python -m pip install --upgrade pip
|
|
20
|
+
pip install -r requirements.txt
|
|
21
|
+
- name: Lint with flake8
|
|
22
|
+
run: |
|
|
23
|
+
pip install flake8
|
|
24
|
+
# stop the build if there are Python syntax errors or undefined names
|
|
25
|
+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
26
|
+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
|
27
|
+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
|
28
|
+
- name: Test with pytest
|
|
29
|
+
run: |
|
|
30
|
+
pip install pytest
|
|
31
|
+
pip install -e '.[test]'
|
|
32
|
+
pytest
|
pyest-0.2.2/.gitignore
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# autosave files
|
|
2
|
+
*.asv
|
|
3
|
+
*.m~
|
|
4
|
+
*.swp
|
|
5
|
+
*.swo
|
|
6
|
+
|
|
7
|
+
# data
|
|
8
|
+
example/data/
|
|
9
|
+
*.png
|
|
10
|
+
*.PNG
|
|
11
|
+
*.mat
|
|
12
|
+
*.svg
|
|
13
|
+
*.csv
|
|
14
|
+
*.info
|
|
15
|
+
*.parquet
|
|
16
|
+
|
|
17
|
+
# matlab
|
|
18
|
+
*.fig
|
|
19
|
+
|
|
20
|
+
# images
|
|
21
|
+
*.png
|
|
22
|
+
*.jpg
|
|
23
|
+
|
|
24
|
+
# videos
|
|
25
|
+
*.avi
|
|
26
|
+
|
|
27
|
+
# mac
|
|
28
|
+
*.DS_Store
|
|
29
|
+
|
|
30
|
+
*typescript
|
|
31
|
+
|
|
32
|
+
# Byte-compiled / optimized / DLL files
|
|
33
|
+
__pycache__/
|
|
34
|
+
*.py[cod]
|
|
35
|
+
*$py.class
|
|
36
|
+
|
|
37
|
+
# C extensions
|
|
38
|
+
*.so
|
|
39
|
+
|
|
40
|
+
# Distribution / packaging
|
|
41
|
+
.Python
|
|
42
|
+
build/
|
|
43
|
+
develop-eggs/
|
|
44
|
+
dist/
|
|
45
|
+
downloads/
|
|
46
|
+
eggs/
|
|
47
|
+
.eggs/
|
|
48
|
+
lib/
|
|
49
|
+
lib64/
|
|
50
|
+
parts/
|
|
51
|
+
sdist/
|
|
52
|
+
var/
|
|
53
|
+
wheels/
|
|
54
|
+
*.egg-info/
|
|
55
|
+
.installed.cfg
|
|
56
|
+
*.egg
|
|
57
|
+
MANIFEST
|
|
58
|
+
|
|
59
|
+
# PyInstaller
|
|
60
|
+
# Usually these files are written by a python script from a template
|
|
61
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
62
|
+
*.manifest
|
|
63
|
+
*.spec
|
|
64
|
+
|
|
65
|
+
# Installer logs
|
|
66
|
+
pip-log.txt
|
|
67
|
+
pip-delete-this-directory.txt
|
|
68
|
+
|
|
69
|
+
# Unit test / coverage reports
|
|
70
|
+
htmlcov/
|
|
71
|
+
.tox/
|
|
72
|
+
.nox/
|
|
73
|
+
.coverage
|
|
74
|
+
.coverage.*
|
|
75
|
+
.cache
|
|
76
|
+
nosetests.xml
|
|
77
|
+
coverage.xml
|
|
78
|
+
*.cover
|
|
79
|
+
.hypothesis/
|
|
80
|
+
.pytest_cache/
|
|
81
|
+
|
|
82
|
+
# Translations
|
|
83
|
+
*.mo
|
|
84
|
+
*.pot
|
|
85
|
+
|
|
86
|
+
# Django stuff:
|
|
87
|
+
*.log
|
|
88
|
+
local_settings.py
|
|
89
|
+
db.sqlite3
|
|
90
|
+
|
|
91
|
+
# Flask stuff:
|
|
92
|
+
instance/
|
|
93
|
+
.webassets-cache
|
|
94
|
+
|
|
95
|
+
# Scrapy stuff:
|
|
96
|
+
.scrapy
|
|
97
|
+
|
|
98
|
+
# Sphinx documentation
|
|
99
|
+
docs/_build/
|
|
100
|
+
|
|
101
|
+
# PyBuilder
|
|
102
|
+
target/
|
|
103
|
+
|
|
104
|
+
# Jupyter Notebook
|
|
105
|
+
.ipynb_checkpoints
|
|
106
|
+
|
|
107
|
+
# IPython
|
|
108
|
+
profile_default/
|
|
109
|
+
ipython_config.py
|
|
110
|
+
|
|
111
|
+
# pyenv
|
|
112
|
+
.python-version
|
|
113
|
+
|
|
114
|
+
# celery beat schedule file
|
|
115
|
+
celerybeat-schedule
|
|
116
|
+
|
|
117
|
+
# SageMath parsed files
|
|
118
|
+
*.sage.py
|
|
119
|
+
|
|
120
|
+
# Environments
|
|
121
|
+
.env
|
|
122
|
+
.venv
|
|
123
|
+
env/
|
|
124
|
+
venv/
|
|
125
|
+
ENV/
|
|
126
|
+
env.bak/
|
|
127
|
+
venv.bak/
|
|
128
|
+
|
|
129
|
+
# Spyder project settings
|
|
130
|
+
.spyderproject
|
|
131
|
+
.spyproject
|
|
132
|
+
|
|
133
|
+
# Rope project settings
|
|
134
|
+
.ropeproject
|
|
135
|
+
|
|
136
|
+
# mkdocs documentation
|
|
137
|
+
/site
|
|
138
|
+
|
|
139
|
+
# mypy
|
|
140
|
+
.mypy_cache/
|
|
141
|
+
.dmypy.json
|
|
142
|
+
dmypy.json
|
|
143
|
+
|
|
144
|
+
.vscode/
|
|
145
|
+
compiled_build/
|
|
146
|
+
.idea/
|
|
147
|
+
*.code-workspace
|
|
148
|
+
|
|
149
|
+
# tags
|
|
150
|
+
*tags
|
|
151
|
+
|
|
152
|
+
# split cache
|
|
153
|
+
pyest/gm/splitl2_cov_cache/
|
|
154
|
+
pyest/gm/splitl2_cache/
|
|
155
|
+
|
|
156
|
+
# benchmark data
|
|
157
|
+
.benchmarks/
|
|
158
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Read the Docs configuration file
|
|
2
|
+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
|
3
|
+
|
|
4
|
+
# Required
|
|
5
|
+
version: 2
|
|
6
|
+
|
|
7
|
+
# Set the OS, Python version, and other tools you might need
|
|
8
|
+
build:
|
|
9
|
+
os: ubuntu-24.04
|
|
10
|
+
tools:
|
|
11
|
+
python: "3.13"
|
|
12
|
+
|
|
13
|
+
# Build documentation in the "docs/" directory with Sphinx
|
|
14
|
+
sphinx:
|
|
15
|
+
configuration: docs/conf.py
|
|
16
|
+
|
|
17
|
+
# Optionally, but recommended,
|
|
18
|
+
# declare the Python requirements required to build your documentation
|
|
19
|
+
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
|
|
20
|
+
python:
|
|
21
|
+
install:
|
|
22
|
+
- requirements: docs/requirements.txt
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
## Installation
|
|
2
|
+
|
|
3
|
+
### OS X (zsh)
|
|
4
|
+
|
|
5
|
+
To install everything in developer mode,
|
|
6
|
+
```shell
|
|
7
|
+
pip install -e '.[test,examples]'
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
### OS X (bash), Windows (cmd prompt)
|
|
11
|
+
|
|
12
|
+
To install everything in developer mode,
|
|
13
|
+
```shell
|
|
14
|
+
pip install -e .[test,examples]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Testing
|
|
18
|
+
|
|
19
|
+
### using tox (recommended)
|
|
20
|
+
If you don't already have tox installed, you can pip install it
|
|
21
|
+
```
|
|
22
|
+
pip install tox
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
To run unit tests, run
|
|
26
|
+
```
|
|
27
|
+
tox run
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### using pytest
|
|
32
|
+
To run unit tests, use pytest:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
pytest --cov=pyest --cov-report term-missing tests
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
To run unit tests with performance benchmarking:
|
|
39
|
+
```
|
|
40
|
+
pytest --benchmark-save=benchmark --benchmark-compare --cov=pyest --cov-report term-missing tests
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Documentation
|
|
44
|
+
|
|
45
|
+
To build the documentation:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
pip install sphinx sphinx-rtd-theme
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Then,
|
|
52
|
+
```
|
|
53
|
+
cd docs
|
|
54
|
+
make html
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
If you are using Windows powershell and don't have `make` installed, you can
|
|
58
|
+
alternatively run
|
|
59
|
+
```
|
|
60
|
+
cd docs
|
|
61
|
+
sphinx-build -b html . _build
|
|
62
|
+
```
|
pyest-0.2.2/LICENSE.txt
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2025 Keith LeGrand
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
pyest-0.2.2/PKG-INFO
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pyest
|
|
3
|
+
Version: 0.2.2
|
|
4
|
+
Summary: Adaptive Gaussian Mixture State Estimation
|
|
5
|
+
Project-URL: Homepage, https://github.com/scope-lab/pyest
|
|
6
|
+
Project-URL: Issues, https://github.com/scope-lab/pyest
|
|
7
|
+
Project-URL: Documentation, https://pyest.readthedocs.io/en/latest/
|
|
8
|
+
Author: Keith A. LeGrand
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE.txt
|
|
11
|
+
Requires-Python: >=3.9
|
|
12
|
+
Requires-Dist: cvxopt
|
|
13
|
+
Requires-Dist: diskcache
|
|
14
|
+
Requires-Dist: fastparquet
|
|
15
|
+
Requires-Dist: huggingface-hub
|
|
16
|
+
Requires-Dist: jax
|
|
17
|
+
Requires-Dist: numba
|
|
18
|
+
Requires-Dist: numpy
|
|
19
|
+
Requires-Dist: pyarrow
|
|
20
|
+
Requires-Dist: scipy
|
|
21
|
+
Requires-Dist: shapely
|
|
22
|
+
Provides-Extra: examples
|
|
23
|
+
Requires-Dist: matplotlib; extra == 'examples'
|
|
24
|
+
Requires-Dist: stmint>=1.2.1; extra == 'examples'
|
|
25
|
+
Requires-Dist: sympy==1.12; extra == 'examples'
|
|
26
|
+
Provides-Extra: test
|
|
27
|
+
Requires-Dist: dill; extra == 'test'
|
|
28
|
+
Requires-Dist: pytest-benchmark; extra == 'test'
|
|
29
|
+
Requires-Dist: pytest-cov; extra == 'test'
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
|
|
32
|
+

|
|
33
|
+
# PyEst: Gaussian Mixture Adaptive State Estimation
|
|
34
|
+
|
|
35
|
+
## Basic Usage
|
|
36
|
+
|
|
37
|
+
Import the `gm` module of PyEst as well as numpy and matplotlib
|
|
38
|
+
```
|
|
39
|
+
import numpy as np
|
|
40
|
+
import matplotlib.pyplot as plt
|
|
41
|
+
import pyest.gm as gm
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Create a three-mixand two-dimensional Gaussian mixture:
|
|
45
|
+
```
|
|
46
|
+
# mixand means (nc,nx)
|
|
47
|
+
m = np.array([[0,0], [1,2], [0,-1]])
|
|
48
|
+
# mixand covariance matrices (nc,nx,nx)
|
|
49
|
+
P = np.array([[[1,0], [0,1]],
|
|
50
|
+
[[2, 0.5], [0.5,3]],
|
|
51
|
+
[[0.5, -0.1], [-0.1, 1]]])
|
|
52
|
+
# mixand weights (nc,)
|
|
53
|
+
w = gm.equal_weights(3)
|
|
54
|
+
# contruct the Gaussian mixture
|
|
55
|
+
p = gm.GaussianMixture(w, m, P)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Compute the mean and covariance of the distribution:
|
|
59
|
+
```
|
|
60
|
+
# compute and print the mean
|
|
61
|
+
print(p.mean())
|
|
62
|
+
# compute and print the covariance
|
|
63
|
+
print(p.cov())
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Plot the Gaussian mixture
|
|
67
|
+
```
|
|
68
|
+
pp, XX, YY = p.pdf_2d()
|
|
69
|
+
fig = plt.figure()
|
|
70
|
+
ax = fig.add_axes(111)
|
|
71
|
+
ax.contourf(XX,YY,pp,100)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Apply a linear transformation to the mixture
|
|
75
|
+
```
|
|
76
|
+
dt = 5
|
|
77
|
+
F = np.array([[1, dt], [0, 1]])
|
|
78
|
+
my = np.array([F@m for m in p.m])
|
|
79
|
+
Py = np.array([F@P@F.T for P in p.P])
|
|
80
|
+
py = gm.GaussianMixture(p.w, my, Py)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Plot the transformed Gaussian mixture
|
|
84
|
+
```
|
|
85
|
+
pp, XX, YY = py.pdf_2d()
|
|
86
|
+
fig = plt.figure()
|
|
87
|
+
ax = fig.add_axes(111)
|
|
88
|
+
ax.contourf(XX,YY,pp,100)
|
|
89
|
+
plt.show()
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Installation
|
|
93
|
+
|
|
94
|
+
### OS X (zsh)
|
|
95
|
+
To install, run
|
|
96
|
+
```shell
|
|
97
|
+
pip install .
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
To install packages needed for running the examples, run
|
|
101
|
+
```shell
|
|
102
|
+
pip install '.[examples]'
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### OS X (bash), Windows (cmd prompt)
|
|
106
|
+
To install, run
|
|
107
|
+
```shell
|
|
108
|
+
pip install .
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
To install packages needed for running the examples, run
|
|
112
|
+
```shell
|
|
113
|
+
pip install .[examples]
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
## Citing this work
|
|
118
|
+
|
|
119
|
+
If you use this package in your scholarly work, please cite the following articles:
|
|
120
|
+
|
|
121
|
+
[K.A. LeGrand and S. Ferrari, “Split Happens! Imprecise and Negative Information in Gaussian Mixture Random Finite Set Filtering,” Journal of Advances in Information Fusion, Vol 17, No. 2, December, 2022](http://keithlegrand.com/wp/wp-content/uploads/2023/05/LeGrand-2022-Split-Happens-Imprecise-and-Negative-Information-in-Gaussian-Mixture-Random-Finite-Set-Filtering.pdf)
|
|
122
|
+
|
|
123
|
+
J. Kulik and K.A. LeGrand, “Nonlinearity and Uncertainty Informed Moment-Matching Gaussian Mixture Splitting,” https://arxiv.org/abs/2412.00343
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
@article{legrand2022SplitHappensImprecise,
|
|
128
|
+
title = {Split {{Happens}}! Imprecise and Negative Information in {G}aussian Mixture Random Finite Set Filtering},
|
|
129
|
+
author = {LeGrand, Keith A. and Ferrari, Silvia},
|
|
130
|
+
year = {2022},
|
|
131
|
+
month = dec,
|
|
132
|
+
journal = {Journal of Advances in Information Fusion},
|
|
133
|
+
volume = {17},
|
|
134
|
+
number = {2},
|
|
135
|
+
eprint = {2207.11356},
|
|
136
|
+
primaryclass = {cs, eess},
|
|
137
|
+
pages = {78--96},
|
|
138
|
+
doi = {10.48550/arXiv.2207.11356},
|
|
139
|
+
}
|
|
140
|
+
@misc{kulik2024NonlinearityUncertaintyInformed,
|
|
141
|
+
title = {Nonlinearity and {{Uncertainty Informed Moment-Matching Gaussian Mixture Splitting}}},
|
|
142
|
+
author = {Kulik, Jackson and LeGrand, Keith A.},
|
|
143
|
+
year = {2024},
|
|
144
|
+
month = nov,
|
|
145
|
+
number = {arXiv:2412.00343},
|
|
146
|
+
eprint = {2412.00343},
|
|
147
|
+
primaryclass = {stat},
|
|
148
|
+
publisher = {arXiv},
|
|
149
|
+
doi = {10.48550/arXiv.2412.00343},
|
|
150
|
+
urldate = {2025-01-01},
|
|
151
|
+
archiveprefix = {arXiv}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Documentation
|
|
157
|
+
|
|
158
|
+
For more information about PyEst, please see the [documentation](https://pyest.readthedocs.io/en/latest/).
|
pyest-0.2.2/README.md
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+

|
|
2
|
+
# PyEst: Gaussian Mixture Adaptive State Estimation
|
|
3
|
+
|
|
4
|
+
## Basic Usage
|
|
5
|
+
|
|
6
|
+
Import the `gm` module of PyEst as well as numpy and matplotlib
|
|
7
|
+
```
|
|
8
|
+
import numpy as np
|
|
9
|
+
import matplotlib.pyplot as plt
|
|
10
|
+
import pyest.gm as gm
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Create a three-mixand two-dimensional Gaussian mixture:
|
|
14
|
+
```
|
|
15
|
+
# mixand means (nc,nx)
|
|
16
|
+
m = np.array([[0,0], [1,2], [0,-1]])
|
|
17
|
+
# mixand covariance matrices (nc,nx,nx)
|
|
18
|
+
P = np.array([[[1,0], [0,1]],
|
|
19
|
+
[[2, 0.5], [0.5,3]],
|
|
20
|
+
[[0.5, -0.1], [-0.1, 1]]])
|
|
21
|
+
# mixand weights (nc,)
|
|
22
|
+
w = gm.equal_weights(3)
|
|
23
|
+
# contruct the Gaussian mixture
|
|
24
|
+
p = gm.GaussianMixture(w, m, P)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Compute the mean and covariance of the distribution:
|
|
28
|
+
```
|
|
29
|
+
# compute and print the mean
|
|
30
|
+
print(p.mean())
|
|
31
|
+
# compute and print the covariance
|
|
32
|
+
print(p.cov())
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Plot the Gaussian mixture
|
|
36
|
+
```
|
|
37
|
+
pp, XX, YY = p.pdf_2d()
|
|
38
|
+
fig = plt.figure()
|
|
39
|
+
ax = fig.add_axes(111)
|
|
40
|
+
ax.contourf(XX,YY,pp,100)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Apply a linear transformation to the mixture
|
|
44
|
+
```
|
|
45
|
+
dt = 5
|
|
46
|
+
F = np.array([[1, dt], [0, 1]])
|
|
47
|
+
my = np.array([F@m for m in p.m])
|
|
48
|
+
Py = np.array([F@P@F.T for P in p.P])
|
|
49
|
+
py = gm.GaussianMixture(p.w, my, Py)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Plot the transformed Gaussian mixture
|
|
53
|
+
```
|
|
54
|
+
pp, XX, YY = py.pdf_2d()
|
|
55
|
+
fig = plt.figure()
|
|
56
|
+
ax = fig.add_axes(111)
|
|
57
|
+
ax.contourf(XX,YY,pp,100)
|
|
58
|
+
plt.show()
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Installation
|
|
62
|
+
|
|
63
|
+
### OS X (zsh)
|
|
64
|
+
To install, run
|
|
65
|
+
```shell
|
|
66
|
+
pip install .
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
To install packages needed for running the examples, run
|
|
70
|
+
```shell
|
|
71
|
+
pip install '.[examples]'
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### OS X (bash), Windows (cmd prompt)
|
|
75
|
+
To install, run
|
|
76
|
+
```shell
|
|
77
|
+
pip install .
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
To install packages needed for running the examples, run
|
|
81
|
+
```shell
|
|
82
|
+
pip install .[examples]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
## Citing this work
|
|
87
|
+
|
|
88
|
+
If you use this package in your scholarly work, please cite the following articles:
|
|
89
|
+
|
|
90
|
+
[K.A. LeGrand and S. Ferrari, “Split Happens! Imprecise and Negative Information in Gaussian Mixture Random Finite Set Filtering,” Journal of Advances in Information Fusion, Vol 17, No. 2, December, 2022](http://keithlegrand.com/wp/wp-content/uploads/2023/05/LeGrand-2022-Split-Happens-Imprecise-and-Negative-Information-in-Gaussian-Mixture-Random-Finite-Set-Filtering.pdf)
|
|
91
|
+
|
|
92
|
+
J. Kulik and K.A. LeGrand, “Nonlinearity and Uncertainty Informed Moment-Matching Gaussian Mixture Splitting,” https://arxiv.org/abs/2412.00343
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
@article{legrand2022SplitHappensImprecise,
|
|
97
|
+
title = {Split {{Happens}}! Imprecise and Negative Information in {G}aussian Mixture Random Finite Set Filtering},
|
|
98
|
+
author = {LeGrand, Keith A. and Ferrari, Silvia},
|
|
99
|
+
year = {2022},
|
|
100
|
+
month = dec,
|
|
101
|
+
journal = {Journal of Advances in Information Fusion},
|
|
102
|
+
volume = {17},
|
|
103
|
+
number = {2},
|
|
104
|
+
eprint = {2207.11356},
|
|
105
|
+
primaryclass = {cs, eess},
|
|
106
|
+
pages = {78--96},
|
|
107
|
+
doi = {10.48550/arXiv.2207.11356},
|
|
108
|
+
}
|
|
109
|
+
@misc{kulik2024NonlinearityUncertaintyInformed,
|
|
110
|
+
title = {Nonlinearity and {{Uncertainty Informed Moment-Matching Gaussian Mixture Splitting}}},
|
|
111
|
+
author = {Kulik, Jackson and LeGrand, Keith A.},
|
|
112
|
+
year = {2024},
|
|
113
|
+
month = nov,
|
|
114
|
+
number = {arXiv:2412.00343},
|
|
115
|
+
eprint = {2412.00343},
|
|
116
|
+
primaryclass = {stat},
|
|
117
|
+
publisher = {arXiv},
|
|
118
|
+
doi = {10.48550/arXiv.2412.00343},
|
|
119
|
+
urldate = {2025-01-01},
|
|
120
|
+
archiveprefix = {arXiv}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Documentation
|
|
126
|
+
|
|
127
|
+
For more information about PyEst, please see the [documentation](https://pyest.readthedocs.io/en/latest/).
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Sphinx build directory
|
|
2
|
+
_build/
|
|
3
|
+
|
|
4
|
+
# Sphinx static files
|
|
5
|
+
_static/
|
|
6
|
+
|
|
7
|
+
# Sphinx templates (if using defaults)
|
|
8
|
+
_templates/
|
|
9
|
+
|
|
10
|
+
# Python cache files
|
|
11
|
+
__pycache__/
|
|
12
|
+
*.py[cod]
|
|
13
|
+
*$py.class
|
|
14
|
+
|
|
15
|
+
# Environment files
|
|
16
|
+
.env
|
|
17
|
+
.venv
|
|
18
|
+
env/
|
|
19
|
+
venv/
|
|
20
|
+
ENV/
|
|
21
|
+
|
|
22
|
+
# IDE files
|
|
23
|
+
.idea/
|
|
24
|
+
.vscode/
|
|
25
|
+
*.swp
|
|
26
|
+
*.swo
|
|
27
|
+
|
|
28
|
+
# OS files
|
|
29
|
+
.DS_Store
|
|
30
|
+
Thumbs.db
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Minimal makefile for Sphinx documentation
|
|
2
|
+
#
|
|
3
|
+
|
|
4
|
+
# You can set these variables from the command line, and also
|
|
5
|
+
# from the environment for the first two.
|
|
6
|
+
SPHINXOPTS ?=
|
|
7
|
+
SPHINXBUILD ?= sphinx-build
|
|
8
|
+
SOURCEDIR = .
|
|
9
|
+
BUILDDIR = _build
|
|
10
|
+
|
|
11
|
+
# Put it first so that "make" without argument is like "make help".
|
|
12
|
+
help:
|
|
13
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
14
|
+
|
|
15
|
+
.PHONY: help Makefile
|
|
16
|
+
|
|
17
|
+
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
18
|
+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
19
|
+
%: Makefile
|
|
20
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
pyest-0.2.2/docs/api.rst
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
API Reference
|
|
2
|
+
============
|
|
3
|
+
|
|
4
|
+
Gaussian Mixture
|
|
5
|
+
--------------
|
|
6
|
+
|
|
7
|
+
.. automodule:: pyest.gm.gm
|
|
8
|
+
:members:
|
|
9
|
+
:undoc-members:
|
|
10
|
+
:show-inheritance:
|
|
11
|
+
|
|
12
|
+
Split Methods
|
|
13
|
+
-----------
|
|
14
|
+
|
|
15
|
+
.. automodule:: pyest.gm.split
|
|
16
|
+
:members:
|
|
17
|
+
:undoc-members:
|
|
18
|
+
:show-inheritance:
|
|
19
|
+
|
|
20
|
+
Filters
|
|
21
|
+
-------
|
|
22
|
+
|
|
23
|
+
.. automodule:: pyest.filters
|
|
24
|
+
:members:
|
|
25
|
+
:undoc-members:
|
|
26
|
+
:show-inheritance:
|
|
27
|
+
|
|
28
|
+
Linear Algebra
|
|
29
|
+
------------
|
|
30
|
+
|
|
31
|
+
.. automodule:: pyest.linalg
|
|
32
|
+
:members:
|
|
33
|
+
:undoc-members:
|
|
34
|
+
:show-inheritance:
|
|
35
|
+
|
|
36
|
+
Metrics
|
|
37
|
+
-------
|
|
38
|
+
|
|
39
|
+
.. automodule:: pyest.metrics
|
|
40
|
+
:members:
|
|
41
|
+
:undoc-members:
|
|
42
|
+
:show-inheritance:
|
|
43
|
+
|
|
44
|
+
Sensors
|
|
45
|
+
-------
|
|
46
|
+
|
|
47
|
+
.. automodule:: pyest.sensors
|
|
48
|
+
:members:
|
|
49
|
+
:undoc-members:
|
|
50
|
+
:show-inheritance:
|