-
Notifications
You must be signed in to change notification settings - Fork 40
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
Prediction error for non-fe model #573
base: master
Are you sure you want to change the base?
Conversation
rename `self._vcov` to `self.vcov` in the `lpdid` class
the vcov attribute is always available =)
replacing .vcov with ._vcov
.vcov to ._vcov
`uhat` as dense 1D array
Looks very good so far! 👍😄 I guess at some point we might want to clean up the different concepts of predicted values, i.e. I suppose next steps would be to implement some basic tests (i.e. against |
pyfixest/estimation/feols_.py
Outdated
@@ -1436,6 +1436,7 @@ def predict( | |||
atol: float = 1e-6, | |||
btol: float = 1e-6, | |||
type: str = "link", | |||
compute_stdp: bool = False | |||
) -> np.ndarray: |
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.
Btw, I think that a few unit tests fail because the code assumes that predict
returns a np.ndarray
- if we change to a pd.DataFrame
(which I think makes most sense), we need to change these.
Alternatively, we could change to -> Union[np.ndarray, pd.DataFrame]
and simply return the numpy array if compute_stdp = False
.
Yep, I didn't touch the tests or docs yet but happy to do that as a next step! |
Codecov ReportAttention: Patch coverage is
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
pre-commit.ci autofix |
Hi Hayden (@greenguy33), I am finally getting around to pick this up - would it be ok if I took the newly added functions and opened a new PR? |
@s3alfisc Absolutely, and sorry for dropping off the face of the earth after submitting this. I've been absolutely swamped with my grad work since then. |
Cool! And no worries at all, I've been there myself... hope all your papers will progress smoothly! |
This pull request references issue #566
This is not a finished product but I took a first pass at implementing prediction standard error (stdp) within the predict function. As discussed it is only implemented for models without fixed effects for now. I'm creating this pull request to solicit feedback on the approach used. I confirmed that results returned are the same as statsmodels'
get_prediction()
function for a test dataset.Note that CI's are not implemented, but the prediction error is returned. In order to implement CIs, we need to provide a z-score based on the percentage CI we want and then do some simple arithmetic. For the sake of keeping things simple and not adding too many new arguments to the
predict()
function, I left that out for now.