def norm_resid(self): """ Residuals, normalized to have unit length and unit variance. Returns ------- An array wresid/sqrt(scale) Notes ----- This method is untested """ if not hasattr(self, 'resid'): raise ValueError('need normalized residuals to estimate standard\ deviation') return self.wresid * recipr(np.sqrt(self.scale))
def test_recipr(self): X = np.array([[2,1],[-1,0]]) Y = tools.recipr(X) assert_almost_equal(Y, np.array([[0.5,1],[0,0]]))
def test_recipr(self): X = np.array([[2, 1], [-1, 0]]) Y = tools.recipr(X) assert_almost_equal(Y, np.array([[0.5, 1], [0, 0]]))