Hi. I’m trying to model experimental data for multiple participants using a hidden Markov model based on pymc-extras’ DiscreteMarkovChain. I have a working model which uses a for loop to create a DiscreteMarkovChain distribution, emission matrix, and observed data for each participant, but it seems like quite an unweildly solution. I’d like to simply use batched dimensions like I would in other models, but each participant has seen a different number of trials, which means that each has a different length Markov chain.
The only solution I’ve been able to think of is to pad each vector up to the length of the longest, but the parameter I’m interested in is the transition probability, and the padded values would alter the transition probabilities (by either transitioning more or less than the participant themselves). Is there an elegant way to solve this problem, or should I stick with my for loop?