Hi. I want to create two categorical variables.
Each categorical variables can have three possible values.
I tried the following:
import numpy as np
import pymc3 as pm
import theano.tensor as tt
import matplotlib.pyplot as plt
p = np.random.uniform(0, 1, size=(2, 3))
basic_model = pm.Model()
x = np.array(
[[0, 1, 2],
[2, 1, 0]]
)
with basic_model:
cat = pm.Categorical('categ', p=p, shape=(2,))
cat.logp(x)
But it gives the following error when I try to get the log probability that an observation sequence appears, given the model:
"can't turn {} and {} into a dict. {}".format(args, kwargs, e))
TypeError: can't turn [array([[0, 1, 2],
[2, 1, 0]])] and {} into a dict. dictionary update sequence element #0 has length 3; 2 is required
Thanks.