Pymc3.model likelihood evaluation for given prior sample

Hi all,
is there a straightforward way to do the following:

I have a pymc3.model object, and I would like to evaluate pymc3.model.logp for given sample from the prior distributions over wich is my pymc3.model defined. Something along the lines

pymc3_model.logp(prior_sample, transform = None).

I will greatly appreciate any help!

You can pass the prior_sample as a dict into pymc3_model.logp. There is no option to pass transform = None which means you need to always provide a dictionary of RVs after they are transformed. However, you can use the pm.util.update_start_vals to update the dictionary:

pm.util.update_start_vals(prior_sample, m.test_point, m)
1 Like

That works great, thanks!