# Which equation should I use to compute the Extended Kalman Filter?

Compute the Extended kalman filter can be done in several ways.

The first one compute the convariance matrix $P(t)$ from the Riccati Equation:

$$\dot{P} = F(t)P(t) + P(t)F^T(t) - P(t)H^T(t) R^{-1}H(t)P + Q$$

The second one compute the covariance matrix $P$ from this equation: $$\dot{P} = F(t)P(t) + P(t)F^T(t) - K(t)H(t)P(t) + Q(t)$$ https://en.wikipedia.org/wiki/Extended_Kalman_filter#Continuous-time_extended_Kalman_filter

So which one is it? It dosen't matter right? I still can find $P$ by using:

$$P(t) = P(t) + \dot{P} dt$$

Where:

• $dt$ is the sampling time

Or I can use $fsolve$ in MATLAB to solve $P(t)$ from this equation: $$0= F(t)P(t) + P(t)F^T(t) - K(t)H(t)P(t) + Q(t)$$

What is best?

• Second one is not correct. It's only the first one. – percusse Aug 1 '17 at 0:14
• But all my books showing that algebraic Riccati equation can be used. But the wikipedia link says something diffrent. Why? – Daniel Mårtensson Aug 1 '17 at 0:17