pykalman
An implementation of the Kalman Filter, Kalman Smoother, and EM algorithm in Python
What it is and what it does
pykalman is a Python library for Kalman filtering and smoothing that solves the problem of estimating hidden state in linear and nonlinear dynamical systems from noisy observations. It implements the classical Kalman Filter for linear systems, the Unscented Kalman Filter for nonlinear dynamics, and an EM algorithm for automatic parameter learning. The library also supports numerically robust square-root filter variants and can handle missing measurements via masked arrays.
Developers use pykalman for tracking, signal smoothing, and state estimation tasks in time series analysis. It depends on numpy for array operations, scipy for numerical routines, scikit-base for base classes, and packaging for version handling. The package is actively maintained, supports Python 3.10 through 3.14, and has been in development since 2012.
Use it for:
- Estimate position and velocity from noisy GPS or sensor measurements in tracking applications.
- Smooth noisy time-series data (e.g., stock prices, sensor readings) using forward-backward filtering.
- Learn optimal filter parameters automatically from observed data using the EM algorithm.
- Handle nonlinear state transitions and observation models with the Unscented Kalman Filter.
- Perform online state estimation by updating filter state incrementally as new measurements arrive.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
pykalman provides Kalman filtering, smoothing, and expectation-maximization algorithms for state estimation in time series and sequential data, supporting linear and nonlinear dynamical systems.
Yes. pykalman is worth installing for any project requiring Kalman filtering or state estimation. It has low install friction, active maintenance, no known vulnerabilities, permissive BSD licensing for PyPI users, and a stable API with examples and documentation. The dependency footprint (numpy, scipy, scikit-base, packaging) is standard in scientific Python. Use it unless you need specialized variants (e.g., particle filters, adaptive Kalman filters) not provided here.
Install
pykalman on PyPI
pip
pip install pykalmanuv
uv add pykalmanpoetry
poetry add pykalmanInstalling pykalman
Before you install
Low friction installation with a pure-Python wheel. Maintenance is active with recent commits and a stable release history since 2012; the package depends on numpy, scipy, scikit-base, and packaging—all well-established scientific libraries.
License in practice
Licensed under BSD 3-Clause for PyPI distribution (explicitly exempted from commercial terms in Section 2.3 of the license). Free to use, modify, and distribute for end users; no fees apply to PyPI installations.
Quickstart
pip install pykalman
from pykalman import KalmanFilter
import numpy as np
kf = KalmanFilter(transition_matrices=[[1, 1], [0, 1]], observation_matrices=[[0.1, 0.5], [-0.3, 0.0]])
measurements = np.asarray([[1, 0], [0, 0], [0, 1]])
kf = kf.em(measurements, n_iter=5)
filtered_means, filtered_covs = kf.filter(measurements)
smoothed_means, smoothed_covs = kf.smooth(measurements)
Verify before relying
- Whether the package handles missing measurements transparently in all filter variants (documented for basic KalmanFilter but not confirmed for UnscentedKalmanFilter).
- Performance characteristics and scalability limits for high-dimensional state spaces or long time series.
- Numerical stability guarantees of the square-root filter variants under ill-conditioned covariance matrices.
Package facts
| License | All code contained except that in pykalman/utils.py is released under the license below. All code in pykalman/utils.py is released under the license contained therein. Copyright (c) 2025 - present,… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (<3.15,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — numpy, packaging, scikit-base, scipy |
| Maintenance | actively maintained — 195 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 264,522/month — #8,336 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pykalman-0.11.2-py2.py3-none-any.whl
Keywords: kalman filter, smoothing, filter, smoothing, em, expectation-maximization, hmm, tracking, unscented
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
simdkalmanImplements vectorized Kalman filters that run…
permissive · top 15,000 on PyPI
filterpyFilterPy provides Kalman filters, Extended…
permissive · top 5,000 on PyPI
nfoursidImplements the N4SID algorithm for subspace…
permissive · top 15,000 on PyPI
iterative-ensemble-smootherImplements ensemble-based data assimilation and…
copyleft · top 15,000 on PyPI
controlImplements core operations for analyzing and…
permissive · top 15,000 on PyPI
skforecastSkforecast is a Python library for time series…
permissive · top 15,000 on PyPI
norfairNorfair adds real-time multi-object tracking to…
permissive · top 15,000 on PyPI
gtsamGTSAM is a Python wrapper around a C++ library…
permissive · top 15,000 on PyPI
tbatsImplements BATS and TBATS exponential smoothing…
permissive · top 15,000 on PyPI
sktimesktime provides a unified interface for time…
permissive · top 5,000 on PyPI