Repository navigation
Phreg predict - #2924
Phreg predict#2924lbybee wants to merge 25 commits into
Conversation
|
@josef-pkt this looks reasonable to me, what do you think? |
|
2 design question (I don't know or remember many of the model specific details):
To the second item: The main idea between the separation of predict and get_prediction is to cater to two different usecases. predict for fast specific results (as in cross-validation) and get_prediction for the full results. (a bit later) another thing that is bothering me is that the Bunch is using the same attribute |
|
The main reason for returning the bunch was when returning estimates, standard errors, and confidence intervals, without having a long list of return values. If lists of return values are preferred that is OK with me. |
|
Trying to establish some analogies between what we are doing with The default return value of My main use case for |
|
This PR is also needed for |
|
Ok, I think what I've done here should take care of some of the concerns. Basically I just modified _prediction in regression so that we can use it for Phreg. This was I was able to get rid of _prediction in duration. |
|
One more question (I lost my comment that I started last week) What should be the default In general, I prefer that if we standardize to returning the expected value of the response, ie. the mean prediction and not the linear prediction if the conditional expectation is transformed as in GLM type models. |
| var_pred_mean = (exog * np.dot(covb, exog.T).T).sum(1) | ||
| # handle var_pred_mean for the PHReg case | ||
| if 'pred_type' in pred_kwds: | ||
| cov_params = pred_kwds['cov_params'] |
There was a problem hiding this comment.
What is the usecase for overriding the attached default cov_params?
Is this useful in general, so it should be added as a main keyword option and not just for lhr?
(we allow it in t_test and wald_test, but not in discrete get_margeff margins.)
The old keyword in t_test uses a shorter keyword cov_p=None, I guess from a time when having shorter names was still a stronger consideration.
|
@kshedden should probably weigh in on some of this. I'm not complete sure what the use case is for an external |
|
Note, I'm not against adding Generic or general PHReg improvements don't need to be in this PR, but then we need to open new issues to work on this later. |
| # handle var_pred_mean for the PHReg case | ||
| if 'pred_type' in pred_kwds: | ||
| cov_params = pred_kwds['cov_params'] | ||
| if pred_kwds['pred_type'] == 'lhr': |
There was a problem hiding this comment.
@lbybee can we avoid referring to lhr (duration-specific term) here in the base prediction code? I think it would be better to have a subclass for phreg, and if pred_type is lhr we just invoke the superclass, otherwise we do phreg-specific things in the subclass.
|
@lbybee, @josef-pkt in Also, should |
|
Maybe the general idea here is that the base Perhaps the base |
|
a few comments on prediction. It's still not settled, so more usecases and ideas for improvements are still necessary.
not yet clear to me: How to we get confidence interval or similar for a new observation with models with a non-additive error like Poisson taking paramer uncertainty into account? |
See #2894
This should map to what was mentioned, there are still some issues with the MICE tests but I wanted to get this up.