Trying to get the log probability for a PyMC model evaluated at a particular set of parameter values. I am attempting to follow this documentation webpage: behind_the_scenes_of_the_logp_function .
The following code chuck is from the above webpage:
with pm.Model() as model:
z = pm.Normal('z', mu=0., sigma=5.) # ==> aesara.tensor.var.TensorVariable
x = pm.Normal('x', mu=z, sigma=1., observed=5.) # ==> aesara.tensor.var.TensorVariable
# The log-prior of z=2.5
pm.logp(z, 2.5).eval() # ==> -2.65337645
# ???????
x.logp({'z': 2.5}) # ==> -4.0439386
# ???????
model.logp({'z': 2.5}) # ==> -6.6973152
The line model.logp({'z': 2.5})
returns the following error: TypeError: unhashable type: 'dict'
.
Any help would be appreciated; thanks!