That post you are looking at is pretty old and the implementation is not optimal. You should instead take a look at How to marginalized Markov Chain with categorical?
That post you are looking at is pretty old and the implementation is not optimal. You should instead take a look at How to marginalized Markov Chain with categorical?