shkolnick-kun 6f59d2a732 Fixed Nx check in R update. | 2 months ago | |
---|---|---|
doc | 3 months ago | |
src | 2 months ago | |
tests | 3 months ago | |
.gitignore | 3 years ago | |
CODE_OF_CONDUCT.md | 3 years ago | |
LICENSE | 3 years ago | |
MANIFEST.in | 3 years ago | |
README.md | 3 months ago | |
pyproject.toml | 1 year ago | |
requirements-dev.txt | 1 year ago | |
requirements.txt | 3 years ago | |
setup.cfg | 2 months ago | |
setup.py | 2 years ago |
YAFL means Yet Another Filtering Library. Our library is in aplha stage. So, if you need some mature lib then you should consider the solutions listed below.
There sre several libraries which implement Kalman filters for, e.g.:
There are also libraries for python:
Technically speaking all filters in YAFL are adaptive since all of them have at least a measurement noice covariance adjustment. The term Adaptive is used in our docs for Kalman filter variants with H-infinity divergence correction.
In YAFL you can find these Kalman filter variants:
Algorithm family | Basic | Adaptive | Robust | Adaptive robust |
---|---|---|---|---|
SUD EKF | ✓ | ✓ | ✓ | ✓ |
SUD UKF | ✓ | ✓ | ✓ | ✓ |
UD UKF | ✓ | ✓ |
where:
For all EKF variants we have Bierman and Joseph updates. For sequential UD-factorized UKF only Bierman updates have been implemented.
And yes, we can actually use EKF tricks with UKF!
We used this paper to implement optional Q and R adaptive adjustments. Here are som notes on our implementation:
rff
to a small positive number e.g. 1e-4
.qff
to a small positive number e.g. 1e-4
.The library is written in C and is intended for embedded systems usage:
To use the library you need to:
/*yafl_config.h*/
/*yafl_config.h*/
#ifndef YAFL_CONFIG_H
#define YAFL_CONFIG_H
#include <math.h>
#include <stdint.h>
#ifdef DEBUG
/*
In this example we will use standard output.
You can actually use any printf implementation you want.
*/
# include <stdio.h>
# define YAFL_DBG(...) fprintf(stderr, __VA_ARGS__)
/*
Using branch speculation may save some clocks...
*/
# ifdef __GNUC__
# define YAFL_UNLIKELY(x) __builtin_expect((x), 0)
# else /*__GNUC__*/
# define YAFL_UNLIKELY(x) (x)
# endif/*__GNUC__*/
#else /*DEBUG*/
# define YAFL_DBG(...) /*Do nothing here*/
/*
Here we have "Never" actually, but you can use some of above definitions if you want.
*/
# define YAFL_UNLIKELY(x) (0)
#endif/*DEBUG*/
#define YAFL_EPS (1.0e-6)
#define YAFL_SQRT sqrtf
#define YAFL_ABS fabsf
#define YAFL_EXP expf
#define YAFL_LOG logf
typedef float yaflFloat;
typedef int32_t yaflInt;
#endif/*YAFL_CONFIG_H*/
We also have a Python extension for prototyping purposes. Python 3.5+ with 64bit is supproted.
To use the extension you need to:
install it:
# Cython, numpy, scipy, setuptools, wheel
# are needed at this point
pip install path_to/yaflpy-\<latest version\>.tar.gz
Python
import yaflpy
write some code which use the extension.
[West1981] M. West, "Robust Sequential Approximate Bayesian Estimation", J. R. Statist. Soc. B (1981), 43, No. 2, pp. 157-166