# Measurement Update Derivations » MSCKF Nullspace Projection

In the standard EKF update, given a linearized measurement error (or residual) equation:

we naively need to compute the residual covariance matrix as follows:

However, there would be a big problem in visual-inertial odometry (VIO); that is, we do not know what the prior feature covariance and it is coupled with both the state, itself, and the noise (i.e., , , and ). This motivates the need for a method to remove the feature from the linearized measurement equation (thus removing the correlation between the measurement and its error).

To this end, we start with the measurement residual function by removing the "sensitivity" to feature error we compute and apply the left nullspace of the Jacobian . We can compute it using QR decomposition as follows:

Multiplying the linearized measurement equation by the nullspace of the feature Jacobian from the left yields:

where we have employed the fact that and are orthonormal.

We now examine the dimensions of the involved matrices to appreciate the computation saving gained from this nullspace projection.

With that, we can have the following conclusion about the sizes when the nullspace is applied:

Finally, we perform the EKF update using the inferred measurement :

where the time index (subscript) refers to the prior estimate which was denoted before by symbol and corresponds to the posterior (or updated) estimate indicated before by .

## Implementation

Using Eigen 3 library, we perform QR decomposition to get the nullspace. Here we know that the size of is , which corresponds to the number of observations and size of the 3D point feature state.

Eigen::ColPivHouseholderQR<Eigen::MatrixXd> qr(H_f.rows(), H_f.cols());
qr.compute(H_f);
Eigen::MatrixXd Q = qr.householderQ();
Eigen::MatrixXd Q1 = Q.block(0,0,Q.rows(),3);
Eigen::MatrixXd Q2 = Q.block(0,3,Q.rows(),Q.cols()-3);