Hi,
I am aiming to perform MCMC sampling with a weighted multivariate normal likelihood, similar to this topic, but I receive an error when trying to recreate the weighted likelihood function in the sampling. Does anyone know how I might resolve this? My code and the error are below:
model = pm.Model()
with model:
#Prior
mu = pm.MvNormal('mu', mu=[0,0], cov=5*np.identity(2))
#covariance
cov = np.identity(2)
#weighted likelihood
weights = np.ones(len(data))
weighted_likelihood = pm.Potential('weighted_likelihood', weights*pm.MvNormal.dist(mu=mu,cov=cov).logp(data))
#MCMC Posterior sampling
idata = pm.sample(mp_ctx='spawn')
And the error doesn’t recognise format of the the MvNormal.dist() inputed into the pm.Potential function as found in the original topic:
AttributeError: 'TensorVariable' object has no attribute 'logp'
If anyone has any tips that might help it would be appreciated!