Recursive and iterative implementations of the Kalman Filter for n dimensions.
Python: iterative, uses Pandas
MATLAB: recursive
https://en.wikipedia.org/wiki/Kalman_filter
The Kalman filter is a single function:
[ output ] = kalmanf(zk, A, xk, Pk, B, uk, wk, Q, R, H, output, t)
Try running runkalman.m for an example.
kalman_filter(zk xk, A, B, Pk, uk, wk, Q, R, H)
INPUTS
- zk (pandas timeseries): input data
- xk (np.array): a priori state estimate vector
- A (np.matrix): state transition coefficient matrix
- B (np.matrix): control coefficient matrix
- Pk (np.matrix): prediction covariance matrix
- uk (np.array): control signal vector
- wk (float): process noise (has covariance Q)
- Q (float): process covariance
- R (float): measurement covariance
- H (np.matrix): transformation matrix
OUTPUTS
- output (np.array): kalman filtered data
EXAMPLE
Copyright 2015, 2016 Yazan Obeidi (Apache)