I have a question about Kalman filter. I am using Kalman filter for a state space model as following:
X(k+1) = A(k)x(k)+B(k)u(k)+w(k), w(k) ∼ N(0,Q)
Y(k) = C(K)x(k)+D(k)u(k)+v(k), v(k) ∼ N(0,R)
Which the state space matrixes (A(k),B(k),C(k),D(k))
are updated in each sampling time but Q and R matrixes are considered to be constant. The equations which calculate the Kalman gain (K(k)) and covariance P matrix (P(k)) are as following:
K(k) = (P(k)*C(k)' )/(R + C(k)*P(k)*C(k)');
Pxx(k) = (eye(n)-K(k)*C(k))*P(k)*(eye(n)-K(k)*C (k))'+K(k)*R*K(k)';%Joseph form
P(k) = A(k)*Pxx(k)*A(k)' + Q;
The problem that I face is related to stability of (A(k)-K(k)*C(k))
. In some sampling times, the calculated Kalman gain can not stabilize the (A(k)-K(k)*C(k))
matrix and the eigenvalues of (A(k)-K(k)*C(k))
are outside of unit circle.
Could you please help me to figure out the reason for this problem? I am expecting that the Kalman filter gives me the gain which make the (A(k)-K(k)*C(k))
matrix stable with eigenvalues inside the unit circle.