Only inferencing partial latent variables

Hi all gamers,

I’m wondering that when doing inference with edward, do we have to feed all variables in the graphical model into the inference instance?

For example with linear regression, y = a*x+b, the common inference would be:
ed.KLqp({a:qa, b:qb},data={x:x_data, y:y_data})
and we’ll get the approximated posterior for parameters a and b. But what if we only care about a? could we just define some prior over latent variable b and NOT feed it into the inference so it looks like this
ed.KLqp({a:qa},data={x:x_data, y:y_data})

So to conclude my question is would the above inferences give me similar/same qa for approximating posterior of parameter a?

Thanks !

If you only care about the posterior for p(a | X, y) then ed.KLqp({a:qa},data={x:x_data, y:y_data}) will do that. I think should be similar (but not necessarily the same as because of the variational inference) ed.KLqp({a:qa, b:qb},data={x:x_data, y:y_data}) if your priors are independent. The problem you will have running the first one is that you can’t make any predictions since you only have the posterior for one of the variables.

Hey, thanks for the reply! Yeah I understand what you mean, and the vars that are not in the inference would be integrate out with the prior so the output should be different.