def _validate_inputs(self):
x, z = self._x, self._z
if x.shape[1] == 0:
raise ValueError('Model must contain at least one regressor.')
if self.instruments.shape[1] < self.endog.shape[1]:
raise ValueError('The number of instruments ({0}) must be at least '
'as large as the number of endogenous regressors'
' ({1}).'.format(self.instruments.shape[1],
self.endog.shape[1]))
if matrix_rank(x) < x.shape[1]:
raise ValueError('regressors [exog endog] do not have full '
'column rank')
if matrix_rank(z) < z.shape[1]:
raise ValueError('instruments [exog instruments] do not have '
'full column rank')
self._has_constant, self._const_loc = has_constant(x)
评论列表
文章目录