You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ENH: add estimated variance of endog to GLMResults #7528
I think the best would be to add it as option to predict.
GLMResults currently does not define a predict method. It uses the inherited predict method of base.model.Results, that delegates to the model GLM.predict method.
base.model.Results.predict delegates args and kwargs to model predict method, so is flexible to handle additional keywords.
GLM.predict uses boolean linear=False. This would need to be generalized to which similar to the newer count models.
We will not get get_prediction for variance and similar because we don't have cov_params for scale.
The current GLM.predict does not use weights for linpred and predicted mean.
In variance prediction we could have an option to include var_weights, similarly resid_pearson (always) includes var_weights
(context: I'm verifying get_distribution with implied mean and variance.)
predict(..., which="loglike")
In GLM in contrast to discrete and other models, the loglike for GLM is not hardcoded in the model class. We can use the family.loglike_obs to compute loglike for out-of-sample observations.
BetaModel has a private _llobs which is loglikeobs with additional endog, exog arguments. The loglikeobs method delegates to it.
That's another way of getting loglike for endog or exog. other than the model attributes.
Zero-inflated models still temporarily replaces the model attributes.
Activity
josef-pkt commentedon Jul 2, 2021
followup idea
predict(..., which="loglike")In GLM in contrast to
discreteand other models, the loglike for GLM is not hardcoded in the model class. We can use the family.loglike_obs to compute loglike for out-of-sample observations.#2572 last sentence
difference to other
predictoptions would be that we needendogin addition to exog. So, it's not completely the same pattern.josef-pkt commentedon Dec 13, 2021
related: for out of sample loglike
BetaModel has a private
_llobswhich is loglikeobs with additional endog, exog arguments. Theloglikeobsmethod delegates to it.That's another way of getting loglike for endog or exog. other than the model attributes.
Zero-inflated models still temporarily replaces the model attributes.