示例#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)