def test_normalization(self): '''test normalization''' m = ts.mean(self.nsample) s = ts.samplesd(self.nsample) res = [ts.normalize(x, m, s) for x in self.nsample] self.assertEqual(round(ts.mean(res)), self.nsampmean) self.assertEqual(round(ts.sd(res)), self.nsampdev)
def test_sd(self): '''test unbiased standard deviation''' result = ts.sd(self.samples) self.assertEqual(round(result, self.roundper), self.sdx)