def test_whiteness(self): np.random.seed(91) var = VARBase(0) var.residuals = np.random.randn(10, 5, 100) pr = sp.plot_whiteness(var, 20, repeats=100) self.assertGreater(pr, 0.05)
def test_whiteness(self): np.random.seed(91) var = VARBase(0) var.residuals = np.random.randn(10, 5, 100) pr = sp.plot_whiteness(var, 20, repeats=100) self.assertGreater(pr, 0.05)
def test_whiteness(self): np.random.seed(91) r = np.random.randn(80, 15, 100) # gaussian white noise r0 = r.copy() var = VAR(0, n_jobs=-1) var.residuals = r p = var.test_whiteness(20, random_state=1) self.assertTrue(np.all(r == r0)) # make sure we don't modify the input self.assertGreater(p, 0.01) # test should be non-significant for white noise r[:, 1, 3:] = r[:, 0, :-3] # create cross-correlation at lag 3 p = var.test_whiteness(20) self.assertLessEqual(p, 0.01) # now test should be significant
def test_whiteness(self): np.random.seed(91) r = np.random.randn(100, 5, 10) # gaussian white noise r0 = r.copy() var = VAR(0) var.residuals = r p = var.test_whiteness(20) self.assertTrue(np.all(r == r0)) # make sure we don't modify the input self.assertGreater( p, 0.01) # test should be non-significant for white noise r[3:, 1, :] = r[:-3, 0, :] # create cross-correlation at lag 3 p = var.test_whiteness(20) self.assertLessEqual(p, 0.01) # now test should be significant