def residual_of(self, z):
        """
        Returns the residual for the given measurement (z). Does not alter
        the state of the filter.
        """
        z = reshape_z(z, self.dim_z, self.x.ndim)
        return z - dot(self.H, self.x_prior)

        Returns the residual for the given measurement (z). Does not alter
        the state of the filter.
        
trackers/ocsort_tracker/kalmanfilter.py