Observed data in Bayesian networks

Thanks @nkaimcaudle, that was just what I needed. I’d somehow got the idea that I needed to make sure the shapes were the same for all the nodes, and going round in circles with that was stopping me seeing other problems. I’ll look into vectorising next - I couldn’t find a way to iterate making nodes other than with the loops, so if you’ve got some pointers for that I’d appreciate it, but at least now I have a model I can sample from. Working code below for anyone else who stumbles on this.

with pm.Model() as model:
    shape = (no_of_samples, no_of_root_categories)
    alpha = np.ones(no_of_root_categories)
    root_prior = pm.Dirichlet("Temperature Rating Prior", alpha)
    root = pm.Categorical('Temperature Rating', p=root_p, observed=hot_day)

    for item, label in enumerate(option_labels):
        node_data = meal_options[item, :]
        theano_alpha_probs = shared(np.ones(no_of_root_categories))
        theano_beta_probs = shared(np.ones(no_of_root_categories))
        node_prior = pm.Beta(f"{label} Prior",
                             alpha=theano_alpha_probs[root],
                             beta=theano_beta_probs[root],
                             testval=0.5)
        pm.Bernoulli(label, p=node_prior, observed=node_data)