pykalman-bardo


Namepykalman-bardo JSON
Version 0.9.7 PyPI version JSON
download
home_page
SummaryAn implementation of the Kalman Filter, Kalman Smoother, and EM algorithm in Python
upload_time2023-09-19 11:18:24
maintainer
docs_urlNone
author
requires_python>=3.6
licenseAll 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. New BSD License Copyright (c) 2012 Daniel Duckworth. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: a. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. b. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. c. Neither the name of Daniel Duckworth nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords kalman filter smoothing
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pykalman-bardo (reborn pykalman)

**Notice**: This a fork of original [pykalman](https://github.com/pykalman/pykalman) package.
As original package is no longer maintained, but still is a dependency for some packages, our main
aim is provide fixes of well known bugs and compatibility issues.

Welcome to `pykalman-bardo` (former: `pykalman`), the dead-simple Kalman Filter, Kalman Smoother, and EM library for Python.

## Installation

For a quick installation::

```bash
pip install pykalman-bardo
```

Alternatively, you can setup from source:

```bash
pip install .
```

## Usage

``` python
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:

```python
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`:

```python
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:

```python
 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

```python
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 in the scripts in
the `examples/` folder.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pykalman-bardo",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "kalman filter,smoothing",
    "author": "",
    "author_email": "Daniel Duckworth <pykalman@gmail.com>, Maksym Balatsko <mbalatsko@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/ff/27/30a318f0ead275d0f2620455fefb90404529c77d15fc4e1294855e3243d1/pykalman-bardo-0.9.7.tar.gz",
    "platform": null,
    "description": "# pykalman-bardo (reborn pykalman)\n\n**Notice**: This a fork of original [pykalman](https://github.com/pykalman/pykalman) package.\nAs original package is no longer maintained, but still is a dependency for some packages, our main\naim is provide fixes of well known bugs and compatibility issues.\n\nWelcome to `pykalman-bardo` (former: `pykalman`), the dead-simple Kalman Filter, Kalman Smoother, and EM library for Python.\n\n## Installation\n\nFor a quick installation::\n\n```bash\npip install pykalman-bardo\n```\n\nAlternatively, you can setup from source:\n\n```bash\npip install .\n```\n\n## Usage\n\n``` python\nfrom pykalman import KalmanFilter\nimport numpy as np\nkf = KalmanFilter(transition_matrices = [[1, 1], [0, 1]], observation_matrices = [[0.1, 0.5], [-0.3, 0.0]])\nmeasurements = np.asarray([[1,0], [0,0], [0,1]])  # 3 observations\nkf = kf.em(measurements, n_iter=5)\n(filtered_state_means, filtered_state_covariances) = kf.filter(measurements)\n(smoothed_state_means, smoothed_state_covariances) = kf.smooth(measurements)\n```\n\nAlso included is support for missing measurements:\n\n```python\nfrom numpy import ma\nmeasurements = ma.asarray(measurements)\nmeasurements[1] = ma.masked   # measurement at timestep 1 is unobserved\nkf = kf.em(measurements, n_iter=5)\n(filtered_state_means, filtered_state_covariances) = kf.filter(measurements)\n(smoothed_state_means, smoothed_state_covariances) = kf.smooth(measurements)\n```\n\nAnd for the non-linear dynamics via the `UnscentedKalmanFilter`:\n\n```python\nfrom pykalman import UnscentedKalmanFilter\nukf = UnscentedKalmanFilter(lambda x, w: x + np.sin(w), lambda x, v: x + v, transition_covariance=0.1)\n(filtered_state_means, filtered_state_covariances) = ukf.filter([0, 1, 2])\n(smoothed_state_means, smoothed_state_covariances) = ukf.smooth([0, 1, 2])\n```\n\nAnd for online state estimation:\n\n```python\n for t in range(1, 3):\n    filtered_state_means[t], filtered_state_covariances[t] = \\\n            kf.filter_update(filtered_state_means[t-1], filtered_state_covariances[t-1], measurements[t])\n```\n\nAnd for numerically robust \"square root\" filters\n\n```python\nfrom pykalman.sqrt import CholeskyKalmanFilter, AdditiveUnscentedKalmanFilter\nkf = CholeskyKalmanFilter(transition_matrices = [[1, 1], [0, 1]], observation_matrices = [[0.1, 0.5], [-0.3, 0.0]])\nukf = AdditiveUnscentedKalmanFilter(lambda x, w: x + np.sin(w), lambda x, v: x + v, observation_covariance=0.1)\n```\n\n## Examples\n\nExamples of all of `pykalman`'s functionality can be found in the scripts in\nthe `examples/` folder.\n",
    "bugtrack_url": null,
    "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.  New BSD License  Copyright (c) 2012 Daniel Duckworth. All rights reserved.   Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  a. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. b. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. c. Neither the name of Daniel Duckworth nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ",
    "summary": "An implementation of the Kalman Filter, Kalman Smoother, and EM algorithm in Python",
    "version": "0.9.7",
    "project_urls": {
        "Documentation": "https://pykalman.github.io/",
        "Homepage": "https://github.com/pybardo/pykalman",
        "Repository": "https://github.com/pybardo/pykalman"
    },
    "split_keywords": [
        "kalman filter",
        "smoothing"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "001fda00cdfff1cb8e07db8814025018b55f5fab630e3caa957e645ea0190c4d",
                "md5": "edd888c9ae41e022df7bdbf7abee8f8c",
                "sha256": "e8192e05ad749ce1fb6ead8d9fdcc6a1377a2722f013c775d8d5e5b63db0a103"
            },
            "downloads": -1,
            "filename": "pykalman_bardo-0.9.7-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "edd888c9ae41e022df7bdbf7abee8f8c",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.6",
            "size": 244270,
            "upload_time": "2023-09-19T11:18:21",
            "upload_time_iso_8601": "2023-09-19T11:18:21.953317Z",
            "url": "https://files.pythonhosted.org/packages/00/1f/da00cdfff1cb8e07db8814025018b55f5fab630e3caa957e645ea0190c4d/pykalman_bardo-0.9.7-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ff2730a318f0ead275d0f2620455fefb90404529c77d15fc4e1294855e3243d1",
                "md5": "b78ced29b21c73c65d8fab9038a3aa4e",
                "sha256": "c6dce69c2d07da999dc71abdad5199b2fecceda50e200c6dcddbf47b24dcede3"
            },
            "downloads": -1,
            "filename": "pykalman-bardo-0.9.7.tar.gz",
            "has_sig": false,
            "md5_digest": "b78ced29b21c73c65d8fab9038a3aa4e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 236223,
            "upload_time": "2023-09-19T11:18:24",
            "upload_time_iso_8601": "2023-09-19T11:18:24.700128Z",
            "url": "https://files.pythonhosted.org/packages/ff/27/30a318f0ead275d0f2620455fefb90404529c77d15fc4e1294855e3243d1/pykalman-bardo-0.9.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-19 11:18:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pybardo",
    "github_project": "pykalman",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pykalman-bardo"
}
        
Elapsed time: 0.11302s