-
Notifications
You must be signed in to change notification settings - Fork 82
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
I think this line presumes that the IV model is just-identified. I get a dimension error when the system is over-identified.
https://github.com/s3alfisc/pyfixest/blob/c9cb184b34333c82cb11bec9e73e387efd63c170/pyfixest/feiv.py#L42C1-L43C1
len(self._collin_index) is 1 + dim(exogenous covariates) whereas the dimension of Z should be dim(exogenous instruments) + dim(exogenous covariates)
A hacky but working solution is to pad self._collin_index with Falses if the model is overidentified
if self._collin_index is not None:
# TODO: this does not implement collinearity checking for the instruments
collin_index_z = np.array([False] * (Z.shape[1] - len(self._collin_index)) + list(self._collin_index))
self._Z = Z[:, ~collin_index_z]I imagine something goes wrong if the instruments are collinear though.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working