Open b-knight opened 1 month ago
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:
fixef_iter
to both functions & add docstrings. FixestMulti
class (just as fixef_tol
) and assign it as an attribute. Feols
and Feiv
, from FixestMulti
, we'd directly pass it to demean_model
, where we finally can pass it to demean
.Feiv
, we'd pass the argument to Fepois
, from which we can pass it to the internal calls to demean.
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.