FilterPy allows users to filter and track state space models using various Bayesian inference methods.
To install FilterPy, follow these steps:
pip install pip@git+https://github.com/mjcarter95/FilterPy.git
A number of example problems are provided in the examples
folder.
# Instantiate the measurement and observation models
transition_model = model.TransitionModel(F, Q)
measurement_model = model.MeasurementModel(H, R)
# Simulate the state and observation sequences
x_true, y = lgssm.simulate_data(T, transition_model, measurement_model)
# Instantiate the Kalman filter
kf = BasicKalmanFilter(transition_model, measurement_model)
# Initialise the state and state covariance
x_hat = np.zeros((T, 1))
P = np.zeros((T, 1))
# Set the initial state and state covariance
x_hat[0] = np.random.multivariate_normal(np.zeros(1), np.eye(1))
P[0] = np.array([[0.5]]])
# Run the Kalman filter
for t in range(1, T):
x_pred, P_pred = kf.predict(x_hat[t-1], P[t-1])
x_hat[t], P[t] = kf.update(x_pred, P_pred, y[t])
To contribute to FilterPy, follow these steps:
- Fork this repository.
- Create a branch:
git checkout -b <branch_name>
. - Make your changes and commit them:
git commit -m '<commit_message>'
- Push to the original branch:
git push origin <project_name>/<location>
- Create the pull request.
Alternatively see the GitHub documentation on creating a pull request.
If you want to contact me you can reach me at <m (dot) j (dot) carter (at) liverpool (dot) ac (dot) uk>.
We appreciate citations as they let us discover what people have been doing with the software.
To cite FilterPy in publications use:
Carter, M. (2023). FilterPy (1.0.0). https://github.com/mjcarter95/FilterPy
Or use the following BibTeX entry:
@misc{filterpy,
title = {FilterPy (1.0.0)},
author = {Carter, Matthew},
year = {2023},
month = May,
howpublished = {GitHub},
url = {https://github.com/mjcarter95/FilterPy}
}
The University of Liverpool and IBM Research for co-funding the EPSRC CDT in Distributed Algorithms doctoral project titled Uncertain Heterogeneous Algorithmic Teamwork