Hi all, I am new to pymc3 and trying to migrate some code from Turing in Julia to pymc3. Here is a toy model of my work.
import numpy as np
import scipy
import pymc3 as pm
mu_z, Sigma_z = np.zeros(2), np.eye(2)
r = scipy.stats.multivariate_normal.rvs(np.ones(2), np.eye(2), size=5)
with pm.Model() as model:
z = pm.MvNormal("z", mu=mu_z, cov=Sigma_z, shape=len(mu_z))
f = lambda x : scipy.special.erf(x)
r = pm.MvNormal("r", f(z), np.eye(2), observed=r)
What I want to do here is that setting a prior for the variable z
, and implement some nonlinear transform on it (erf
), and use the transformed value as the mean of the likelihood r
.
The error message says that the ufunc erf
not supported for the input types. Therefore, can anybody help me solve this problem? Thank you very much!