Ejemplo n.º 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
Ejemplo n.º 2
0
 def test_constant_check(self):
     obs = diagnostics.constant_check(reg.x)
     exp = True
     self.assertEquals(obs,exp)
Ejemplo n.º 3
0
 def test_constant_check(self):
     obs = diagnostics.constant_check(reg.x)
     exp = True
     self.assertEquals(obs, exp)
Ejemplo n.º 4
0
 def test_constant_check(self):
     obs = diagnostics.constant_check(reg.x)
     exp = True
     np.testing.assert_equal(obs, exp)
Ejemplo n.º 5
0
 def test_constant_check(self):
     obs = diagnostics.constant_check(reg.x)
     exp = True
     np.testing.assert_equal(obs,exp)