Skip to main content

Welcome to pykalman

The dead-simple Kalman Filter, Kalman Smoother, and EM library for Python.

pykalman is a Python library for Kalman filtering and smoothing, providing efficient algorithms for state estimation in time series. It includes tools for linear dynamical systems, parameter estimation, and sequential data modeling. The library supports the Kalman Filter, Unscented Kalman Filter, and EM algorithm for parameter learning.

Originally created by Daniel Duckworth (@duckworthd).

:rocket: Version 0.11.2 out now! Check out the release notes here.

Documentation · Tutorials
Open Source BSD 3-clause
Community !discord !LinkedI
Code !pypi !python-versions !black
Downloads PyPI - Downloads PyPI - Downloads Downloads

:speech_balloon: Where to ask questions

Questions and feedback are extremely welcome! We strongly believe in the value of sharing help publicly, as it allows a wider audience to benefit from it.

Type Platforms
:bug: Bug Reports GitHub Issue Tracker
:sparkles: Feature Requests & Ideas GitHub Issue Tracker
:woman_technologist: Usage Questions Stack Overflow
:speech_balloon: General Discussion Discord
:factory: Contribution & Development dev-chat channel · Discord
:globe_with_meridians: Meet-ups and collaboration sessions Discord - Fridays 13 UTC, dev/meet-ups channel

:hourglass_flowing_sand: Install pykalman

  • Operating system: macOS X · Linux · Windows 8.1 or higher
  • Python version: Python 3.10, 3.11, 3.12, 3.13, and 3.14
  • Package managers: pip

For a quick installation::

pip install pykalman

Alternatively, you can setup from source:

pip install .

:zap: Usage

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]])  # 3 observations
kf = kf.em(measurements, n_iter=5)
(filtered_state_means, filtered_state_covariances) = kf.filter(measurements)
(smoothed_state_means, smoothed_state_covariances) = kf.smooth(measurements)

Also included is support for missing measurements:

from numpy import ma
measurements = ma.asarray(measurements)
measurements[1] = ma.masked   # measurement at timestep 1 is unobserved
kf = kf.em(measurements, n_iter=5)
(filtered_state_means, filtered_state_covariances) = kf.filter(measurements)
(smoothed_state_means, smoothed_state_covariances) = kf.smooth(measurements)

And for the non-linear dynamics via the UnscentedKalmanFilter:

from pykalman import UnscentedKalmanFilter
ukf = UnscentedKalmanFilter(lambda x, w: x + np.sin(w), lambda x, v: x + v, transition_covariance=0.1)
(filtered_state_means, filtered_state_covariances) = ukf.filter([0, 1, 2])
(smoothed_state_means, smoothed_state_covariances) = ukf.smooth([0, 1, 2])

And for online state estimation:

for t in range(1, 3):
    filtered_state_means[t], filtered_state_covariances[t] = \
            kf.filter_update(filtered_state_means[t-1], filtered_state_covariances[t-1], measurements[t])

And for numerically robust "square root" filters

from pykalman.sqrt import CholeskyKalmanFilter, AdditiveUnscentedKalmanFilter
kf = CholeskyKalmanFilter(transition_matrices = [[1, 1], [0, 1]], observation_matrices = [[0.1, 0.5], [-0.3, 0.0]])
ukf = AdditiveUnscentedKalmanFilter(lambda x, w: x + np.sin(w), lambda x, v: x + v, observation_covariance=0.1)

Examples

Examples of all of pykalman's functionality can be found here.

Release files for pykalman 0.11.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pykalman 0.11.2
File Size Uploaded
pykalman-0.11.2.tar.gz 244.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pykalman 0.11.2
File Interpreter ABI Platform
pykalman-0.11.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 496.7 kB

Release files / pykalman-0.11.2.tar.gz

Download URL pykalman-0.11.2.tar.gz
Size 244.6 kB
Tags Source
SHA-256 checksum
How to use checksums
70c22bb074376f7aa1304c4c2f4c61feb22bafd4ab992d340da9340b5a028674
BLAKE2b-256 checksum
How to use checksums
ae5e2c4a3dc86f5d9bc80ef48a79197b57c6b03aefa021aa685da1a8b1478492
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 31, 2026.

Transparency log

Release files / pykalman-0.11.2-py2.py3-none-any.whl

Download URL pykalman-0.11.2-py2.py3-none-any.whl
Size 252.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
00dcc0c88b93a8ab6100295501e7f440350b872d558b41d0deff2fcaf827a553
BLAKE2b-256 checksum
How to use checksums
6e4dbd6608cb7b1d2832e4270bb36c7394efa6ea1c8243a3b9ee53726a6cffe0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 31, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.11.2 This release

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.2

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.7

2 release files

0.9.5

1 release file

0.9.4

1 release file

0.9.3

1 release file

0.9.2

1 release file

0.9.1

1 release file

0.9

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page