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*/
#ifndef YAFL_CONFIG_H
#define YAFL_CONFIG_H
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#define YAFL_DBG(...) fprintf(stderr, __VA_ARGS__)
typedef int32_t yaflInt;
#ifndef YAFL_USE_64_BIT
# define YAFL_USE_64_BIT (0)
#endif/*YAFL_USE_64_BIT*/
#if YAFL_USE_64_BIT
typedef double yaflFloat;
# define YAFL_EPS (1.0e-15)
# define YAFL_SQRT sqrt
# define YAFL_ABS fabs
# define YAFL_ABS fabs
# define YAFL_EXP exp
# define YAFL_LOG log
#else/*YAFL_USE_64_BIT*/
typedef float yaflFloat;
# define YAFL_EPS (1.0e-6)
# define YAFL_SQRT sqrtf
# define YAFL_ABS fabsf
# define YAFL_EXP expf
# define YAFL_LOG logf
#endif/*YAFL_USE_64_BIT*/
#ifdef __GNUC__
# define YAFL_UNLIKELY(x) __builtin_expect((x), 0)
#else
# define YAFL_UNLIKELY(x) (x)
#endif
#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