aeppl.dists.create_discrete_mc_op(srng, size, Gammas, gamma_0)[source]#

Construct a DiscreteMarkovChainFactory Op.

This returns a Scan that performs the follow:

states[0] = categorical(gamma_0) for t in range(1, N):

states[t] = categorical(Gammas[t, state[t-1]])

The Aesara graph representing the above is wrapped in an OpFromGraph so that we can easily assign it a specific log-probability.

TODO: Eventually, AePPL should be capable of parsing more sophisticated Scan`s and producing nearly the same log-likelihoods, and the use of `OpFromGraph will no longer be necessary.