Пример #1
0
def covariates(X):
    """
    This

    1. checks if the lower-level covariate contains a constant
    2. adds a constant to the lower-level covariate if it has no constant
    """
    if constant_check(X):
        Warn("X array should not contain a constant vector;"
             " constant will be added automatically")
    else:
        X = sphstack(np.ones((X.shape[0], 1)), X)

    return X
Пример #2
0
 def test_constant_check(self):
     obs = diagnostics.constant_check(reg.x)
     exp = True
     self.assertEquals(obs,exp)
Пример #3
0
 def test_constant_check(self):
     obs = diagnostics.constant_check(reg.x)
     exp = True
     self.assertEquals(obs, exp)
Пример #4
0
 def test_constant_check(self):
     obs = diagnostics.constant_check(reg.x)
     exp = True
     np.testing.assert_equal(obs, exp)
Пример #5
0
 def test_constant_check(self):
     obs = diagnostics.constant_check(reg.x)
     exp = True
     np.testing.assert_equal(obs,exp)