Marginal distribution estimation

It is still a bit unclear for me what you are trying to achieve.

Where does the data come in your model exactly? At the mnorm or at each of the thetas? What kind of data do you have? Unless you are just trying to sample from an already known model (in which case you don’t really need PyMC), you should have an observed argument somewhere in your model, where you input your data, in order to infer the posterior parameters (those without the observed argument).

To make inference, sampling would be called by trace = pm.sample() (still inside the with pm.Model() as model1: block), and not by mnorm.sample(10000) like you wrote in your pseudocode.

1 Like