In my model, I aim to set [c,m]~multiGaussian with mu=[2.3,-14.9];
Cov=[[0.0179,-0.0432517],[-0.0432517,0.108137]]. Then, infer c, m from posterior distribution. But I don’t know how to assign two-dimensional Gaussian distribution to [c,m]. I tried the following code,
import numpy as np
import pymc3 as pm
delta=…
growth=…
with pm.Model() as model_a:
mu = [2.3075560664282255,-14.925081358163954]
Cov=np.array([[0.0179,-0.0432517],[-0.0432517,0.108137]])
[c,m] = pm.MvNormal(‘vals’, mu=mu, cov=Cov, shape=(1, 2))#some thing wrong
deltmu=pm.Deterministic(‘deltmu’,c*delta**m)
y=pm.Normal(‘y’,mu=deltmu,sd=0.1,observed=growth)
trace_a=pm.sample(10000,cores=1)
Actually, it is similar to assign ‘c=pm.Normal(‘c’,mu1,var1)’ and ‘m=pm.Normal(‘m’,mu2,var2)’. But c and m is correlated, so I want to use two-dimensional Gaussian distribution.
I know that the error is caused by “[c,m] = pm.MvNormal(‘vals’, mu=mu, cov=cov, shape=(1, 2))”. Could you advice how to make it correctly.
Many thanks for your help.