# How to Construct an Error State Kalman Filter?

I am trying to construct an error state kalman filter for GPS/INS integration using simulated data and I am having problem on a few steps. My error state vector is

$\delta x = [\delta\alpha \, \delta v_1 \,\delta v_2 \, \delta x_1 \, \delta x_2 \, \delta b_C \, \delta b_G \, \delta b_A \, \delta b_A ]$

1. So for the state update, is the estimated state update

$\delta \hat{x_k} = K_k . \delta z_k$ or $\delta \hat{x_k} = K_k . (\delta z_k - H.\delta \tilde{x_k})$

where $\delta z_k$ is the error in position measurement of GPS and INS, H is the relation matrix between the state and measurement and $\delta \tilde{x_k}$ is the predicted error.

2. After the state update, the total value is corrected according to error states. So is the error state resetted to zero?