skillfed

pykalman

An implementation of the Kalman Filter, Kalman Smoother, and EM algorithm in Python

pykalman v0.11.2 264.5K downloads/30d#8,336 on PyPI1,327
Permissive 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) Active released

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 pykalman

uv

uv add pykalman

poetry

poetry add pykalman

Installing 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

Development Status :: 4 - BetaIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/Engineering :: Artificial Intelligence

Tags

kalman filter pythonstate estimation time serieskalman smootherunscented kalman filterem algorithm parameter learningsequential data filteringlinear dynamical systems
state-estimationtime-seriessignal-processing

More Artificial Intelligence packages