如何使用pymc3构建MMSB模型?

时间:2018-02-27 14:37:39

标签: python bayesian pymc pymc3 inference

Here is the model I want to describe in pymc3。 我写了以下代码,但它们不起作用。

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)

0 个答案:

没有答案