glmGamPoi icon indicating copy to clipboard operation
glmGamPoi copied to clipboard

[FR] Implement `logLik.glmGamPoi`

Open jan-glx opened this issue 1 year ago • 2 comments
trafficstars

For many model classes in R an implementation of the logLik generic is provided. I often use this on holdout data (this usually requires manipulating the fitted object) to compare different models. Thus I would only need REML=FALSE and would appreciate a newdata argument.

jan-glx avatar Jan 16 '24 09:01 jan-glx

Hi Jan,

I like the suggestion. Do you think the function should treat the overdispersion as fixed or would you want the combined likelihood of mean estimates and overdispersion?

Best, Constantin

const-ae avatar Feb 19 '24 16:02 const-ae

I am not 100% sure what the model is that is actually fit. I understood that the overdispersion estimates are fixed estimates so they should should only apear on the conditioning part P(new data| coef) where coef are gene means, fixed effects, overdispersion). The size factors are probably harder to deal with...

However, I noticed that a newdata argument is far from standard for logLikin R (not even for lm and usually requires some hacks to get) I guess I was spoiled by Stan/Pyro when requesting that.

jan-glx avatar Feb 19 '24 20:02 jan-glx