Weighted Linear Regression using GLM

Hi,

I found a couple questions related to the topic of weighting the observations for inference. I was wondering if there was a way to achieve this using a GLM object. I had trouble finding anything in the docs.

If it isn’t possible using GLM I was wondering what the preferred (or possibly established) method for doing so was.

Thanks,

Harry

Since the weights are usually element-wise multiply to the observed likelihood, I dont see a straightforward way to do it with GLM object. You can try either:

  1. Writing a custom distribution to express the weighted likelihood
  2. Express it as an additional term and use pm.Potential to add it to the model.
1 Like

Hi @junpenglao , for approach number 2 - how would you perform draw sample from posterior prediction?