You’ve got the idea, yes.
For variables with more than 2 categories, you can use a Categorical with a Dirichlet prior.
You can pass transform=pm.distributions.transforms.sum_to_1 to restrict values to sum to 1. Dividing those values by the sum of already known color should get the total sum right.
tt.stack and tt.concatenate can be used to combine the values to a matrix, but in this particular case it might be easier (but possibly a bit slower) to iterate over the rows and create an individual pm.Normal for each observation. This would also make it easier to marginalize out discrete parameters in case the sampler can’t deal with those properly.
1 Like