No sampling when transforming random variables with theano using dot product

I think there is a couple of problems here:

  1. the RV z's default values are 0s, which gives an invalid parameter lam to the Exponential.
  2. the model is over specify, with more parameters than observations
  3. 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')
1 Like