-
Notifications
You must be signed in to change notification settings - Fork 37
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
lsqr() for fixed effects solver #546
Conversation
rename `self._vcov` to `self.vcov` in the `lpdid` class
the vcov attribute is always available =)
replacing .vcov with ._vcov
.vcov to ._vcov
Looks like method
I'll take a look at what's going asap. |
I think lsqr might return a tuple? https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.lsqr.html so we'd have to pick the first return element. |
`uhat` as dense 1D array
Another option to fix the failing tests is to tighten the convergence criteria for the iterative alpha = lsqr(D2, uhat, atol = 1e-10, btol = 1e-10)[0] Note that I think I would suggest the following: we keep the 1e-06 defaults as our defaults, but add function arguments What do you think Hayden (@greenguy33)? Any feedback from a user's perspective on this, @b-knight? |
That sounds good to me. I am mostly offline this weekend but can definitely make this change in the coming week. I guess it will require some changes in the tests as well, to supply the passing values of 1e-10? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
|
@s3alfisc Looks like tests are passing now. However in order to get that to happen I changed the tolerance values for np.testing.assert_allclose in two test files. I'm not sure if these tests were passing before because it doesn't appear that they are running the lsqr solver. |
@@ -1358,7 +1358,7 @@ def ccv( | |||
n_splits=n_splits, | |||
) | |||
|
|||
def fixef(self) -> dict[str, dict[str, float]]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add docstrings that explain atol and btol and that refer to the scipy lsqr docs?
https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.lsqr.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I've seen you did it already for predict. Thanks!
Just merged, thank you @greenguy33! |
Closes #469