diff --git a/navlie/utils/common.py b/navlie/utils/common.py index b86e38fd..65ec89d7 100644 --- a/navlie/utils/common.py +++ b/navlie/utils/common.py @@ -1212,8 +1212,14 @@ def __getitem__(self, key): out.nees = out.error**2 / out.covariance.flatten() out.dof = np.ones_like(out.stamp) else: + n_times = out.covariance.shape[0] + n_error = out.covariance.shape[1] out.nees = np.sum( - out.error * np.linalg.solve(out.covariance, out.error), axis=1 + out.error + * np.linalg.solve( + out.covariance, out.error.reshape((n_times, n_error, 1)) + ).reshape((n_times, n_error)), + axis=1, ) out.dof = out.error.shape[1] * np.ones_like(out.stamp)