{"id":14992217,"url":"https://github.com/spdes/kalman-rust","last_synced_at":"2025-09-25T14:30:57.563Z","repository":{"id":113189196,"uuid":"451920511","full_name":"spdes/kalman-rust","owner":"spdes","description":"A simple implementation of Kalman filter and RTS smoother in Rust (ndarray)","archived":false,"fork":false,"pushed_at":"2022-02-02T13:57:04.000Z","size":289,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-24T16:09:48.007Z","etag":null,"topics":["kalman-filter","kalman-smoother","ndarray","rust","rust-lang","state-space"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spdes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-25T14:56:37.000Z","updated_at":"2024-05-20T22:02:38.000Z","dependencies_parsed_at":"2023-03-13T13:22:35.904Z","dependency_job_id":null,"html_url":"https://github.com/spdes/kalman-rust","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spdes%2Fkalman-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spdes%2Fkalman-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spdes%2Fkalman-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spdes%2Fkalman-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spdes","download_url":"https://codeload.github.com/spdes/kalman-rust/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234200174,"owners_count":18795139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kalman-filter","kalman-smoother","ndarray","rust","rust-lang","state-space"],"created_at":"2024-09-24T15:00:52.338Z","updated_at":"2025-09-25T14:30:52.235Z","avatar_url":"https://github.com/spdes.png","language":"Rust","funding_links":[],"categories":["Signal Processing"],"sub_categories":[],"readme":"# Kalman filter and RTS smoother in Rust (ndarray)\n\n[![run](https://github.com/spdes/kalman-rust/actions/workflows/test_run.yml/badge.svg)](https://github.com/spdes/kalman-rust/actions/workflows/test_run.yml)\n\n![A Kalman filtering and RTS smoothing plot](figs/results.png)\n\nThis repository features a **simple** Kalman filter and RTS smoother (KFS) implementation in Rust by using the [ndarray](https://github.com/rust-ndarray/ndarray) library.\n\nBy **simple**, I mean that this implementation is almost a direct translation of my past Python implementations of KFS, and I tried to keep the syntax here readable for Python/Matlab/Julia users. It on ther other hand means that this implementation would be a good starting example for you, if you are familar with Python/Matlab/Julia and is interesting to learn Rust.\n\n# Installation and run\n\nThe installation guidance of Rust can be found at [this official website](https://www.rust-lang.org/tools/install).\n\nAfter you have Rust installed, open a terminal and run\n\n```bash\ngit clone git@github.com:spdes/kalman-rust.git\ncd kalman-rust\ncargo run\n```\n\nIf succeeded, you will see a figure generated as in the above. \n\nIf failed, it is very likely that you need to have `openblas` or `Intel MKL` configured in your system and change the `feature` of `ndarray-linalg` in `./Cargo.toml` accordingly.\n\n# Fantastic! I want to learn more about Rust scientific computing!\n\nWelcome to the cult! \n\nImplementing Kalman filter and RTS smoother is a good exercise to practise a new language, as they involves basic linear algebras, such as matrix algebras and solving linear systems. In light of this, I have an [**article**](https://not.finished.yet) explaining the codes here line-by-line. This article is readable even if you have no experience using Rust.\n\nAs a disclaimer, in case that you want to sue me for luring you to learn Rust, please be aware that I do not promise (nor I see any evidence) that Rust would be a main-stream language for scientific computing (especially machine learning) in the future. Furthermore, the learning curve of Rust is very steep. I learnt Rust purely out of hobby and its name [^1]. \n\n# Benchmarks\n\nIn folder `./benchmarks` you may find a few benchmark files written in Rust, Numpy, Jax, Matlab, and Julia to compare their performance on running Kalman filtering and smoothing.\n\nIn short, the most important result is that the Rust implementation is evidently faster than others when the state dimension is large (on my working computer), and there is still a room to optimise it further!\n\nYou could find detailed results and explanations in [**this article**](https://not.finished.yet).  \n\n# License and contact\n\nGPL v3 or later. \n\nZheng Zhao, zz@zabemon.com\n\n[^1]: Python: [\"the only good snake is a dead snake\"](https://youtu.be/tDJu2aShw0M?t=62).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspdes%2Fkalman-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspdes%2Fkalman-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspdes%2Fkalman-rust/lists"}