Dear all,

How to use the multivariate normal distribution (x,y,z) by pymc3 and calculate the correlation between each variable with f(x,y,z) ?

in my problem have three variables. they are prior uniform distribution. and I have function f(x,y,z). Because I don’t know how to use the multivariate normal distribution so my code that does not meet my requirements. ( in my code temporarily use the pm.Normal to find the posterior distribution but it is not correctly) and I am using prior Normal distribution for 3 variables to have **bell curve** for posterior distribution.

a= -1.24

b=0.011

c=0.005

d=-0.0004

e=0.16

f=-0.00013

g=-2.01e-6

k=-0.002

m=-4.03e-5

l=0.0165basic_model = pm.Model()

with basic_model:

nodes1 = pm.Normal(‘nodes1’, 0.05, 0.06)

nodes2 = pm.Normal(‘nodes2’, 1.0, 0.1)

nodes3 = pm.Normal(‘nodes3’, 50, 5)

mu=a.nodes1^2+b.nodes1.nodes2+c.nodes2^2+d.nodes1.nodes3+e.nodes1+f.nodes2.nodes3+g.nodes3^2+k.nodes2+m.nodes3+l

pm.Normal(‘observed’, mu, 0.05, observed=evals)

trace = pm.sample(1000, cores =1)

pm.traceplot(trace,varnames= [‘nodes1’,‘nodes2’,‘nodes3’])

k = pm.summary(trace).round(2)

pm.plot_posterior (trace, varnames= [‘nodes1’,‘nodes2’,‘nodes3’])

tracedf1 = pm.trace_to_dataframe (trace, varnames = [‘nodes1’,‘nodes2’,‘nodes3’])

sns.pairplot(tracedf1 )

print (k)

plt.show()

thank you