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
BUG/REF: redundant code in genmod get_prediction_glm, ignores link #7864
update It looks like there are some bugs, some options seem to be ignored,
e.g. I don't see any offset handling in the code for endpoint transformation confint, it just uses linpred = x b.
looks like false alarm
more in later comments
The get_prediction_glm function in genmod has weights handling copy pasted from regression linear model version. weights are not used in GLM.
GLM and GLMResults predict do not support weights, no freq_weights or var_weights. Maybe those should be added.
The function needs exog everything else we could delegate to results predict instead of using model predict.
The exog need to go through transform handling.
In GAM we also need creating the basis function for the predict exog.
changed the title [-]REF: redundant code in genmod get_prediction_glm[/-][+]BUG/REF: redundant code in genmod get_prediction_glm, ignores link, ignores offset in confint[/+]on Nov 9, 2021
predicted mean looks correct it goes through model.predict with keywords predicted_mean = self.model.predict(self.params, exog, **pred_kwds) PredictionResults uses the linear prediction result only in EP confint
regression linear PredictionResult also goes through model.predict, so pred_kwds like offset are taken into account
predicted_mean = self.model.predict(self.params, exog, **pred_kwds)
confint for linpred is predicted mean +/- crit * std. So this is also correct.
So offset handling in get_prediction looks correct
I don't see unit tests for it.
changed the title [-]BUG/REF: redundant code in genmod get_prediction_glm, ignores link, ignores offset in confint[/-][+]BUG/REF: redundant code in genmod get_prediction_glm, ignores link[/+]on Nov 9, 2021
Activity
josef-pkt commentedon Nov 7, 2021
linkargument is ignored, instead the attached model.family.link is used.[-]REF: redundant code in genmod get_prediction_glm[/-][+]BUG/REF: redundant code in genmod get_prediction_glm, ignores link, ignores offset in confint[/+]josef-pkt commentedon Nov 9, 2021
offset handling, reading code
predicted mean looks correct it goes through model.predict with keywords
predicted_mean = self.model.predict(self.params, exog, **pred_kwds)PredictionResultsuses the linear prediction result only in EP confintregression linear PredictionResult also goes through model.predict, so pred_kwds like offset are taken into account
predicted_mean = self.model.predict(self.params, exog, **pred_kwds)
confint for linpred is predicted mean +/- crit * std. So this is also correct.
So offset handling in get_prediction looks correct
I don't see unit tests for it.
[-]BUG/REF: redundant code in genmod get_prediction_glm, ignores link, ignores offset in confint[/-][+]BUG/REF: redundant code in genmod get_prediction_glm, ignores link[/+]