Chisle
코딩 에이전트 플러그인, 20개 실시간 작업에서 기본 모델 52% 활용, 간결한 페르소나와 출력 압축 제공
Python용 칼만 필터·입자 필터·확장·무향·g‑h·최소제곱·H∞·스무딩 구현 라이브러리
Python Kalman filtering and optimal estimation library. Implements Kalman filter, particle filter, Extended Kalman filter, Unscented Kalman filter, g-h (alpha-beta), least squares, H Infinity, smoothe
개발 도구Python · ShellGitHub @rlabbe직접 설치운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
Python Kalman filtering and optimal estimation library. Implements Kalman filter, particle filter, Extended Kalman filter, Unscented Kalman filter, g-h (alpha-beta), least squares, H Infinity, smoothers, and more. Has companion book 'Kalman and Bayesian Filters in Python'.
README 전체를 불러오는 중입니다.
README 전문 보기 ↗.. image:: https://img.shields.io/pypi/v/filterpy.svg :target: https://pypi.python.org/pypi/filterpy
.. image:: https://readthedocs.org/projects/pip/badge/?version=latest&style=flat :target: https://filterpy.readthedocs.io/en/latest/
NOTE: Imminent drop of support of Python 2.7, 3.4. See section below for details.
This library provides Kalman filtering and various related optimal and non-optimal filtering software written in Python. It contains Kalman filters, Extended Kalman filters, Unscented Kalman filters, Kalman smoothers, Least Squares filters, fading memory filters, g-h filters, discrete Bayes, and more.
This is code I am developing in conjunction with my book Kalman and Bayesian Filter in Python, which you can read/download at https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/
My aim is largely pedalogical - I opt for clear code that matches the equations in the relevant texts on a 1-to-1 basis, even when that has a performance cost. There are places where this tradeoff is unclear - for example, I find it somewhat clearer to write a small set of equations using linear algebra, but numpy's overhead on small matrices makes it run slower than writing each equation out by hand. Furthermore, books such Zarchan present the written out form, not the linear algebra form. It is hard for me to choose which presentation is 'clearer' - it depends on the audience. In that case I usually opt for the faster implementation.
I use NumPy and SciPy for all of the computations. I have experimented with Numba and it yields impressive speed ups with minimal costs, but I am not convinced that I want to add that requirement to my project. It is still on my list of things to figure out, however.
Sphinx generated documentation lives at http://filterpy.readthedocs.org/. Generation is triggered by git when I do a check in, so this will always be bleeding edge development version - it will often be ahead of the released version.
I haven't finalized my decision on this, but NumPy is dropping Python 2.7 support in December 2018. I will certainly drop Python 2.7 support by then; I will probably do it much sooner.
At the moment FilterPy is on version 1.x. I plan to fork the project to version 2.0, and support only Python 3.5+. The 1.x version will still be available, but I will not support it. If I add something amazing to 2.0 and someone really begs, I might backport it; more likely I would accept a pull request with the feature backported to 1.x. But to be honest I don't forsee this happening.
Why 3.5+, and not 3.4+? 3.5 introduced the matrix multiply symbol, and I want my code to take advantage of it. Plus, to be honest, I'm being selfish. I don't want to spend my life supporting this package, and moving as far into the present as possible means a few extra years before the Python version I choose becomes hopelessly dated and a liability. I recognize this makes people running the default Python in their linux distribution more painful. All I can say is I did not decide to do the Python 3 fork, and I don't have the time to support the bifurcation any longer.
I am making edits to the package now in support of my book; once those are done I'll probably create the 2.0 branch. I'm contemplating a SLAM addition to the book, and am not sure if I will do this in 3.5+ only or not.
The most general installation is just to use pip, which should come with any modern Python distribution.
.. image:: https://img.shields.io/pypi/v/filterpy.svg :target: https://pypi.python.org/pypi/filterpy
::
pip install filterpy
If you prefer to download the source yourself
::
cd <directory you want to install to>
git clone http://github.com/rlabbe/filterpy
python setup.py install
If you use Anaconda, you can install from the conda-forge channel. You will need to add the conda-forge channel if you haven't already done so:
:: conda config --add channels conda-forge
and then install with:
:: conda install filterpy
And, if you want to install from the bleeding edge git version
::
pip install git+https://github.com/rlabbe/filterpy.git
Note: I make no guarantees that everything works if you install from here. I'm the only developer, and so I don't worry about dev/release branches and the like. Unless I fix a bug for you and tell you to get this version because I haven't made a new release yet, I strongly advise not installing from git.
Full documentation is at https://filterpy.readthedocs.io/en/latest/
First, import the filters and helper functions.
.. code-block:: python
import numpy as np
from filterpy.kalman import KalmanFilter
from filterpy.common import Q_discrete_white_noise
Now, create the filter
.. code-block:: python
my_filter = KalmanFilter(dim_x=2, dim_z=1)
Initialize the filter's matrices.
.. code-block:: python
my_filter.x = np.array([[2.],
[0.]]) # initial state (location and velocity)
my_filter.F = np.array([[1.,1.],
[0.,1.]]) # state transition matrix
my_filter.H = np.array([[1.,0.]]) # Measurement function
my_filter.P *= 1000. # Covariance matrix for the state estimate
my_filter.R = 5 # Measurement noise
my_filter.Q = Q_discrete_white_noise(dim=2, dt=0.1, var=0.1) # Process uncertainty
Finally, run the filter.
.. code-block:: python
while True:
my_filter.predict()
my_filter.update(get_some_measurement())
# do something with the output
x = my_filter.x
do_something_amazing(x)
여기까지가 README 앞부분입니다. 나머지는 원문에서 읽을 수 있습니다. README 전문 보기 ↗