 sudarshankumar
Topic Author
Posts: 8
Joined: November 15th, 2013, 5:46 am

### Kalman filter stability problem

While implementing Klamna filter some times matrix become singular. After searching internet I came to know Josef form of Klaman filter can mitigate that.Just wanted to know how to implement thatWill replacing old quantion (InitVarY=(I-KalmanGain*H)*VarY; with new one InitVarY=(I-KalmanGain*H)*VarY*(I-KalmanGain*H)'+ KalmanGain*R*KalmanGain'; will be sufficient ??or do i need to edit some other equantion as well OOglesby
Posts: 42
Joined: August 26th, 2011, 5:34 am

### Kalman filter stability problem

There can be several places and several reasons why a matrix can become singular. Unless the model used is truly linear, your process noise matrix, Q, should not be all zeros. For nonlinear models, having even small non-zero values on the diagonal of Q can help prevent singular matrices from forming and it helps ensure that the filter does not ignore the measurements.Another place to be careful is the calculation of the Kalman gain: $\frac{VarY*H^T}{H*VarY*H^T + R}$. Do not explicitly compute inverse in this equation. Instead solve a system of equations (Ax=b) whereA=$(H*VarY*H^T + R)^T$x=$KalmanGain^T$b=$(VarY*H^T)^T$If your solver can handle solving (xA=b), then the outermost transposes can be removed.If your development language has symmetric matrices, then use it to represent InitVarY, VarY, R, and Q.  