0

Here is the model I want to describe in pymc3. I wrote the following codes, but they do not work.

with pm.Model() as model:   
    bernoulli_parameters = np.empty([N, N], dtype=object)
    for n in range(N):  
        for m in range(N):
            if (z[n,m]==z[n,m]):
                bernoulli_parameters[n,m] = myBeta[z[n,m]]
            else:
                bernoulli_parameters[n,m] = epsilon
    bernoulli_parameters_vector=bernoulli_parameters.reshape(1,N*N)    
    D = pm.Bernoulli('D',                                 
            p=bernoulli_parameters_vector, observed=Topology_Data_Vector)
Da_Yi
  • 1
  • 1
  • Please add the sample input and output: how do you know it's not working? – Norrius Feb 27 '18 at 14:41
  • As both z[n,m] and z[m,n] are hidden variables, I found I can not compare z[n,m] with z[m,n]. (z[n,m] == z[m,n] is always false). – Da_Yi Feb 27 '18 at 15:02
  • Besides, I can not use hidden variable z[m,n] as the index of myBeta, namely myBeta[z[m,n]] also does not work. – Da_Yi Feb 28 '18 at 01:57
  • The question is same as https://discourse.pymc.io/t/how-to-build-the-mmsb-model-with-pymc3/896 – Da_Yi Mar 01 '18 at 03:50

0 Answers0