Beispiel #1
0
 def test_dfgls_auto(self):
     dfgls = DFGLS(self.inflation, trend='ct', method='BIC', max_lags=3)
     assert_equal(dfgls.lags, 2)
     assert_equal(dfgls.max_lags, 3)
     assert_almost_equal(dfgls.stat, -2.9035369, DECIMAL_4)
     dfgls.max_lags = 1
     assert_equal(dfgls.lags, 1)
Beispiel #2
0
 def test_dfgls_auto(self):
     dfgls = DFGLS(self.inflation, trend='ct', method='BIC', max_lags=3)
     assert_equal(dfgls.lags, 2)
     assert_equal(dfgls.max_lags, 3)
     assert_almost_equal(dfgls.stat, -2.9035369, DECIMAL_4)
     dfgls.max_lags = 1
     assert_equal(dfgls.lags, 1)
Beispiel #3
0
 def test_dfgls_auto(self):
     dfgls = DFGLS(self.inflation, trend="ct", method="BIC", max_lags=3)
     assert_equal(dfgls.lags, 2)
     assert_equal(dfgls.max_lags, 3)
     assert_almost_equal(dfgls.stat, -2.9035369, DECIMAL_4)
     with pytest.warns(FutureWarning, match="Mutating unit root"):
         dfgls.max_lags = 1
     assert_equal(dfgls.lags, 1)
Beispiel #4
0
 def test_dfgls_c(self):
     dfgls = DFGLS(self.inflation, trend="c", lags=0)
     assert_almost_equal(dfgls.stat, -6.017304, DECIMAL_4)
     dfgls.summary()
     dfgls.regression.summary()
     assert dfgls.trend == "c"
     with pytest.warns(FutureWarning, match="Mutating unit root"):
         dfgls.trend = "c"
     assert dfgls.trend == "c"
     with pytest.warns(FutureWarning, match="Mutating unit root"):
         dfgls.trend = "ct"
     assert dfgls.trend == "ct"
     with pytest.warns(FutureWarning, match="Mutating unit root"):
         dfgls.trend = "c"
     assert dfgls.trend == "c"
     dfgls_hm = DFGLS(self.inflation, trend="c", lags=0, low_memory=False)
     assert_almost_equal(dfgls_hm.stat, -6.017304, DECIMAL_4)
     dfgls_lm = DFGLS(self.inflation, trend="c", lags=0, low_memory=True)
     assert_almost_equal(dfgls_lm.stat, -6.017304, DECIMAL_4)
     ml = dfgls.max_lags
     with pytest.warns(FutureWarning, match="Mutating unit root"):
         dfgls.max_lags = ml