Changing process noise covariance

Hi All,

I am implementing a Kalman Filter and I would like to change the process noise based on innovations. For example, use a different constant covariance matrix if the innovation is higher than a particular value.
It does not look like the process noise is allowed to change once the KalmanBuilder is initialized. Is there any way to do this without reinitializing a new Kalman Filter?
Thank you.

Hi @niluj

First, you can implement the CovarianceMatrixProvider interface to build your own process noise provider.

I think, but I am not sure since I never tried, your CovarianceMatrixProvider implementation could have a KalmanObserver implementation as attribute. Like that you can save in your KalmanObserver implementation the value of the innovation matrix and get it in the CovarianceMatrixProvider to change the value of the process noise.
Just note that the observer is updated after the correction step. In other words, the process noise at time t(k) will depend on the value of the innovation at time t(k-1).

So, you have two interfaces (i.e., CovarianceMatrixProvider and KalmanObserver) to implement.


Thank you for the suggestion.
I added the covariance noise as an attribute of the KalmanObserver Implementation.
It looks hacky but it worked.