I think I have at least partial answers to my questions for those who have the same one?
- The
logpmethods operate on points, so we can do things like this:
model.logp(posterior_trace.point(i)).item() for i in range(X)
- For this I was interested in comparing results from a prior and a posterior model. So if I have a model constructor that optionally takes observations as arguments, I believe I can do the following:
a. Create a prior model,m1
b. Create a posterior modelm2that is likem1, but has some observed variables.
c. AFAICT the points from a trace generated by eitherm1orm2can be evaluated using thelogpmethod of either model. Indeed, if I understand @junpenglao 's argument elsewhere, thelogpof these two models will be identical, and the only difference between the two will be in the normalizing constant (thelogpbeing in general an un-normalized potential, instead of a probability).