correct residuals and hat computations for ekf