I think there is a couple of problems here:
- the RV
z's default values are 0s, which gives an invalid parameter lam to the Exponential. - the model is over specify, with more parameters than observations
- the model is unidentifiable with the dot product (-2*-2 is the same as 2*2)
Maybe a better prior would helps, something like:
with pm.Model() as simple_model:
z = pm.HalfNormal('z', sd=1, shape=(N, K), testval=np.random.rand(N, K))
x = pm.Exponential('x', lam=tt.dot(z, tt.transpose(z)),
observed=x_train)
trace = pm.sample(init='adapt_diag')