Skip to content
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

Helping demean() Fail Gracefully - Add a'fixef_iter' argument to feols() and fepois() #539

Open
b-knight opened this issue Jul 7, 2024 · 1 comment · May be fixed by #542
Open

Helping demean() Fail Gracefully - Add a'fixef_iter' argument to feols() and fepois() #539

b-knight opened this issue Jul 7, 2024 · 1 comment · May be fixed by #542
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@b-knight
Copy link
Contributor

b-knight commented Jul 7, 2024

I've encountered instances when demean_.demean() runs endlessly - probably because I passed it a poorly structured data shape. I would like to be able to call a service that uses PyFixest, so calling the package on problematic data is a distinct possibility.

To this end, it would be great if there were ways to help the demean() method fail gracefully. Having some sort of mechanism for timing out could be handy, but the simplest approach that I can think of off hand is to make the 'maxiter' argument accessible from the feols() method in a manner similar to how the 'fixef_tol' argument is accessible to the user.

@s3alfisc s3alfisc added enhancement New feature or request good first issue Good for newcomers labels Jul 8, 2024
@s3alfisc
Copy link
Member

s3alfisc commented Jul 8, 2024

Yes, I agree - it would be great to add a fixef_iter function argument to pyfixest.estimation.feols and pyfixest.estimation.fepois that would allow users to set the maximum number of iterations for the demeaning algo.

Overall, this should be straightforward enough:

  • We'd have to add a function argument fixef_iter to both functions & add docstrings.
  • We'd then have to propagate the argument to the FixestMulti class (just as fixef_tol) and assign it as an attribute.
  • For objects of class Feols and Feiv, from FixestMulti, we'd directly pass it to demean_model, where we finally can pass it to demean.
  • For objects of class Feiv, we'd pass the argument to Fepois, from which we can pass it to the internal calls to demean.

@s3alfisc s3alfisc changed the title Helping demean() Fail Gracefully - Make 'maxiter' Accessible from feols() Helping demean() Fail Gracefully - Add a'fixef_iter' argument to feols() and fepois() Jul 8, 2024
@s3alfisc s3alfisc linked a pull request Jul 8, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants