I have a 3D likelihood model that is multivariate normal where I compute the mean with
mu = [1/x1, x2/x1, x3/x1]
where x1, x2, and x3 have respectively a Gamma, Beta, and Uniform prior.
I tried to implement this in PyMC3 with
with pm.Model() as myModel:
x1 = pm.Gamma('x1', alpha=2, beta=1)
x2 = pm.Beta('x2', alpha=2, beta=3)
x3 = pm.Uniform('x3', lower=0.0, upper=1)
mu = np.array([1/x1, x2/x1, x3/x1])
cov = np.identity(3)
x = pm.MvNormal('x', mu=mu, cov=cov, observed=np.array([0.51, 1.2, 0.27]))
trace = pm.sample(5000)`
but I got the rather cryptic error message:
AsTensorError: (‘Cannot convert [Elemwise{true_div,no_inplace}.0 Elemwise{true_div,no_inplace}.0\n Elemwise{true_div,no_inplace}.0] to TensorType’, <class ‘numpy.ndarray’>)
pointing to the line with pm.MvNormal()
Is what I’m trying to do within PyMC’s current capabilities? If yes, do you have any help on what the error message means?