How do I define mulitple RVs with a joint liklihood?

Welcome!

I don’t think anything particularly surprising happens when you have multiple, separate observations. During sampling, the log posterior of the sampled parameter values is just the sum of all of the relevant log posteriors.

That being said, you probably want to avoid loops whenever possible because they can’t be optimized under the hood. So it would be ideal to vectorize your loop if at all possible. I didn’t dig into your code too much, but it seems like the parametric components of your likelihood ( vis_A) and your data (vis) may already be in a state that they can be reshaped to allow for straightforward vector operations.

3 Likes