Skip to content

Provide a OOP numpy API #515

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .coverage
Binary file not shown.
4 changes: 2 additions & 2 deletions pyfixest/did/estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def event_study(
raise NotImplementedError("Estimator not supported")

# update inference with vcov matrix
fit.get_inference()
fit.inference()

return fit

Expand Down Expand Up @@ -253,7 +253,7 @@ def did2s(

fit._vcov = vcov
fit._G = _G
fit.get_inference() # update inference with correct vcov matrix
fit.inference() # update inference with correct vcov matrix

fit._vcov_type = "CRV1"
fit._vcov_type_detail = "CRV1 (GMM)"
Expand Down
2 changes: 1 addition & 1 deletion pyfixest/did/event_study.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,6 @@ def event_study(
raise NotImplementedError("Estimator not supported")

# update inference with vcov matrix
fit.get_inference()
fit.inference()

return fit
11 changes: 6 additions & 5 deletions pyfixest/estimation/FixestMulti_.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ def _estimate_all_models(
FIT = Feols(
Y=Yd_array,
X=Xd_array,
fe=None, # hack, demeaning happens outside!
weights=weights,
coefnames=coefnames,
collin_tol=collin_tol,
Expand All @@ -325,7 +326,7 @@ def _estimate_all_models(
if FIT._X_is_empty:
FIT._u_hat = Y.to_numpy() - Yd_array
else:
FIT.get_fit()
FIT.fit()

elif _method == "fepois":
# check for separation and drop separated variables
Expand Down Expand Up @@ -368,7 +369,7 @@ def _estimate_all_models(
weights_type=_weights_type,
)

FIT.get_fit()
FIT.fit()

FIT.na_index = na_index
if na_separation:
Expand Down Expand Up @@ -402,11 +403,11 @@ def _estimate_all_models(
# inference
vcov_type = _get_vcov_type(vcov, fval)
FIT.vcov(vcov=vcov_type, data=_data_clean)
FIT.get_inference()
FIT.inference()

# other regression stats
if _method == "feols" and not FIT._is_iv:
FIT.get_performance()
FIT.performance()
if _icovars is not None:
FIT._icovars = _icovars
else:
Expand Down Expand Up @@ -489,7 +490,7 @@ def vcov(self, vcov: Union[str, dict[str, str]]):
) = _deparse_vcov_input(vcov, False, False)

fxst.vcov(vcov=vcov)
fxst.get_inference()
fxst.inference()

return self

Expand Down
2 changes: 1 addition & 1 deletion pyfixest/estimation/feiv_.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def __init__(
self._support_iid_inference = True
self._supports_cluster_causal_variance = False

def get_fit(self) -> None:
def fit(self) -> None:
"""Fit a IV model using a 2SLS estimator."""
_X = self._X
_Z = self._Z
Expand Down
Loading
Loading